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

How can bootloader know SoftDevice size ?

Hello Nordic team,

I'm using an nRF52840 with SoftDevice S140 version 6.1.1 which size is 0x25000 (without MBR).

My bootloader contains the bootloader code written at the end of the flash and the MBR from 0x0 to 0x1000. 

The application contains the SoftDevice in flash written in flash from 0x1000 to  0x26000 and the application code written from  0x26000 a CRC written just after its Vector Table so at the address 0x26200.

I want the bootloader to read the CRC at the address APP_CODE_BASE + 0x200. 

But since the SoftDevice size can vary (for example the version 7.0.0 size is 0x27000), APP_CODE_BASE can vary too. Knowing that my bootloader with MBR + bootloader can't be modified once written to flash, how can my bootloader find APP_CODE_BASE or SoftDevice size from the SoftDevice binary data ? 

Thanks in advance,

Aloïs KYROU

Related