Verify Erased Memory

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

cross mob
User21316
Level 3
Level 3
5 questions asked 5 replies posted First like received

Hello,

I'm working with a TC322.

In my program, I need to read some data in the PFlash. But this location may be erased. When this happens, I get a trap for a Data Integrity Error. That I can understand (because of the ECC).

To solve my problem, I tried to check the validity of the data before reading it. I try to use the function IfxFlash_verifyErasedPage;

Here is my code:

uint16 endInitSafetyPassword = IfxScuWdt_getSafetyWatchdogPasswordInline();

IfxScuWdt_clearSafetyEndinitInline(endInitSafetyPassword);      /* Disable EndInit protection                   */
IfxFlash_clearStatus(IFXFLASH_NUM_MODULES);

IfxFlash_verifyErasedPage(pageAddr);
IfxFlash_waitUnbusy(FLASH_MODULE, PROGRAM_FLASH_0);
res = !DMU_HF_ERRSR.B.EVER;

IfxScuWdt_setSafetyEndinitInline(endInitSafetyPassword);        /* Enable EndInit protection                

 

This function doesn't detect any problem with my memory location (the full HF_ERRSR register stays at 0). Despite that, I get the trap right after this when I try to read the memory.

Any idea about how I could make this work?

 

Regards,

Benoit

0 Likes
1 Solution
Yuva
Moderator
Moderator
Moderator
250 replies posted 250 sign-ins 100 solutions authored

Hello,

I guess you proceed to read Pflash when res is 1, please confirm. What address is read? is it pageAddr? Also, can you confirm if the same address is logged in MBABRECORD0/ZBABRECORDx after setting FLASHCON2.RECDIS as 10b. 

Thanks.

View solution in original post

0 Likes
1 Reply
Yuva
Moderator
Moderator
Moderator
250 replies posted 250 sign-ins 100 solutions authored

Hello,

I guess you proceed to read Pflash when res is 1, please confirm. What address is read? is it pageAddr? Also, can you confirm if the same address is logged in MBABRECORD0/ZBABRECORDx after setting FLASHCON2.RECDIS as 10b. 

Thanks.

0 Likes