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

How to run ble_app_hrs project?

Hello, I have major problem trying to debug/run ble_app_hrs example. The thing is that when I enter debug mode the code is stuck here:


0x000001B4 4908      LDR      r1,[pc,#32]  ; @0x000001D8
0x000001B6 68C9      LDR      r1,[r1,#0x0C]
0x000001B8 2900      CMP      r1,#0x00
0x000001BA D0FB      BEQ      0x000001B4

it doesn't even get to this timers_init();:


int main(void)
{
    uint32_t err_code;

    timers_init();

I really don't know what's the problem. I assume that it's hidden in startup or system files, but since I'm a beginner it's had to find solution. Could you help me, please?

I also tried to load built example from nRFgo Studio, but when I push "Button 0" LED0 doesn't start blinking, LED0 and LED1 are OFF.

P.S. I'm using Keil uVision 4

  • I am using softdevice 5.2.0, I can't see any reason now why it shouldn't be working for you. Did you at least get to debug a bit better when turning off optimization? Remember that you have to rebuild your project after changing these settings.

  • When I did as it is in manual then this window pops out:

    "Running application C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/nrf51Studio/nrfjprog.exe --snr 480203645 --programs C:/Keil/ARM/Device/Nordic/nrf51822/Board/pca10001/ble/ble_app_hrs/arm/_build/ble_app_hrs.hex --clenr0 0x0 --reset Loaded JLinkARM.dll --clenr0 option should be used with --programs to protect softdevice (hex file did not have this info) ERROR: program file to flash failed!! "

    But when I switch tab "program softdevice" to "program application" then everything goes ok...

  • You will get this error if you try to program an application from the "Program SoftDevice" tab, since an application is not a softdevice. You need to download the softdevice zip separately, program the hex file from the zip, called something like s110_nrf51822_x.x.x_softdevice.hex, and after this you can program the application as usual from Keil.

  • Where can I download it? I tried google it, but no match (instead of x.x.x was put 5.1.0)...

1 2 3 4 5