Handling bad block in NAND flash memory

1

1

Is there any way/tool/utility to correct the badblock on the NAND device ?

We are having custom board based on beaglebone but instead of mmc we have NAND flash. MTD partitions on the NAND are as follows,

mtd0:MLO
mtd1:MLO
mtd2:MLO
mtd3:MLO
mtd4:u-boot
mtd5:u-boot backup
mtd6:kernel
mtd7:kernel Backup
mtd8:RFS

RFS has two UBI volumes rootfs & rootfs2 and at a time one is used for booting the board.

Now as NAND flash is used there can be a badblock on the NAND chip or may develop badblock over a time. UBIFS handles the bad block by reserving the space for badblock. UBI maps badblock to the reserved block. So there is badblock handling there.

But what about other partitions, what if there are bad blocks on those partitions ?
is there any way to detect and correct badblocks on the those partitions,
1. Primarily without loosing data OR
2. With losing data

I searched on net and found that for ext filesystems there is a utility called "badblocks" but is there a version for flash memory ?
Is there any other way to correct badblock on the the device.

I understand that mtd drivers also has some badblock management, they skip the badblocks while writing and reading but is that enough ?

I also know that NAND chip manufacturer also guarantees that chip wont have more than X number of badblocks.

Seeing all this, is it required to worry about badblocks while designing system ? Is it required to handle it from userspace ? If not on active partition, is it required to be done on backup partitions ?

Any suggestions/pointers appreciated,

Thanks in advance.

ART

Posted 2014-02-21T11:59:15.170

Reputation: 305

Answers

0

You don't have to handle bad block in the user space. While mounting a partition, the corresponding file system type has respective implementation to handle the bad blocks. Hence, you don't have to worry about handling it in active/backup partitions.

Ashok Vairavan

Posted 2014-02-21T11:59:15.170

Reputation: 261