cancel
Showing results for 
Search instead for 
Did you mean: 

Where's the CRC and the size of the whole firmware application stored whenever a new application is flashed on to the System flash?

Shivam
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions

It doesn't self-check with a CRC.

You'd need to add pad bytes to get word alignment. ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4

It doesn't self-check with a CRC.

You'd need to add pad bytes to get word alignment. ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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?

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.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

That was really helpful sir. Thanks a lot.