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
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…
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.
Here's my debug configuration in uViiosn, maybe you can spot something obvious:
I have not tested tracing, but except for that, it looks correct.
1)What UART terminal software are you using ?
2) Try to use nrfjprog, and call "nrfjprog --eraseall" before you load the firmware, and see if that makes any difference.
I'm using nrf connect to erase. But I will try with nrfprod and let you know. Thanks