How do the erase counters work in TC397?

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

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

Hi, 

I want to analyze the behavior of some flash algorithms on a TC397XX. Therefore I want to measure how often sector 33 (0xA0084000 .. 0xA0087FFF) in PFLASH0 will be erased.
Before I do my analysis, the situation is as follows: All sectors are set to low prio in the UCB_ECPRIO_x configuration blocks. So I expect that erasing sector 33 will produce an "Erase Counter Logging Entry" in Erase Counter 0 (EC0) as described in UM 6.2.3.1.2. 
A first look into the Erase Counter Sector shows that the Low Priority Area is quite full:

[ 0XA8000000 - 0XA800001F ] 40 04 18 84 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[ 0XA8000020 - 0XA800003F ] 40 04 18 84 00 00 00 00 04 05 99 1C 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 0XA8000040 - 0XA800005F ] 40 04 18 84 00 40 10 00 04 06 99 1C 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 0XA8000060 - 0XA800007F ] 40 04 18 84 00 80 06 00 02 07 99 1C 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
...
[ 0XA8001F80 - 0XA8001F9F ] 40 04 18 84 00 00 18 00 20 06 99 1C 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 0XA8001FA0 - 0XA8001FBF ] 40 04 18 84 00 80 10 00 1E 07 99 1C 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 0XA8001FC0 - 0XA8001FDF ] 40 04 18 84 00 00 18 00 20 07 99 1C 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 0XA8001FE0 - 0XA8001FFF ] 00 00 00 00 00 00 20 00 20 07 99 1C 00 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

As I understand, the first entry (0xA8000000 ...) is "preprogrammed" and it contains an ECC valid entry. The next entry (0xA8000020) begins with the marker "40 04 18 84" followed  by the start address of the logical sector which was erased some times ago. This leads to my first question:

As I understand the documentation (maybe I am wrong) EC0 holds only log entries from PFLASH 0. Therefore I expect that every sector address in the log should be in the range  0xA0000000 .. 0xA02FFFFF and is aligned to the boundary of logical sectors (16k / 0x4000). I could not see any address in EC0 which correspond to my assumption. I don´t know what happend before but, are my assumptions are right?

The last entry (0xA8001FE0) has a marker "00 00 00 00" and seems to be the last log entry. This is the last possible entry in the low priority area.

What happen, if the Erase Counter Sector is full?

So I flash some data into sector 33 and erase sector 33. I perform a blank check before and after erase and the sector 33 was programmed and erased as expected. Than I read out the Erase Counter 0 sector and it has not changed. There is neither a new entry nor has an entry been changed.

Now I have a two further questions:

  • Is it possible or required to erase the EC0 sector, so that it could be used for logging erase actions? If so, how can I do this?
  • The high priority area is erased. But changing the priority in ECPRIO00 .. ECPRIO04 from 0 to 1 leads not to some log entries in the High Priority Area. Are there any other configurations which has to be done before?

 

0 Likes
2 Replies
Nambi
Moderator
Moderator
Moderator
50 likes received 5 likes given 100 solutions authored

Hi,

Could you share your UCB_ECPRIO configuration?

Best Regards

0 Likes
lock attach
Attachments are accessible only for community members.
ruediger
Level 1
Level 1
First reply posted First question asked Welcome!

Hi I use the iSYSTEM 5700. The UCB_ECPRIO looks like below in the case to use the low prio area for logging:

ruediger_0-1657532295396.png

In the case to use the high prio area I set the ECPRIO00 .. ECPRIO05 to 0x1.
I read out the UCB_ECPRIO_ORIG block and found that the pages from 0XAF402C00 until 0XAF402DE8 are erased (0x0), the page 0XAF402DF0 (Confirmation) have some content which I attach in the hexfile and the last page 0XAF402DF8 is also erased (0x0). 

0 Likes