51AC and CRCV2

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

51AC and CRCV2

跳至解决方案
1,676 次查看
SoJulien
Contributor II

Hello,

 

I use the MCF51AC256 processor and I make an application with verify an I2C memory checksum.

 

I want to use the hardware CRC because the memory size which must be compute the CRC is 4 kByte.

 

I make a little application (DemoACKIT board) to show my problem :

this application changes the state of one LED every seconds and at each changement state, the application computes alternately Hardware CRC and software CRC.

 

When I don't activate the hardware CRC, LED blink correctly (every second)

When I activate the hardware CRC, the CRC function compute a correct CRC (compared to Software CRC) but the LED is fixed at state on or off, it's very strange.

 

In this case when I execute step by step the CRC, I remark that some register are modified.

I don't understand what happen.

 

If somebody already use the hardware CRC on this Coldfire, can he answered me and correct my application ?

 

Thank you.

 

Julien.

标签 (1)
0 项奖励
回复
1 解答
946 次查看
SoJulien
Contributor II

Ok, matter found thanks to Freescale support.

 

Origin : the mcu used was a "PCF51AC" with mask "0M60N"  that as a mask error compared to MCF51AC for the CRC function.

 

Workaround from Freescale support :

" 

SE154-CRC-Affects-Content: CRC Affects Content of Direct-Page and

High-Page Registers Description: CRC affects the content of the

following memory ranges: 0xFFFF8000 to 0xFFFF80EC (Direct-Page

Registers) and 0xFFFF9800 to 0xFFFF98CF (High-Page Registers)

interfering with several MCU peripheral configurations. The error

happens when any data is written to the CRCL after the seed was loaded

to CRCH:CRCL. Workaround: Load the SEED value to CRCH:CRCL, perform the

CRC computations (that means reading from RAM or FLASH and writing to

CRCL; at this time, reads from Direct-Page/High-Page will be affected)

and finally read the CRC result from CRCH:CRCL. Then, once the CRC

module will no longer be used, one additional step (workaround) would be

to write 0x00 to CRCH and 0x00 to CRCL. As a result, the

Direct-Page/High-Page positions should not be affected anymore.

"

 

Thanks,

Bye,

Julien

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
947 次查看
SoJulien
Contributor II

Ok, matter found thanks to Freescale support.

 

Origin : the mcu used was a "PCF51AC" with mask "0M60N"  that as a mask error compared to MCF51AC for the CRC function.

 

Workaround from Freescale support :

" 

SE154-CRC-Affects-Content: CRC Affects Content of Direct-Page and

High-Page Registers Description: CRC affects the content of the

following memory ranges: 0xFFFF8000 to 0xFFFF80EC (Direct-Page

Registers) and 0xFFFF9800 to 0xFFFF98CF (High-Page Registers)

interfering with several MCU peripheral configurations. The error

happens when any data is written to the CRCL after the seed was loaded

to CRCH:CRCL. Workaround: Load the SEED value to CRCH:CRCL, perform the

CRC computations (that means reading from RAM or FLASH and writing to

CRCL; at this time, reads from Direct-Page/High-Page will be affected)

and finally read the CRC result from CRCH:CRCL. Then, once the CRC

module will no longer be used, one additional step (workaround) would be

to write 0x00 to CRCH and 0x00 to CRCL. As a result, the

Direct-Page/High-Page positions should not be affected anymore.

"

 

Thanks,

Bye,

Julien

 

0 项奖励
回复
946 次查看
SoJulien
Contributor II

Hello,

 

Note that in fact the hardware CRC crash the register at the first time the CRC Generator is being used.

Putting the call to "so_HardwareCRC_Compute();" in comment and led 1 flash every second.

Then activate call to "so_HardwareCRC_Compute();" --> mcu crash !!!

 

This is seems for example while looking @ 0xFFFF8000 (PTAD register for port A) that is not used on this function and that is modified after the first CRC instruction : "CRCH = 0xFF;" in "void so_HardwareCRC_Compute(void)"

 

After that some instruction execute for CRC function (during some luky state) then program crash.

 

I do not see any help in AN3795 or in RM, so any help is appreciat, thanks.

 

Thanks you,

Julien,

0 项奖励
回复