burning data into Flash

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

burning data into Flash

Jump to solution
1,028 Views
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!

Labels (1)
Tags (1)
0 Kudos
1 Solution
666 Views
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

 

View solution in original post

0 Kudos
4 Replies
666 Views
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 Kudos
666 Views
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

666 Views
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 Kudos
667 Views
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 Kudos