The SDK and SoftDevice documentation show that application is located at lower address than the bootloader.
Is it possible to rearrange memory layout to something like this:
I don't see why it wouldn't be possible since start addresses of the application, bootloader, etc are stored in the UICR registers. And I can point those registers to any address.
I'm using nrf52840 device.
It is possible, but I do not see the reason for changing the memory map as shown above, since the whole point for the bootloader being placed at the end of flash is to make it possible to update to a new version of the SoftDevice that is larger than the one that is currently present. By placing the BL after the SD you cannot update to SD that is larger than BL Start Address-SD Start address(0x1000).
It is only the bootloader start address that is stored in UICR, the SoftDevice expects the application to be located immediately its end address. Or to be more exact, after passing execution to the SD it will initialize it self and then jump to the end address and expects to find the vector table of an application/bootloader at that location.
Thanks, it really makes sense to place bootloader on the opposite side from the SD.
Happy to help :)