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

nRF52840 - How to debug Zephyr code when the radio is running. HardFault

Hi, I found that after migration from Zigbee Thread SDK to Zephyr GDB debugging functionality is broken.
I have read a lot about PRIMASK register, GDB hooks, and so on, but those didn't fix all of my problems.
I want to use Eclipse + GDB for stepping through the code and dynamic breakpoint placement.
I found a solution, that is somehow satisfying my needs - I mean Monitor mode debugging using Jtrace probe.
```
https://www.segger.com/products/debug-probes/j-link/technology/monitor-mode-debugging/
```
+ custom settings passed to JLINK cmd.

This isn't an ideal solution, as MMD works only in Jlink PRO / Jtrace programmers - so no way to get it working on your dev boards.

Can you provide some universal way to step through the code without HardFaults and resets?

Parents
  • Hi,

    Are you using Zephyr directly, or nRF Connect SDK? Which protocol are you using (Zigbee/Thread/BLE)?

    Monitor Mode Debugging can be run on our nRF52 DKs in evaluation mode, see this tutorial. For commercial use, you will have to get a license from Segger.

    Best regards,
    Jørgen

  • Hi, thanks for your fast reply.
    We are using nRF Connect SDK for the Zigbee application and building it with west + makefiles.
    According to www.segger.com/.../

    A: No, Monitor Mode Debugging is only supported by J-Link PLUS, PRO, ULTRA+, and J-Trace. J-Link BASE and on-board J-Links cannot be used for Monitor Mode Debugging

    I'm wondering if it is really possible.

    I'm using opensource toolchains and IDE, and I was able to run MMD by compiling some parts of the sample project from Segger. Next, I've added some gdb commands for init 

    mon reset 0
    mon exec SetMonModeDebug=1
    mon exec SetMonModeVTableAddr=0x1f000

    And It just works, but only using our external JTrace probe.
    You mention some additional licenses; is it possible to upgrade onboard nrf52 devkit JLlink? Or should it work out of the box in your opinion, if our second (JTrace) configuration is working? 

Reply
  • Hi, thanks for your fast reply.
    We are using nRF Connect SDK for the Zigbee application and building it with west + makefiles.
    According to www.segger.com/.../

    A: No, Monitor Mode Debugging is only supported by J-Link PLUS, PRO, ULTRA+, and J-Trace. J-Link BASE and on-board J-Links cannot be used for Monitor Mode Debugging

    I'm wondering if it is really possible.

    I'm using opensource toolchains and IDE, and I was able to run MMD by compiling some parts of the sample project from Segger. Next, I've added some gdb commands for init 

    mon reset 0
    mon exec SetMonModeDebug=1
    mon exec SetMonModeVTableAddr=0x1f000

    And It just works, but only using our external JTrace probe.
    You mention some additional licenses; is it possible to upgrade onboard nrf52 devkit JLlink? Or should it work out of the box in your opinion, if our second (JTrace) configuration is working? 

Children
No Data
Related