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

Softdevice merge into debug fw

Hello everyone.

I have made the next solution for merging softdevice into debug fw.

i 've added the next lines in ld script

MEMORY
{
SD_FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x27000
SD_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x2260
.....
}

SECTIONS
{
/* include the softdevice binary image: */
.SOFTDEVICE :
{
KEEP(*(.softdevice))
} > SD_FLASH = 0xFF
}

created asm file with the next lines

.section .softdevice, "ax"
.incbin "softdevice.bin"

converted softdevice.hex to softdevice.bin by objcopy

It is built successfully and flashed to device.

But debug stops in undefined space after i call ble_stack_init()

i use clion+jlinkgdb server

Where is my mistake and what causes inability to debug code after call?

  • Hi,

    I have never tried to link in a binary image, but as a troubleshooting step, I would suggest to read out the memory from 0x0-0x27000 after you have loaded your merged binary, then repeat this with the original Softdevice hex and compare the results.

    But debug stops in undefined space after i call ble_stack_init()

     Not sure what you mean by undefined. Is the program counter inside the Softdevice's memory range?

Related