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

nRF51422 - s310 - IAR won't debug but will load the hex file in a ble application

I am working on a ble project using the nRF51422 and IAR. I can load the code onto the board from IAR and it works as expected, but I run into errors when I run the code with the debugger. Does anyone know why the code won't run through the debugger and what I can do to fix it?

I've tried the suggestions from the following posts but neither worked. devzone.nordicsemi.com/.../ devzone.nordicsemi.com/.../

I am using

  • SDK 6.1
  • SD s310 - 1.0
  • IAR v7.2
  • Jlink

Here is my linker file image description

And main

main.png]

The gpio, clock, ble and rtc initializations happen in main_init() and main_post_init().

There are four strange behaviors

  1. When the code runs in the debugger it blows up and the PC points to the end of memory.
  2. When the code runs to a breakpoint on line 56 (in main) it blows up after the first step into the code once. However, it doesn't blow up if the assembly code is stepped through.
  3. When the code runs with a breakpoint on line 61 it doesn't make it there. When the program is paused the PC is pointing to address 0x20000008, which is inside RAM when s310 is disabled (from the S310 Soft Device Specification 1.0)
  4. When a service call is made to the soft device to start advertising ble packets, the error code below is returned.

image description

image description

image description

Thanks in advance!

Related