I'm trying to update the default QSPI SBL provided by the SDK to support a primary and a secondary application image. From syscfg I created CONFIG_BOOTLOADER0 (primary application image) and CONFIG_BOOTLOADER1 (secondary application image). I modified the default QSPI SBL to boot from the primary application image. If the primary application image failed for any reason, it would try the secondary application image. Just like the default QSPI SBL, it will load and run the applications on the 3 cores that are not running the SBL. Then, it will load and run the application on r5f0-0.
If I corrupt the multi-core image header of the primary application image, my SBL correctly detect and switch to boot from the secondary application image. All cores resulted in running from the secondary application image.
However, if I corrupt the r5f0-0 RPRC header, my SBL successfully load and run the primary application image on the other 3 cores. When the SBL tries to load the image for r5f0-0, it encounters the error in the RPRC header. Then, it attempts to start over and boot from the secondary application image. The problem is r5f1 is already running the primary applications Just reloading/rerunning with the new application doesn't work (maybe because the cores are already out of reset). The end result is both cores on r5f0 have the secondary application image and both cores on r5f1 have the primary application image. What I wanted is to have all 4 cores run the same secondary application image.
Part of my goal is to avoid writing a flag to the flash to indicate which application image to load and have the SBL read this flash prior to loading the application image. My question is if there is a function I can call or steps I can take to put the cores in a state where I can reload/rerun the application?
Thanks in advance.