I'm working with the NRF52 Development kit for the NRF52840 modifying the secure BLE bootloader to add my custom transport together with BLE so I can update my device with BLE and with my custom transport. I'm going through the memory layout for the NRF52840. From reading the docs and going through the source code I'm trying to understand how the bootloader is fitting in memory and what should I change because my bootloader will be larger than the current one because I will be using 2 transports.
When I compile the DEBUG DFU example for secure BLE with S140 for the PCA10056 dev kit, using SEGGER Embedded Studio, the "text" section is reported with addresses going from 0x000F13D4 to 0x000F978B so the size is 33719 bytes, is this the bootloader size or the bootloader + MBR parameters + bootloader settings size? If I compile the non-debug version the size goes down to 21853 bytes, so the bootloader start address is dynamically defined according to the compilation size, because in both cases, the BLE DFU works perfectly.
What would happen if I update the bootloader with another bootloader which is bigger in size? The MBR parameters and bootloader settings will become corrupt? Is there any way I can reserve some space to account for future bootloader updates?
Thank you very much for your time and help!