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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,851 次查看
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

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,631 次查看
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 项奖励
回复
4 回复数
1,631 次查看
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 项奖励
回复
1,631 次查看
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 项奖励
回复
1,632 次查看
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 项奖励
回复
1,631 次查看
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 项奖励
回复