This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Optimisation level in SES - nrf52832 + ICM20948

Hi,

I am developing an  ESB application with 1 central (nrf52832 DK) and several peripheral.  The peripheral are nrf52832 + ICM 20948.  Development is done with Segger embedded studio (SES) .

I am using SDK16, the latest.

 Application on the peripheral is working correctly in debug mode, although power consumption is higher that  would like while CPU resting.  

I have tried to compile the program in Release mode but I have ran in issues.   

I have tried to understand the difference between Debug and Release mode

I have  found that the preprocessor definition have some difference.

for Debug mode :  "DEBUG; DEBUG_NRF" from solution in Debug configuration  ;     For Release mode :  "NDEBUG"

DEBUG or NDEBUG does not affect the program operation.

In Code generation section:  Optimisation level is set differently.  

I ahve found out that  Optimisation level 0 work fine. This is the setting for DEBUG mode.

With Optimisation level 1 or 2,  the CPU does not communicate correctly with the ICM.  

When I try to read the quaternions, I get some blank instead of numbers.   Power consumption is not improved.

Optimisation level 1 and specially 2 are supposed to make the program more efficient and consume less power.  

Any Idea why it does not work with the ICM?

Regards,

Sylvain

Parents
  • Problem solved.  

    I have forgot to set the printf option to float in the new build configuration.

    The other problem was likely with the application size.  Removing an unused large matrix variable solved the issue and now the compiled program run normally, using optimisation level 1 or 2.  

    I still have to work on the power consumption,  200µA in resting mode.  I should be able to do better.

Reply
  • Problem solved.  

    I have forgot to set the printf option to float in the new build configuration.

    The other problem was likely with the application size.  Removing an unused large matrix variable solved the issue and now the compiled program run normally, using optimisation level 1 or 2.  

    I still have to work on the power consumption,  200µA in resting mode.  I should be able to do better.

Children
Related