Compiler optimisation issue (remove used functions)[solved]
- June 1, 2020
- 13 replies
- 13194 views
Hi all,
On our card with a STM32L4 we use a siliconLabs BGM13P32 for the BLE.
The L4 communicate with the BLE SOC in NCP mode (see here for more details).
To do that i have integrated the SiliconLabs libs (BGLIB) to our project on stm32cubeIDE.
The project build fine, with no errors/warnings (default options) and i can communicate with the BLE SoC ...only if i use -O0 option in optimization options.

If i use for example -Og, the functions used in BGLIB (siliconLabs) is removed from the binary (checked on .map file). The project build without errors but the com with the BLE SoC fails !
For information our project is in C++. Join with this post the class of our Bluetooth Com. (bluetoothCom.h/cpp).
The whole project is build with -Og optimisation option, just bluetoothCom.cpp use -O0 option to have a correct communication.
Do you have an idea how to resolve this ?