We are developing a platform that can have multiple configurations, with or without softdevice/ble, with or without bootloader (for upgrading), both on nrf52832 and nrf52840.
To simplify support for combinations of those configurations, the MBR would be a good common ground for handling the bootloader, since it seems to be configurable.
I've seen threads about running MBR + bootloader without softdevice, and that seems to work well. And since starting the bootloader and then passing on to the application is done in the scope of the bootloader, just requesting an irq vector change and calling the reset handler. Thus falls under the following statement under 12.3 reset procedure in the S140_SDS_v1.3.pdf:
- Else if a bootloader is present:
- Forward interrupts to the bootloader.
- Run Bootloader Reset Handler (defined in bootloader Vector Table at BOOTLOADERADDR).
- And the bootloader is intended to be written by the user, so no problem there.
My concern is actually the case in the configuration without softdevice and without bootloader. That means, no UICR.NRFFW[0] is set. In that case, the following statements applies:
- Else if a SoftDevice is present:
- Forward interrupts to the SoftDevice.
- Execute the SoftDevice Reset Handler (defined in SoftDevice Vector Table at 0x00001000).
- In this case, APP_CODE_BASE is hardcoded inside the SoftDevice.
- The SoftDevice invokes the Application Reset Handler (as specified in the Application Vector Table at APP_CODE_BASE).
- Else system startup error:
- Sleep forever.
I've tried to put an application with interrupt vector at 0x00001000, and put the RAM start for the application at 0x20000008 (8 bytes needed for disabled softdevice), and it seems to be identified as a "softdevice", and the application seems to be working fine. So it seems to be working as expected.
But what is the criteria for an application to actually be identified at that scenario? Would that method stop working in future versions of the MBR, so it won't identify the "softdevice", and instead sleep forever?