nRF53 and Zephyr: optimization level

Hi,

I would like to know if it is possible to configure the optimization level only the application built on top of Zephyr, and not all the project.

I am trying to debug the temperature sensor example for TMP117. It is working for the board nrf53 with optimization set size.

If i change it to no optimization i am having stack overflow.

I have increased the main stack size up to 4 KB, but the problem is still present.

As far as i could get with my tests, the stack overflow happens inside the function pm_system_suspend declared in power.c

Could you give some advice regarding this aspect please ?

Thanks in advance !

Kind regards

Riccardo Gaiati

Parents
  • Hi,

    If i change it to no optimization i am having stack overflow.

    It is a bit unclear to me why you do not want to have full optimizations on the whole project and only on the application? 

    I have increased the main stack size up to 4 KB, but the problem is still present.
    As far as i could get with my tests, the stack overflow happens inside the function pm_system_suspend declared in power.c

    It is possible that this is the issue with the idle thread stack size. Since most power related things (when enabled) are done in the idle thread, you need to keep an eye on the CONFIG_IDLE_STACK_SIZE as well.

  • Hi Susheel,

    thanks for the reply.

    The reason i would like to compile with no optimization is to have a better debug experience. And i am mainly interested to debug our application.

    Yesterday I tried to increase the Idle stack size and the problem seems to disappear.

    Thanks again for the support !

    Kind regards

    Riccardo

Reply Children
No Data
Related