I'm working with K40 and I have to develop a firmware upgrade mechanism. The code has to be able to receive an image data (new Firmware) and test it during a time period. If everything is fine, the old firmware version is discarded and it reboots with the new firmware. Else, the new firmware is discarded, and it reboots with the old version.
The actual firmware version is in Flash at 0x800. I have doubts about how and where I program de new firmware in order not to erase the old version. Is it possible to program the new firmware in FlexMemory, test the new firmware there and, if it runs ok, program the new firmware at 0x800?
It's no possible to program it in flash because there's not enough space for both of the firmwares (actual and new).
What do you suggest me to do?