We are developing part of an application for products that are supposed to have 10+ years of service life with updates over the whole lifetime. We want to have a flash memory layout that supports this in a good way.
The softdevice has to be installed at 0x1000. Then we have our application. We won't install a new Softdevice without installing a new application so both can grow in size without a problem.
We also have a small bootloader near the end of the flash memory that decrypts, verifies and installs upgrades. It can also upgrade itself by calling the MBR with the SD_MBR_COMMAND_COPY_BL command.
The bootloader should do more things in the future and then it will then need more flash memory. We don't know how much and we don't want to reserve more than needed.
We tried to solve this by putting the ISR vector at the end of the bootloader's reserved memory, then newer versions could grow downwards as needed. This doesn't work though as we can't upgrade it with SD_MBR_COMMAND_COPY_BL as it only takes source and length parameters. Is this possible to solve in some other way without having to use a second stage bootloader?