nRF51822: How to properly define FLASH region boundaries in the case secure Bootloader is used

Hello, guys.

We are using nRF51822 SoC together with nRF5 v12.3.0 SDK.

According to the nRF51822 memory layout, half of the 256KB flash memory space is taken by the Softdevice, MBR, and Bootloader.

The other half (~127KB) is at our disposal for the Application code.

Now, in the case we are using a secure Bootloader, do we need to properly adjust the FLASH region size in a linker script of our application so that only 0x1B000 - 0x3AC00 FLASH region is at our disposal for storing the application code, constants, and initialized/uninitialized data? To have: 

MEMORY
{
  FLASH (rx) : ORIGIN = 0x1B000, LENGTH = 0x1FC00
  RAM (rwx) :  ORIGIN = 0x20002028, LENGTH = 0x5fd8
}

instead of:

MEMORY
{
  FLASH (rx) : ORIGIN = 0x1B000, LENGTH = 0x25000
  RAM (rwx) :  ORIGIN = 0x20002028, LENGTH = 0x5fd8
}

Should we reserve any flash memory area between the application and bootloader to serve some purpose (that we are currently unaware of)? According to the single-bank application update described here (our application is ~100kB in size so the only way to update it would be through a single-bank update), there should not be any FLASH space between the application and the Bootloader, but we would just like to double-check with you.

Thanks in advance for your time and efforts.

Sincerely,

Bojan.

Related