I have an Afafruit NRF52 board with SD 132 and 5.1 dual fw bootloader. I implemented RTT logging and controlling (input) and the code is compiled using arduinoBuilder with RTT and debug level 3. The device uses to control DALI lights but sometimes it hangs, I can see that it does not responses to input and light level never changes.

I want to debug it, maybe getting a stacktrace to see where it hangs, hoping it's a software issue.

Any leads on how to do that ? Tutorial maybe ?

  • OpenOCD appears to support both the nRF51 and the JLink.
    – Majenko
    Jan 7, 2019 at 11:07

1 Answer 1


I haven't tried this, but OpenOCD supports both the nRF52 and the JLink. Something like (on Linux):

openocd -f /usr/share/openocd/scripts/interface/jlink.cfg -f /usr/share/openocd/scripts/target/nrf52.cfg

might start OpenOCD.

You can then connect with (nRF52 flavour of) gdb (arm-none-eabi-gdb).

You can find information about using gdb with OpenOCD here and here.

  • i was told i can use it with openocd and eclipse mcu plugin which is nice, but j-link supposed to be much more with his ozone debugger. i just didn't figure out yet how to debug the code with it or how to use the jlinkexe CLI tool to get a stacktrace, or even how to point it to the debug symbols, and of course i compiled with arduino ide so i have no clue where the debug symbols are, i assumenot in the *.bin*.hex files.... Jan 7, 2019 at 11:28
  • and it's feather nrf52 no nrf51 the 51 tag is because i had to put a tag and there is not nrf52... Jan 7, 2019 at 11:29
  • Just change 51 to 52 then. OpenOCD supports both.
    – Majenko
    Jan 7, 2019 at 11:33
  • according to openocd it doesn't support non stop mode. i want to debug a running target, i'll explain. the atget seems to be "stack" doesn't responds, however if i use jlink commander and use halt then go presumably i didn't do much, stopped the cpu then resumed it, however it does causes restart and then i don't know what happen. i need to get a stacktrace or get the PC to be sure the cpu indeed doesn't stop... Jan 7, 2019 at 14:05
  • 1
    bummer :-( maybe i'll go for gdbserver method, for that iu need to see how to convert the project from aduino to eclipse mcu or Segger's "Ozeone" Jan 8, 2019 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.