cancel
Showing results for 
Search instead for 
Did you mean: 

CRC generation while generating binary file

Utkarash Patil
Associate III

Hello All,

We have designed a Custom Board with STM32F777 MCU chip and are using Atollic Truestudio with ST Micro's CubeMX for development.

I have implemented a USB boot loader for the same hardware which is working fine with the Custom Board.

Now i want to implement CRC check in the Boot loader.

My application code which is to be loaded using boot loader is generated using atolic so is there any method/Tool/ setting available from which CRC is generated and attached to the end of the application binary file.

Also if there is any method/Tool/ setting please let me Know in detail what is that method so that i can implement it in my Bootloader

Thanks and regards

Utkarsh

1 REPLY 1
Ozone
Lead II

Pre-calculate the CRC for your application code, and write to a fixed/known target address. This is usually done in a post-build step. An *.HEX of *.S19 file is easier to patch then a binary file.

At runtime, calculate the CRC in your bootloader, and compare with the stored CRC. Exclude the loaded CRC from calculation, of course.