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

cross mob
ccatt
Level 1
Level 1
First reply posted First question asked Welcome!

Hi,

I'm working on an application where I want to read some stored data in pflash on the application boot. This data has some constants used in the application. I want to be able to read from the pflash without first doing a program and erase. Currently I am getting TRAPs likely due to ECC. Is there a way to read from pflash without first erasing and programming it? Is there some way to disable ECC exceptions during a read maybe?

 

Note we do not have the option of using DFLASH for this as we designed for putting this data in PFLASH.

 

Thanks

0 Likes
1 Solution
DownyK
Level 5
Level 5
100 replies posted 10 solutions authored 250 sign-ins

HI @ccatt

Is the corresponding Pflash area written once? If not, the area is unknown, so ECC will occur when accessing Read. Therefore, if there is no value written in the area, you should reset it to zero once and read it.

However, ECC will not occur if the area has been written.

 

DownyK_0-1682383473530.png

DownyK_1-1682383512587.png

 

 

 

 

View solution in original post

0 Likes
4 Replies
DownyK
Level 5
Level 5
100 replies posted 10 solutions authored 250 sign-ins

HI @ccatt

Is the corresponding Pflash area written once? If not, the area is unknown, so ECC will occur when accessing Read. Therefore, if there is no value written in the area, you should reset it to zero once and read it.

However, ECC will not occur if the area has been written.

 

DownyK_0-1682383473530.png

DownyK_1-1682383512587.png

 

 

 

 

0 Likes
ccatt
Level 1
Level 1
First reply posted First question asked Welcome!

Thank you. So on the first read of uninitialized memory, I should set up my trap handler to handle the ECC trap gracefully, and then do an erase + program?

0 Likes
DownyK
Level 5
Level 5
100 replies posted 10 solutions authored 250 sign-ins

Hi @ccatt ,

if you want to avoid falling into the trap, you can modify the trap code.

in my case, I modified the trap handler to do something like the PC(program counter) jumping the next line. 

But, I am curious about why you read the uninitialized memory before using that. 

is there something special reason? 

 

Thanks.

 

0 Likes
ccatt
Level 1
Level 1
First reply posted First question asked Welcome!

During boot we have an area of memory that can be uninitialized if it's the first time the application is booting. After that, it should be initialized. 

 

I found another way to do it for those who may be interested - the PMU command Verify Erased Page should work before deciding to read from the section of flash or not.

0 Likes