I have an RT-1050 with an external QSPI flash chip for holding my application and another external flash chip for holding multiple versions of firmware.
What I'd like to do is this:
Have the FlashLoader resident in QSPI flash as a second stage bootloader. I'd like the BootROM to launch the FlashLoader (load it from QSPI to RAM and run it), then I'd like the FlashLoader to validate a couple images in the 'data' Flash and copy one of those images to QSPI flash. I'm implementing a basic A/B partitioning scheme for OTA.
After that is complete I'd like FlashLoader to launch the application as XiP in the QSPI flash.
I need the Flashloader and the application image to be encrypted since they exist in external flash. RT-1050 provides the BEE so it can do on the fly AES decryption, so that's what I'd like to do.
I need the Flashloader to validate the image (signature validation using public key decryption) before launching.
I've read through a plethora of documents from NXP that all seem to indicate that what I want to do it possible.
However, the "Flashloader" source code provided by the SDK (MCUXpresso, Import SDK Examples, evkbimxrt1050_flashloader) is expected to be running out of RAM and does not do on the fly decryption or application signature checking. When I 'enable' these #defines in the code it no longer compiles because of QSPI dependencies and OTFAD libraries that are missing.

1. Does anyone out there have an example Flashloader that is encrypted and executes from QSPI flash?
2. Does anyone out there have an example Flashloader that runs an application that is encrypted and validated?
The examples I see from NXP seem to assume that Flashloader is only used in RAM in the factory one time and the end user application is encrypted, stored at the base of flash along with some configuration information, and the BootROM is what launches the end application. My end application is going to need to support "over the air" updates outside of the factory, so I need the 'second stage bootloader' (i.e. modified version of Flashloader) to be checking the application integrity every time it boots and copying images from data flash to QSPI flash. This means that I can't have the BootROM launch my end user application.
Thanks,
Greg