cancel
Showing results for 
Search instead for 
Did you mean: 

Compiler optimisation issue (remove used functions)[solved]

MLE S.1
Associate III

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.

0693W000001pmqpQAA.png

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 ?

This discussion is locked. Please start a new topic to ask your question.
20 REPLIES 20
waclawek.jan
Super User

Thanks for coming back with the solution.

Please select your post as Best so that the thread is marked as solved.

JW