I'm trying to do step-through debugging with the nRF9160 DK using Segger Embedded Studio and it's jumping all over the place. I assume this is due to optimization but perhaps I'm wrong?
I'm trying to do step-through debugging with the nRF9160 DK using Segger Embedded Studio and it's jumping all over the place. I assume this is due to optimization but perhaps I'm wrong?
CONFIG_DEBUG=y in your prj.conf should do it.
Optionally in SES you can go to "Project" -> "Configure nRF Connect SDK Project" -> "Build and Link Features" -> "Compiler Options" -> "Optimize for debugging experience".
CONFIG_DEBUG selects that same flag, albeit in a less clear way.
In GCC this sets the "-0g" flag in the compiler options.
Doesn't work for me unfortunately. I tried all three options mentioned above, and it still jumps all over the place. I also tried to add -O0 compiler flag with no luck.
See a picture below, it stops only on line 78, 91 and 100.
Is there any other way to disable optimisation?