公告

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

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

cross mob
JackLiu
Level 3
Level 3
5 comments on blog First comment on blog 25 replies posted
TC397基于地址访问flash的时候, 这时flash 还没被写入任何内容,会进入trap.如何避免?
0 点赞
2 回复数
JackLiu
Level 3
Level 3
5 comments on blog First comment on blog 25 replies posted
知道了会报全0错误,不能读空flash
0 点赞
sesshouhmaru
Level 4
Level 4
First like received 25 comments on blog 10 comments on blog
去年做tc397的bootloader遇到过同样问题,TC3xx的iild比tc2xx多了IfxFlash_verifyErasedPage()函数,可以间接知道是否为空。 /* wait flash ready */ while(IfxFlash_waitUnbusy(0, IfxFlash_FlashType_P0)); {} /* check empty */ pageAddr = addr & (~(PFLASH_PAGE_LENGTH-1)); IfxFlash_verifyErasedPage( pageAddr); /* wait flash ready */ while(IfxFlash_waitUnbusy(0, IfxFlash_FlashType_P0)); {} /* not empty */ if(DMU_HF_ERRSR.B.EVER== 1) { /* read addr */ *data = *(uint32 *)addr; /* clear */ DMU_HF_CLRE.B.CEVER = 1; r=0; } else /* empty */ { *data = 0; r=1; }
0 点赞