希望能有专业的回答:为什么TC275的flash 擦除后个别位非0?

公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
孤星
Level 4
Level 4
First solution authored First like received 100 replies posted
TC275的flash 擦除后在非调试状态(禁止了trap错误)读到的个别位非0?是否对以后程序执行存在隐患?
0 点赞
1 解答
chengeer
Level 4
Level 4
First like received 100 replies posted 50 replies posted
问题描述: 我在使用TC275C芯片,发现在擦除pflash后内存并不是全0,个别bit位是1. 并且实际的非0位和在调试状态在UDE软件memory里的非0位并不完全一致。且每次擦除后,这些位是固定的。但这些位可以通 过写flash来写0,即这些擦除后的非0位是可以写0的。 问题的必要性: 在BootLoader工程里,需要校验APP应用程序的数据,会读到擦除后没有写数据的地址,从而引发ECC错误(trap bus error)。可以通过设置控制寄存器来屏蔽这个错误。 由于存在所述问题,因而在bootloader下载程序时,不能只校验求和APP程序数据,还需加和APP程序起始和终止地址之间的空白区域。 问题的处理: 1.每次擦除后,非0位的位置是固定的。 2.擦除后的非0位,是可以通过写命令来写0的。 3.通过使用ILLD库自带的校验函数IfxFlash_eraseVerifyMultipleSectors(dwSectorAddr, numSector);进行检验,检验结果是无错的(内存区域非全0则报错)。 主题:Re: [Case:xxx] 技术咨询:TC275C的flash擦除不干净 Dear Customer, Thanks for your inquiry. By default TC2xx uses “safety ECC”. This is the default setting and can better protects the data. The side effect is that you cannot directly read all-0 flash e.g. after erase because in this case TC2xx may report error due to special ECC handling. We suggest to use command “Verify Erased Logical Sector Range” to check if the flash is erased with “safety ECC” enabled. It means after issue this command, you wait until BUSY flag is gone, then it will check the EVER bit is set (not all 0) or not (all 0). For compatibility reason, you may also switch to “legacy ECC” mode. Please refer to chapter “ Flash ECC” in user manual for more details. Best regards, Infineon Technologies Tang, Support Engineer

在原帖中查看解决方案

0 点赞
19 回复数
wanggaoyong
Level 4
Level 4
10 comments on blog 5 comments on blog First comment on blog
首先我没用过275,Flash 的编程原理都是只能将 1 写为 0,而不能将 0 写为 1。擦除的过程就是把所有位都写为 1 的过程,应该都是1才对。是不是调试器的原因。
0 点赞
郝_
Level 4
Level 4
100 replies posted 50 replies posted 25 replies posted
如果这个块没用到的话 应该是没影响我觉得~
0 点赞
chengeer
Level 4
Level 4
First like received 100 replies posted 50 replies posted
问题描述: 我在使用TC275C芯片,发现在擦除pflash后内存并不是全0,个别bit位是1. 并且实际的非0位和在调试状态在UDE软件memory里的非0位并不完全一致。且每次擦除后,这些位是固定的。但这些位可以通 过写flash来写0,即这些擦除后的非0位是可以写0的。 问题的必要性: 在BootLoader工程里,需要校验APP应用程序的数据,会读到擦除后没有写数据的地址,从而引发ECC错误(trap bus error)。可以通过设置控制寄存器来屏蔽这个错误。 由于存在所述问题,因而在bootloader下载程序时,不能只校验求和APP程序数据,还需加和APP程序起始和终止地址之间的空白区域。 问题的处理: 1.每次擦除后,非0位的位置是固定的。 2.擦除后的非0位,是可以通过写命令来写0的。 3.通过使用ILLD库自带的校验函数IfxFlash_eraseVerifyMultipleSectors(dwSectorAddr, numSector);进行检验,检验结果是无错的(内存区域非全0则报错)。 主题:Re: [Case:xxx] 技术咨询:TC275C的flash擦除不干净 Dear Customer, Thanks for your inquiry. By default TC2xx uses “safety ECC”. This is the default setting and can better protects the data. The side effect is that you cannot directly read all-0 flash e.g. after erase because in this case TC2xx may report error due to special ECC handling. We suggest to use command “Verify Erased Logical Sector Range” to check if the flash is erased with “safety ECC” enabled. It means after issue this command, you wait until BUSY flag is gone, then it will check the EVER bit is set (not all 0) or not (all 0). For compatibility reason, you may also switch to “legacy ECC” mode. Please refer to chapter “ Flash ECC” in user manual for more details. Best regards, Infineon Technologies Tang, Support Engineer
0 点赞
飞马
Level 5
Level 5
100 comments on blog 50 comments on blog 25 comments on blog
遇到过,没有什么影响。
0 点赞
舒行科
Level 3
Level 3
First solution authored 250 replies posted 100 replies posted
有影响使用功能吗
0 点赞
quentin1
Level 4
Level 4
100 replies posted 50 replies posted 25 replies posted
有一些boot启动被保护 不被擦除
0 点赞
Vincent2
Level 4
Level 4
100 replies posted 50 replies posted 25 replies posted
用户手册里有提到过,Pflash擦了之后不是全0,Dflash是全0。
0 点赞
meng0604010
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted
我去擦完不是固定的,那很难搞呀
0 点赞
懂你
Level 1
Level 1
问题解决了吗
0 点赞
User16432
Level 2
Level 2
Distributor - Macnica(GC)
Welcome!
Mark一下; 上面提到了解决的方法,但是这种问题的产生原因还不了解,继续关注
0 点赞
evenchen
Level 4
Level 4
Distributor - Intron(GC)
10 sign-ins First reply posted First like given
?问题2:flash擦除后个别位非0 在调试或非调试状态,都发现flash中没有写入数据的应用程序区域中不是全0。即pflash擦除后,个别bit位确实非0. 由于存在所述问题,因而在bootloader下载程序时,不能只校验求和APP程序数据,还需加和APP程序起始和终止地址之间的空白区域。 程序研究中发现: 1.每次擦除后,非0位的位置是固定的;2.擦除后的非0位,是可以通过写命令来写0的。 在论坛和群里咨询了很多人,有几个同行业遇到了这个情况,但因为程序能正确执行,就没在意这个问题了。 后来在英飞凌官网咨询了技术支持工程师,得到的邮件答复说是ECC保护引起的,可以通过使用ILLD库自带的校验函数IfxFlash_eraseVerifyMultipleSectors(dwSectorAddr, numSector);进行检验。我进行了校验,检验结果是无错的(内存区域非全0则报错)。
0 点赞
飞马
Level 5
Level 5
100 comments on blog 50 comments on blog 25 comments on blog
关注此问题
0 点赞
yanhaijian
Level 4
Level 4
250 replies posted 100 replies posted 50 replies posted
楼主的问题都是chengeer大神解决的。
0 点赞
mars5514
Level 1
Level 1
100 sign-ins 50 sign-ins 25 sign-ins
这个问题有点难噢,来看看哪位大神可以解决
0 点赞
勿忘心安3327
Level 4
我也遇到类似的了
0 点赞
天河之外
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted
关注此问题
0 点赞
LED2013
Level 5
Level 5
First like received 1000 replies posted 750 replies posted
pflash擦除后均为0,但是个别位为1.这点你在调试时可以查看到。。这点我问了英飞凌工程师,说是不影响程序。
0 点赞
SIX_66
Level 6
Level 6
First comment on blog 500 replies posted 250 replies posted
学习下
0 点赞
suiyu640
Level 1
Level 1
5 replies posted Welcome! First question asked
虽然不影响程序运行 , 但影响对程序的校验,如下载时CRC校验,如对APP再校验等;
0 点赞