NFC_LDD returns ECC error when reading erased page...?

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

NFC_LDD returns ECC error when reading erased page...?

Jump to solution
850 Views
bowerymarc
Contributor V

I'm reading back a page using NFC_LDD on K60, and it reads back all FF's which is good, since it's erased.  But I get back an error, tracing it back to the ISR this is true:

if ((DevDataPtr->EccStatus[x]).Status & (uint8_t)0x80U) { /* Uncorrectable page? */

Is that what's supposed to happen?

At least it's good that this isn't happening:

https://community.freescale.com/message/321549#321549

Labels (1)
Tags (2)
0 Kudos
1 Solution
630 Views
Petr_H
NXP Employee
NXP Employee

Hi,

From the infromation I have, there is no other way to determine that the page is erased than to receive the error that is returned and then check the content. I meant my comment this way.

The NFC_LDD is a generic low level driver that could be used with miltiple manufaturers flashes. It also does not handle mapping bad pages etc..

This is currently to be done in the upper layer using this driver with usage of the approaches like you have discribed.

Anyway, I have passed your comments to the development team to consider improvement of the NFC_LDD component.

Best regards

Petr Hradsky

Processor Expert Support Team

View solution in original post

0 Kudos
4 Replies
630 Views
Petr_H
NXP Employee
NXP Employee

Hi,

It seems that he problem is that after the page is erased, the ECC of the data doesn't match so the error appears.

The data should be written first, so the correct ECC is stored in the flash and then the error should not appear during reading.

Best regards

Petr Hradsky

Processor Expert Support Team

0 Kudos
630 Views
bowerymarc
Contributor V

Hi Petr,

You realize of course that it makes no sense to write an erased page?  Then you can't use it.

Any use of the NAND will read erased pages - this behaviour should be documented.  I don't see any mention in any Freescale docs the result of reading an erased page.

For example, ST Micro does a good job explaining what's happening with their NFC: http://www.stlinux.com/howto/NAND/ST-ECC

Detecting good erased pages would be a great use for hardware inside the NFC.  Unfortunately I don't see any mention of it.  This leaves any NAND filesystem management to either:

1. If a page read returns an ECC error, before flagging as an actual error, read every byte in the page buffer and see if they are all 0xFF indicating an erased page, and return no error in that case.  Lots of CPU cycles.

2. Keep an in-memory list of erased pages, which would be filled by reading every page upon startup and maintained throughout the program's life.  Long startup time, and added RAM usage (if you're using only internal SRAM, not good..)

If you notice, ST's Nand driver handles this case... probably NFC_LDD should as well.

Best regards,

Marc

0 Kudos
631 Views
Petr_H
NXP Employee
NXP Employee

Hi,

From the infromation I have, there is no other way to determine that the page is erased than to receive the error that is returned and then check the content. I meant my comment this way.

The NFC_LDD is a generic low level driver that could be used with miltiple manufaturers flashes. It also does not handle mapping bad pages etc..

This is currently to be done in the upper layer using this driver with usage of the approaches like you have discribed.

Anyway, I have passed your comments to the development team to consider improvement of the NFC_LDD component.

Best regards

Petr Hradsky

Processor Expert Support Team

0 Kudos
630 Views
bowerymarc
Contributor V

I guess the main thing is that FS should document this behavior explicitly, and probably there should be at least a comment in the NFC_LDD that an error code of ECC failed will happen with a freshly erased page.

0 Kudos