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

all SVCALLs spin after updating to SDK11

when upgrading from SDK8 to SDK11 every SVCALL to the softdevice now just jumps to the application's weak SVC_handler and "B ." spins.

I can make a main.c file with only this in it and it still happens:

int main(void) { nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC; SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);

for(;;)
{

}

}

I did move the start the nrf51422_xxac application ram at:

MEMORY { FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x40000 RAM (rwx) : ORIGIN = 0x20003000, LENGTH = 0x5000 }

so that the soft device will have enough ram to run. Before doing that all SVCALLs just jumped into the weeds. Shouldn't the svc instruction vector to the privileged interrupt vectors in the softdevice?

I know that the SD is working since I can compile the example code from the stack and run it. My application is compiled through Eclipse environment.

Any clues?

  • Hi,

    Your RAM setting are OK but your FLASH settings are NOT OK. You are compiling your application to flash at address 0x0. So when you flash your application it is overriding the softdevice (normally i expected KEIL flash to fail if the application is trying to write to softdevice flash area)

    You have to change the FLASH settings depending on which softdevice (S110,S120 or S130) and whic version of softdevice you are using. If you are using the softdevice hex file from the SDK11 folders, then it must be version 2.0.0. Please look at this blogpost to see the RAM and ROM(Flash) settings that you need to put for your application.

  • doh! I was cleaning up things and must have copied a non-SD linker file into my project from stack 11. I used to be just using the one directly from the toolchain dir under the SD but now that I am getting my projects cleaner so I can update the stack quicker I made some rules to pull in different linker files based on project settings and made a baseline set of linker files in my app dirs. I would have expected the tools to complain about the overwrite however looking back I do a --sectorerase on that so it just cleared it out as requested. I knew it was something simple :)

Related