操作EEPROM时触发ECC内部故障导致通信失败

This example simulates ECC issue by cumulative write into the same EEPROM area without an erasing.

 

The EEPROM erase operation set all bits into log1. The EEPROM program operation may keep bit cells in log1 state
or change it into log0 state, but not in opposite way.

 

The S12Z MCU EEPROM is protected by 22-Bit ECC Scheme. Every word (16bits) is protected by additional 6 bits with ECC checksum. 
The ECC values are not accessible for users. 
Every EEPROM reading triggers also ECC check by internal logic. The single bit error in user data may be corrected by ECC checksum.
The double bit error cannot be corrected.

 

The ECC protection is implemented also at flash controller commands and results are signalling by MGSTAT bits.

 


The first case simulates Single-bit ECC error during reading. The MGSTAT bits after the second write are 0b10 
due to fact that just 1 bit is different during write verification (correctable error)

 

The second case simulates Single-bit ECC error during reading. The MGSTAT bits after the second write are 0b11 
due to fact that more than 1 bits are different during write verification (non-correctable error)

 

The third case simulates Double-bit ECC error during reading. The MGSTAT bits after the second write are 0b11 
due to fact that more than 1 bits are different during write verification (non-correctable error)

 

 

 

The EEPROM patterns are selected for highlighted described behavior and they don't have any real meaning.

 

The cumulative write is not allowed for normal operation!!!
The code from this example should be used only for design testing - not in production!!!

 

Please, see the prm file. Address range 0x100000-0x100001 is excluded from default EEPROM and is used as user EEPROM memory
The size of EEPROM sectors is 2 bytes. The EEPROM_Program() function may program up to 4 words in single flash command.

 

Note: The EEPROM_Program() function was updated - erase verification is skipped


在freescale单片机操作内部EEPROM时,特别要注意先要擦除再写,而且在操作EEPROM时如果引发ECC故障,会导致单片机复位。公司有两个case是关于操作EEPROM时,引发ECC故障,导致单片机不断复位,电压缓升缓降。从而CAN/LIN通信失败。


  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

king110108

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值