2022-06-08 01:10 AM
Does the controller perform a CRC confirmation check before running the application to check if the firmware is corrupted? If so, where does this happen; in the bootloader or the application itself? What does it do if the CRC turns out to be wrong? Secondly, I've referred the AN3155 and in that the bootloader expects a packet size to be a multiple of 4 while issuing the Write memory command (2nd note below the Write Memory Command flow on Pg. 19 of AN3155). So what if the overall firmware size is not a multiple of 4? How to handle the last firmware packet transaction?
Solved! Go to Solution.
2022-06-08 02:08 AM
It doesn't self-check with a CRC.
You'd need to add pad bytes to get word alignment.
2022-06-08 02:08 AM
It doesn't self-check with a CRC.
You'd need to add pad bytes to get word alignment.
2022-06-08 02:25 AM
Ok. But how does the controller makes sure that the firmware is not corrupted before running the application? What if someone corrupts it on purpose or the firmware update process fails midway? Will it just run the corrupted firmware or generate any Hard Fault?
2022-06-08 03:37 AM
The MCU does not check the integrity of the code it is running.
It could crash in any number of ways, a hard Fault is highly probable.
You can create your own loader that runs first and checks integrity / signing of an application image.
2022-06-08 06:27 AM
That was really helpful sir. Thanks a lot.