Flash CRC checksum calculation

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Flash CRC checksum calculation

跳至解决方案
7,193 次查看
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 项奖励
回复
1 解答
5,230 次查看
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)

在原帖中查看解决方案

2 回复数
5,231 次查看
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)

5,230 次查看
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 项奖励
回复