I have a project where I am combining STM32 HAL libraries and mbed. I have followed the various posts to get this working, and I have a basic example compiling and debugging OK.
but…
I want to use an EventFlag in one of the ISRs (for a DMA). So I add:
#include “mbed.h”
into the ISR file to allow this. Just doing this act alone makes compilation fail with the following error:
I have tried using #include “stdlib.h” like others have suggested. That doesn’t fix the issue.
The “mbed.h” file includes also the “chrono” header file. Unfortunately, since the “chrono” is a C++ header file (a Standard C++ Library header) it’s impossible to include it into a C source file. You can try to rename the “stm32g4xx_it.c” to “stm32g4xx_it.cpp” but then you’ll face other sort of issues …
After changing the stm32g4xx_it.c to stm32g4xx_it.cpp, the compilation succeeds, but the flash size of the binary is larger than 128k which exceeds what the G431RB part can support.
Any advice on how to reduce this down? I’m trying to use .mbedignore to take out quite a bit of the OS that I won’t be using, but none of my changes seem to have any effect on the build size.