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

Propose change of RAM settings in softdevice/*/toolchain/armgcc/*.ld to match Softdevice

For example, in SDK11, the file:

components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxaa.ld

Contains:

  RAM (rwx) :  ORIGIN = 0x20000000, LENGTH = 0x4000

However, as I understand it, no program can possibly run with Softdevice S130 with these settings, because the softdevice needs the first 0x2000, or possibly 0x1eb0 bytes of RAM. The correct settings would be something like:

  RAM (rwx) :  ORIGIN = 0x20001eb0, LENGTH = 0x2150

or

  RAM (rwx) :  ORIGIN = 0x20002000, LENGTH = 0x2000

As the .ld-file is under the s130 section, I had expected it to be adapted to the requirements of that softdevice. I spent many hours trying different settings before i figured out that this was what caused the initialization of the softdevice to fail (without any clear error code).

Note also that the FLASH settings adapt the starting address to be after the softdevice.

I think it would be much less confusing if you adapted the .ld files in the components/softdevice//toolchain/armgcc directories to match the requirements of the softdevice.

Especially so since your example code doesn't support the 51822 out of the box (it would be nice if it did).

Related