nRF Connect blinky sample hard to debug

My setup:

Mac OS 11.5.2

Vs Code 1.60.2

nRF Connect SDK 1.7.0

nRF52840DK

Using the tutorial videos provided I went through the process of creating the basic blinky sample. I can build, erase and flash and the code appears to work.

When I click on the Debug button bottom left from the nRF Connect pane, the debugger stops in a file called fatal.c sometimes, and at other times stops in reset.S or cpu_idle.S. 

However, if I then click the stop button (small red square in debugger controller), and then the Run and Debug button that appears afterwards, it sometimes works just fine and I can step through the source code.

If I try the samples/bluetooth/peripheral_lbs application, it debugs directly from the nRF Connect pane without difficulty and breaks at the beginning of the main function.

Parents Reply
  • Hi, 

    Enable debug options adds CONFIG_DEBUG_OPTIMIZATIONS=y and CONFIG_OPENOCD_SUPPORT=y to the build command line. It does not modify any project files. These options set -Og optimization level and add thread info structures required for debugger thread awareness, respectively. 

    Generate configuration does not generate prj.conf file. It generates a CMake build system. Please refer to NCS/Zephyr documentation for details on the build process.

    We recommend to leave it unchecked for blinky due to a bug in the build system and debug server that is causing the debugger to halt on stray debug symbols.

    -Amanda

Children
No Data
Related