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

Problems with the j-link debugger on nrf51 dongle

Hi, 

I managed to compile and run(?) my first two programs for nrf51 dongle on Keil uVision, however while i think they run I cannot make the debugger work and see what they do.

The UART outputs is emply, both in the uVision and when I try the Termite terminal. Well on termite I can get some garbage, but no matter what settings I use there I cannot get it to show anything human readable. Then I found the J-link web control panel. And on there is subpage showing log. Most of the log, while the application is running looks like this:

T4DC0 443:948.711 JLINK_IsHalted()
T4DC0 443:949.376 - 0.675ms returns FALSE
T4DC0 444:050.450 JLINK_HasError()
T4DC0 444:050.530 JLINK_IsHalted()
T4DC0 444:051.235 - 0.796ms returns FALSE
T4DC0 444:152.242 JLINK_HasError()
T4DC0 444:152.319 JLINK_IsHalted()
T4DC0 444:153.129 - 0.849ms returns FALSE
T4DC0 444:253.916 JLINK_HasError()
T4DC0 444:254.008 JLINK_IsHalted()
T4DC0 444:254.879 - 0.910ms returns FALSE
T4DC0 444:355.449 JLINK_HasError()
T4DC0 444:355.820 JLINK_IsHalted()

How can I fix this? Thanks
Parents
  • Hi,

    Make sure that you have this in sdk_config.h

    #define NRF_LOG_ENABLED 1

    Take a look at how it's done in the pca10031(nRF51 dongle) RNG example project, in folder SDK_12\examples\peripheral\rng\pca10031\blank\arm5_no_packs

  • Hi, Thank you for your reply. I just compiled and run the example you mentioned and the program compiles and load with no problems. However in debug I still can't see any messages in neither UART nor RTT (using RTT viewer, external terminal and debug output in the IDE).

    My problem must lie somewhere in the configuration of my IDE or the debugger maybe? 

    One thing worth noting (I think) - when I turn on the Trace option in my IDE, the device goes into HardFault_Handler immediately. 

Reply
  • Hi, Thank you for your reply. I just compiled and run the example you mentioned and the program compiles and load with no problems. However in debug I still can't see any messages in neither UART nor RTT (using RTT viewer, external terminal and debug output in the IDE).

    My problem must lie somewhere in the configuration of my IDE or the debugger maybe? 

    One thing worth noting (I think) - when I turn on the Trace option in my IDE, the device goes into HardFault_Handler immediately. 

Children
Related