burning data into Flash

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

burning data into Flash

跳至解决方案
1,302 次查看
AndreiLuchuk
Contributor I

What I need is a CRC burned into flash so that I may check against it at run-time. How can I accomplish this?

 

So far I've been able to complete a 16-bit CRC using the on-chip CRC module, and the linker CRC, however they give me different values. I can obtain the checksum calculted by the CRC module with debug by looking at the registers. If i could place this value in flash during burning of the program, I can check against it at run-time. Either that, or get matching values between the two CRC algorythms. 

 

I am using CodeWarrior 10.2 with PT addon to program the MC9S08PT60 on the TWR board.

 

Thanks!

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
940 次查看
ProcessorExpert
Senior Contributor III

Hi,

 

If removing CRC component initialization fixes the problem, it seems that the CRC component is not set to match the same computation algorithm as it's done in linker. I have looked on the project and I wonder why you set the Complement read of CRC to 'yes' ? Was it on purpose?

I would start with inserting a new Init_CRC and with all default values that should actually match the after-reset state of CRC registers. 

 

best regards
Petr Hradsky
Processor Expert Support Team

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
940 次查看
p_vagnoni
Contributor III

Hello,

about my experience ( CRC flash in Kinetics parts ) is possible that the CRC calculated post linker is different from the CRC download program.

About the CRC module I used it with PE initialization and it works properly.

Paolo

0 项奖励
回复
940 次查看
BlackNight
NXP Employee
NXP Employee

Hello,

I have not checked the PT60 CRC module, but: maybe this information might help:

http://mcuoneclipse.wordpress.com/2012/05/06/crc-calculation-with-mcu10/

 

It is about a CRC calculation utility with CodeWarrior.

 

Hop this helps,

BK

940 次查看
AndreiLuchuk
Contributor I

Thanks, I'll look at it in a minute, I just stumbled onto something.

 

 

After banging my head on this for a while, I created another test project, but I forgot to include the CRC bean. guess what, without the CRC_Init() auto-generated module, the checksum matched. TSR ahoy! It signifies there is a problem with the module or generated code. 

 

check out the attached project. commenting out CRC0_Init in  PE_low_level_init fixes it.

0 项奖励
回复
941 次查看
ProcessorExpert
Senior Contributor III

Hi,

 

If removing CRC component initialization fixes the problem, it seems that the CRC component is not set to match the same computation algorithm as it's done in linker. I have looked on the project and I wonder why you set the Complement read of CRC to 'yes' ? Was it on purpose?

I would start with inserting a new Init_CRC and with all default values that should actually match the after-reset state of CRC registers. 

 

best regards
Petr Hradsky
Processor Expert Support Team

 

0 项奖励
回复