[C90LC D-Flash]

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

[C90LC D-Flash]

Jump to solution
1,195 Views
malekben
Contributor II

Hello All,

I am working on C90LC D-Flash of MPC560xB to implement a customized solution for EEPROM emulation.

I'am testing my product behavior after a power loss while there was a flash operation ongoing.

- If the power off occurs during an erase operation, at the next power on I get a core exception (IVOR2) at the first access to the corrupted flash address.

- If the power off occurs during a writing operation I have no exception at the next power on.

My question is :

Is it normal that there is no core exception if the writing operation is suspended by a shutdown ?

Knowing that I forced the shutdown at different points of writing operation (before and after setting and clearing MCR-EHV & MCR-PGM).

Regards,

0 Kudos
Reply
1 Solution
923 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Malek,

in case of MPC560xB, each double word (64bits) has own ECC checksum. The size of read page is 128bits. You will get exception if any double word within page is corrupted. But you can still read the rest of flash. Exception will be triggered only when reading data from page that contains ECC error.

For recovery, it is necessary to erase the flash block. It is not sufficient to just execute the program operation again.

There's no way to find out if program or erase operation was terminated. This can be done only on application level - for example, if only one page is corrupted and other data are valid, then program operation was probably terminated. If more pages contain error then erase operation was probably terminated.

I like the idea to read/check whole flash assigned for EEPROM Emulation during start up. This is also done by our EEE drivers:

http://www.freescale.com/files/run_time_software/device_driver/MPC5xxx_EEE_DRIVER.exe

This will avoid problems in runtime.

I hope I answered all questions :-)

Lukas

View solution in original post

0 Kudos
Reply
4 Replies
923 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

the program operation is much faster than erase operation. The program operation is also done only on double word while the erase is a bulk operation. Taking this into account, the chance that data are corrupted is significantly lower. That's definitely not a rule that you can't get exception when program operation is terminated by unexpected reset/power down.

Regards,

Lukas

923 Views
malekben
Contributor II

Hi Lukas,

Thank your answer.

I still have some ambiguities:

If a program operation at address X is terminated by unexpected reset/power down, at the next power on I will get an exception if the address X is accessed (R or W access).

In that case what shall I do to resume a normal operating  :

- May I still able to read form the sector that contains the corrupted address or the whole sector is condemned ?

- I have to erase that sector or I have just to repeat the interrupted program operation  (as it is written in the MPC560xB Manual).

- Once I have the exception is there a way to know if it is caused by a program or erase operation unexpected termination ?

In the Manual it is written the following :

"If during a Modify Operation a reset occurs, the operation is suddenly terminated and the Macrocell is reset

to Read Mode. The data integrity of the flash memory section where the Modify Operation has been

terminated is not guaranteed: the interrupted flash memory Modify Operation must be repeated."

I have another question please :

If I have the following scenario :

An erase operation is terminated by unexpected reset/power down --> At the next power on, I want to perform a write operation at the corrupted sector --> An exception will be generated.

When I want to perform an erase sector to correct this error, the operation fails and returns BUSY because MCR_PGM flag is still set.

In order to avoid that, I am hesitating between two solutions :

- Read access to all my flash memory at the start-up and perform erase operation if an exception is generated.

- Reset MCR flags at the exception callback to be able to perform an erase operation.

Is there any other way to avoid that ?

Regards,

Malek.

0 Kudos
Reply
924 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Malek,

in case of MPC560xB, each double word (64bits) has own ECC checksum. The size of read page is 128bits. You will get exception if any double word within page is corrupted. But you can still read the rest of flash. Exception will be triggered only when reading data from page that contains ECC error.

For recovery, it is necessary to erase the flash block. It is not sufficient to just execute the program operation again.

There's no way to find out if program or erase operation was terminated. This can be done only on application level - for example, if only one page is corrupted and other data are valid, then program operation was probably terminated. If more pages contain error then erase operation was probably terminated.

I like the idea to read/check whole flash assigned for EEPROM Emulation during start up. This is also done by our EEE drivers:

http://www.freescale.com/files/run_time_software/device_driver/MPC5xxx_EEE_DRIVER.exe

This will avoid problems in runtime.

I hope I answered all questions :-)

Lukas

0 Kudos
Reply
923 Views
malekben
Contributor II

Thank your for your answers.

For the moment it seems much butter.

Malek.

0 Kudos
Reply