Skip to main content
Shivam
Associate II
June 8, 2022
Solved

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

  • June 8, 2022
  • 1 reply
  • 2236 views

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?

This topic has been closed for replies.
Best answer by Tesla DeLorean

It doesn't self-check with a CRC.

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

1 reply

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
June 8, 2022

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Shivam
ShivamAuthor
Associate II
June 8, 2022

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?

Tesla DeLorean
Guru
June 8, 2022

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 VenmoUp vote any posts that you find helpful, it shows what's working..