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

Debugging Zephyr OS applications on NRF52832 with eclipse and openOCD

Hi,

I am trying to set up eclipse + gdb + openOCD for debugging zephyr 2.0.0. applications on nRF52832. Following the official Zephyr documentation build-and-run-an-application and setting my debug configurations in eclipse as shown in the next two figures I am able to debug a simple application consisting of a singe main function containing only few __asm("nop").

Unfortunately, when I try to debug the officially provided by zephyr ipsp example (contained in zephyrproject/zephyr/samples/bluetooth/ipsp) the debugging does not work properly. More precisely, when the debug session is started the program execution is not stopped at main() but on some other strange position. I guess, the program counter was not properly set for some reason, see the call stack in the next figure .

Parents
  • It looks like you didn't include the startup code.  The reset vector jumped to the wrong location.  I am not a Zephyr user so I can't tell you where to find it.  You need to search for it. 

    I see that you are using jlink.  It is better to use the GDB JLink instead of OpenOCD.  It' s the third one bellow GDB for OpenOCD.  Create a debug session with that. It's faster than using openocd with jlink.  Use OpenOCD for other type of jtag probe such as CMSIS-DAP or ST-Link.   

Reply
  • It looks like you didn't include the startup code.  The reset vector jumped to the wrong location.  I am not a Zephyr user so I can't tell you where to find it.  You need to search for it. 

    I see that you are using jlink.  It is better to use the GDB JLink instead of OpenOCD.  It' s the third one bellow GDB for OpenOCD.  Create a debug session with that. It's faster than using openocd with jlink.  Use OpenOCD for other type of jtag probe such as CMSIS-DAP or ST-Link.   

Children
No Data
Related