06-24-2023 01:05 AM
I'm using the general use-case example by BSEC which I got from official github repository. My application project builds fine. As soon as I reach the first BSEC function (which is provided by the "libalgobsec.a" static library), program goes to hard fault interrupt handler.
My best guess would be that stack/heap size is insufficient. I have tried increasing both from 0x200 (heap) and 0x400 (stack) to 0x1000 (both) then also 0x8000 (both) through my linker file. However I see no difference - program hits the hard fault handler as soon as program enters the "bme68x_bsec_update_subscription" function.
It's also worth noting that I used proper "libalgobsec.a" static library - the one under Cortex-M7 folder (since my MCU uses this core)
Maybe there are other reasons I should consider in this case?
Under BSEC examples, I have found one Readme (in the appendix) file which states the algorithm inclusion process. I didn't follow the exact rules because (I think) they are meant for Arduino platform (and I'm using STM32 with PlatformIO in VS Code). However there are some flags that might be important and could affect this case. The only thing I did about compiler/linker flags is the inclusion of library libalgobsec.a" and provided flags for hardware floating point arithmetic.
I'm using STM32F756xx microcontroller in combination with CubeMX code generator (generates linker file where I can set stack/heap size).
07-06-2023 04:40 PM
Hi lgacnik97,
You have to use libalgobsec.a under Cortex_M7 folder as your host MCU is STM32F756xx microcontroller(ARM®Cortex®-M7).
Cortex-M4 and Cortex-M7 have different BSEC librarie and can't be used together.