Flash CRC checksum calculation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flash CRC checksum calculation

Jump to solution
5,242 Views
taimurwajad123
Contributor III

Hi All,

I'm using Kinetis K10 and codewarriors 10.7 IDE. I wants to do the following:

- calculate CRC checksum of flash

- Place the calculated CRC checksum in .hex file

- On startup (reset), verify the corresponding CRC .

Can someone please guide me how to proceed further?

I tried the procedure described in

CRC Checksum Generation with ‘SRecord’ Tools for GNU and Eclipse | MCU on Eclipse 

without any success. I think I'm not able to follow above link properly.

Best Regards

Taimur

0 Kudos
1 Solution
3,279 Views
padmanabhlanke
Contributor III

Hello Taimur,

Q1. Calculate CRC of hex file and place it into particular memory location follow below link

HEX file CRC calculation using SREC Tool: Hex file CRC calculation using Srecord tool 

In this link it clearly mentioned how to calculate CRC and place it into particular memory with steps.

Q2. On startup (reset), verify the corresponding CRC .

Load the hex file with CRC appended from Q1 to target.

Also write down a routine to calculate CRC using same algo. (e.g. CRC32).

Call same routine at startup/init function.

Compare calculated CRC with Stored CRC (appended at particular address From Q1)

View solution in original post

2 Replies
3,280 Views
padmanabhlanke
Contributor III

Hello Taimur,

Q1. Calculate CRC of hex file and place it into particular memory location follow below link

HEX file CRC calculation using SREC Tool: Hex file CRC calculation using Srecord tool 

In this link it clearly mentioned how to calculate CRC and place it into particular memory with steps.

Q2. On startup (reset), verify the corresponding CRC .

Load the hex file with CRC appended from Q1 to target.

Also write down a routine to calculate CRC using same algo. (e.g. CRC32).

Call same routine at startup/init function.

Compare calculated CRC with Stored CRC (appended at particular address From Q1)

3,279 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Taimur,

About CRC Checksum caculation, you can use CRCgen under CW,

there is a document shows a demo how to do it :

How to use CRCgen in CodeWarrior for MCU  

Also the doc of "Targeting_Microcontrollers.pdf" (under the CW installation: CW MCU v10.7\MCU\Help\PDF)

->18.1 Using CRCgen on Microcontrollers   describe it in detail.

Hope it heps


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos