We have a project where an RT1176 based board will be communicating with a PC via USB as a CDC device.
We would like to be able to do a secure firmware update over the USB interface without having to switch any input levels to change the boot configuration.
We are using the RT1170-EVK and MCUXpresso for development. Our custom board will have the QSPI flash, SD Card, and SDRAM - all same as on the EVK.
The current plan is to boot from SD Card where firmware is loaded into SDRAM for execution. This is working fine, but we need to have a firmware update scheme. Can any of you provide suggestions? Keep in mind that we do not want to press a button or change any of the boot configuration input levels such as would need to be done if using the internal ROM's loader.
I've spent some time looking at SDK 10's bootloader_examples Flashloader code.
Please confirm that one option would be to put Flashloader in the QSPI flash and make it the boot device. Then, if no firmware update is initiated over USB within a timeout period, load the normal application from SD Card into SDRAM and execute. We would have to provide a way to force RT1176 firmware to do a soft reset and then have our PC side application watch for the Flashloader's USB HID device to become available and communication with it before the timeout expires. Our PC application would then load firmware into SD Card memory via the API defined in the MCU Flashloader Reference Manual pdf.
For this scheme to work, it looks like we would have to modify Flashloader to take care of the firmware image transfer from SD Card into SDRAM since it doesn't appear to support this now. I understand there is a jump length limitation. Will we be able to jump from the QSPI flash address range into SDRAM?
Another option would be to always boot from the SD Card (and execute from SDRAM) using a Primary and Secondary firmware image scheme. That is, when firmware is being updated, it would first modify the SD Card sectors so that IVT and boot data point to the secondary image. Then it would update the Primary image on SDCard; change the IVT & boot data back to pointing to Primary image; then copy Primary image to the Secondary image. It would be vulnerable to power-loss just during short time IVT & boot are updated.
This almost sounds simpler than trying to use the Flashloader...anyone have advice on this?
Note that we plan to use Segger Jlink for the initial production programming - so we are mainly just concerned about the field update scheme now.
This forum posting "Need RT1170 FOTA example" ( https://community.nxp.com/t5/i-MX-RT/Need-RT1170-FOTA-example/m-p/1326147 ) from August says that "FOTA SBL will be published in the end of this month". I don't see anything about this when I click on the link for https://github.com/NXP . Is there something in the works that we should wait for?
Thank you for reading this and any feedback you can provide would be greatly appreciated. Or, if you can point me to an applications engineer or web resource that would clear things up, that would be appreciated too. The RT1176 is the first we've used from the iMXRT family and it has been a challenge to comprehend the firmware update schemes and support code available.