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

S332 + Bootloader_secure memory map and linker config


Hi, I have some questions about the memory map, ram usuage and linker config for the secure bootloader when used with the S332 (4.05 sd_req 0x94) softdevice.

I have tried to get DFU to work with the default linker settings from SDK 13.1, these are

  FLASH (rx) : ORIGIN = 0x78000, LENGTH = 0x6000
  RAM (rwx) :  ORIGIN = 0x20002060, LENGTH = 0xDA70

However although my application would start when merged with the appropriate bootloader settings and flashed to the SoC, it would not perform a dfu update successfully.

If I change the bootloader linker settings to those from the Thingy FW secure bootloader implementation then it does work. These are as follows.

  FLASH (rx) : ORIGIN = 0x75000, LENGTH = 0x9000
  RAM (rwx) :  ORIGIN = 0x20002C00, LENGTH = 0x5380

I would like to understand why the Thingy FW bootloader linker settings work and why? Why was it necessary for the Thingy FW bootloader mem map to be changed and why do I need the same settings for my S332 based project. Are there any documents apart from Hung Bui's excellent guide?

Other background info about the rest of my application

S332 based application - using ANT_s332_nrf52_4.0.5.hex

My application size:

Preparing: app_nrf52832_xxaa_s332.bin
Preparing: app_nrf52832_xxaa_s332.hex

   text    data     bss     dec     hex filename
  57836     692    4244   62772    f534 _build/app_nrf52832_xxaa_s332.out

Linker config for my app

  FLASH (rx) : ORIGIN = 0x29000, LENGTH = 0x57000
  RAM (rwx) :  ORIGIN = 0x20004AD8, LENGTH = 0xB528

As I said, although I have DFU working successfully using the ThingFW secure bootloader linker settings I want to understand why the change was necessary in case I am missing some key point which could have other repercussions for the rest of the system.


Thanks for your help

-Allen

Related