Sector Header details for MC9S12XET256

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sector Header details for MC9S12XET256

843 Views
hemavathydevara
Contributor I

I'm working with DFlash in MC9S12XET256.

The address starts from 0x10_0000 to 0x10_7FFF.

At every start of the sector, for 4 bytes I can see few fixed values (FA CF 00 00 / FF FF 00 00).

I'm aware that these are the sector header. It gives information about Erase count, sector state etc.

1) I need the complete break up of this sector header bytes.

    i.e., Which bits denote erase count, sector state. If I can get any other details from these bits.

2) In the last sector ie., 0x10_7F00, I can write only from 0x10_7F08. Why is it so?

3) If the DFlash is used as User type (not as FEE), should I update the sector? Or the update will be done automatically.

Labels (1)
Tags (1)
3 Replies

660 Views
RadekS
NXP Employee
NXP Employee

Hi Hemavathy,

Yes, that exactly looks like sector headers.

Each sector starts with a header field containing two words that define its status and erase count.

Each sector in the EEE NVM partition is in one of the following states:

  • Containing data records the current sector where data records are being programmed, the Active sector
    • the current sector where data records are being programmed, the Active sector
    • the current sector containing the oldest data records, the Oldest_x sector
  • Ready_x (erased) sectors
  • Flagged as invalid following a program or erase fault (and skipped by the EEE flow)

 

1) I am afraid that this was newer described in any official

The first word:

0xFFFF  Ready sectors

0xFACF Sectors which containing data records

The second word is just simple ECOUNT counter (it count from 0x0000 or 0x0001) of erase cycles for every sector.

Anyway, the information in sector headers is not intended for user access. The ECOUNT value may be obtained by EEPROM Emulation Query Command.

2) If (part of ) your D-Flash is partitioned for EEE use, you cannot write into this area by Flash commands. D-Flash is dedicated for EEE is protected against D-Flash commands write. When I updated my variables in Buffer RAM, the records in the last sector are stored by the same was as at other sectors. So, I suppose that you probably selected some strange ERPART/DFPART values or there is any other issue on your side.

3)The D-Flash which is not used for EEE, will be not partitioned – sector headers exist only for EEE state machine. The User D-Flash do not contain any sector headers.

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

660 Views
hemavathydevara
Contributor I

Hi Radek,

Thanks for your clear reply. 

Can I differentiate sectors using the first word of the sector header?

i) Flagged as invalid

ii) Oldest_x sector

iii) Active sector

iv) Ready sector --> 0xFFFF

Have a nice day,

Hemavathy D

0 Kudos
Reply

660 Views
RadekS
NXP Employee
NXP Employee

Hi Hemavathy,

Yes, you can.

But unfortunately, I never work with any MCU with a flagged invalid sector. So, I do not know the right pattern for an invalid sector.

Also, the differentiating between Oldest_x and the Active sector is not straightforward. The sector header pattern is the same for all Oldest_x and Active sectors – 0xFACF. The EEE start with recording data from 0x10_0000 sector and continue to 0x10_7F00 sector where it wraps back to D-Flash begin (when whole D-Flash is used for EEE). So, the active sector should be the sector with the 0xFACF  pattern at highest address – when we start search 0xFACF sector pattern from 0x10_0000 and end search until the 0xFACF sector is followed by sector which does not contain 0xFACF sector pattern.

 

Please be aware that this information is based just on my EEE observation – I never see EEE state machine code.

 

If you want watch D-Flash by the debugger, I would like to recommend enable “refresh memory when halting” feature in Debugging Memory Map (by default disabled).

refresh memory when halting.PNG

Note: The picture is for different MCU.

 

Is there any specific reason for your request (some issue or any additional functionality needs), or you are just curious?

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------