How to add CRC check to Hex file and perform CRC check at Bootloader SD card
I am using PIC32MZ2064DAG169. I am building a SD card bootloader with checking CRC for application image on Program Flash.
With the aid from MPlab harmony, I can build the SD card bootloader very fast. my job is just to do the following things:
1. Adding CRC check (or any other checksum) to the Applicaiton hex file (generated by MPlab X IDE). The CRC will be written to Program Flash along with the image. For this step, I found a lot of information for 8 bit MCU, such as: http://microchipdeveloper.com/xc8:hexmate-crc-xc8,
but can not find any information for 32 bit MCU, the MCU I am using. Please tell me any document or example code mention about that.
I also question for the Checksum value displayed on the Device tab of the Dashboard. if that Checksum is attached on Hex file, where are the Address of that Checksum? the formula of that Checksum? Are there any guide to perform that checksum back at run time and compare with that value?
2. Perform CRC checksum at run time in Bootloader. The bootloader document mention a lot about CRC check, but it seem not apply for SD card bootloader. Please guide me if there are any document about checking CRC for SD card bootloader, type and formula of the CRC, example code if available.