06-20-2024 12:05 PM - edited 06-20-2024 12:07 PM
Hello. Apologies for using this forum for bug reports, but I couldn't seem to find a relevant GitHub page for the non-Arduino BSEC's issues. The version of BSEC 2.5.0.2 I downloaded on 6/19/2024 is from https://www.bosch-sensortec.com/software-tools/software/bme680-software-bsec/.
I used the reference code in BSEC 2.5.0.2's bsec_integration.c/.h files and started having memory write access errors when calling bsec_iot_init(). I found that bsecInstance's pointers weren't being set in bsec_iot_example.c/.h or bsec_integration.c/.h's code, and since neither allocateMemory() nor bsec_mem_block were being used, I fixed the bug and a few other compiler warnings by changing:
in bsec_integration.h:
uint8_t bsec_mem_block[NUM_OF_SENS][BSEC_INSTANCE_SIZE];
uint8_t *bsecInstance[NUM_OF_SENS];
to:
extern uint8_t bsecInstance[NUM_OF_SENS][BSEC_INSTANCE_SIZE];
and in bsec_integration.c, I:
added #import <string.h> to fix a missing import with memset() under the "header files" section,
removed the allocateMemory() function since it was unused,
and added:
uint8_t bsecInstance[NUM_OF_SENS][BSEC_INSTANCE_SIZE];
to the "global variable declarations" section.
My project compiles and runs fine after making the changes.
Thanks,
Will
06-24-2024 09:27 AM
Hi WilliamElder,
Thanks for your inquiry.
Thank you for your feedback. Yes, currently only the BSEC software package contains non-Arduino BSEC code. You can refer to the example code and make modifications in the code.