Hi,
We tested two winbond SPI-Nand Flash, W25N02 (QSPI) and W35N02 (OSPI), on customer boards, and both encountered bad block problems.There was no problem with reading and writing at the beginning, but after a few days of testing, many bad blocks appeared.The read and write commands are as follows
mtd erase ospi_nand.tiboot3 ext4load mmc 0:2 ${loadaddr} /home/root/tiboot3.bin mtd write ospi_nand.tiboot3 ${loadaddr} 0 $filesize mtd read ospi_nand.tiboot3 ${cmpaddr} 0 $filesize
W25N02, some blocks have become bad blocks.
=> mtd list List of MTD devices: * spi-nand0 - device: flash@0 - parent: spi@fc40000 - driver: spi_nand - path: /bus@f0000/bus@fc00000/spi@fc40000/flash@0 - type: NAND flash - block size: 0x20000 bytes - min I/O: 0x800 bytes - OOB size: 64 bytes - OOB available: 24 bytes - 0x000000000000-0x000010000000 : "spi-nand0" - 0x000000000000-0x000000100000 : "ospi_nand.tiboot3" - 0x000000100000-0x000000300000 : "ospi_nand.tispl" - 0x000000300000-0x000000700000 : "ospi_nand.u-boot" - 0x000000700000-0x000000740000 : "ospi_nand.env" ...... - 0x00000ffc0000-0x000010000000 : "ospi_nand.phypattern" => mtd erase ospi_nand.tiboot3 Erasing 0x00000000 ... 0x000fffff (8 eraseblock(s)) Skipping bad block at 0x00020000 Skipping bad block at 0x00040000 => mtd erase ospi_nand.tispl Erasing 0x00000000 ... 0x001fffff (16 eraseblock(s)) Skipping bad block at 0x00180000 Skipping bad block at 0x001a0000 Skipping bad block at 0x001c0000 Skipping bad block at 0x001e0000 => mtd erase ospi_nand.u-boot Erasing 0x00000000 ... 0x003fffff (32 eraseblock(s)) Skipping bad block at 0x00000000 Skipping bad block at 0x00020000 Skipping bad block at 0x00040000 Skipping bad block at 0x00060000 Skipping bad block at 0x00080000 =>
In W35N02, all blocks have become bad blocks.
=> mtd list List of MTD devices: * spi-nand0 - device: flash@0 - parent: spi@fc40000 - driver: spi_nand - path: /bus@f0000/bus@fc00000/spi@fc40000/flash@0 - type: NAND flash - block size: 0x40000 bytes - min I/O: 0x1000 bytes - OOB size: 128 bytes - OOB available: 80 bytes - 0x000000000000-0x000010000000 : "spi-nand0" - 0x000000000000-0x000000080000 : "ospi_nand.tiboot3" - 0x000000080000-0x000000280000 : "ospi_nand.tispl" - 0x000000280000-0x000000680000 : "ospi_nand.u-boot" - 0x000000680000-0x0000006c0000 : "ospi_nand.env" ...... - 0x00000ffc0000-0x000010000000 : "ospi_nand.phypattern" => mtd erase ospi_nand.tiboot3 Erasing 0x00000000 ... 0x0007ffff (2 eraseblock(s)) Skipping bad block at 0x00000000 Skipping bad block at 0x00040000 => mtd erase ospi_nand.tispl Erasing 0x00000000 ... 0x001fffff (8 eraseblock(s)) Skipping bad block at 0x00000000 Skipping bad block at 0x00040000 Skipping bad block at 0x00080000 Skipping bad block at 0x000c0000 Skipping bad block at 0x00100000 Skipping bad block at 0x00140000 Skipping bad block at 0x00180000 Skipping bad block at 0x001c0000 => mtd erase ospi_nand.u-boot Erasing 0x00000000 ... 0x003fffff (16 eraseblock(s)) Skipping bad block at 0x00000000 Skipping bad block at 0x00040000 Skipping bad block at 0x00080000 Skipping bad block at 0x000c0000 Skipping bad block at 0x00100000 Skipping bad block at 0x00140000 Skipping bad block at 0x00180000 Skipping bad block at 0x001c0000 Skipping bad block at 0x00200000 Skipping bad block at 0x00240000 Skipping bad block at 0x00280000 Skipping bad block at 0x002c0000 Skipping bad block at 0x00300000 Skipping bad block at 0x00340000 Skipping bad block at 0x00380000 Skipping bad block at 0x003c0000 =>
Under normal circumstances, there should not be so many bad blocks in the flash during the past few days of testing.
1. Whether to use mtd read/write command to operate flash under uboot? Are there any other instructions I can use?
2. There are so many bad blocks, especially on W35N02, the partition has all become bad blocks. It is suspected that it has been marked by mistake. Is there any way to clear the bad block marks?
3. Are there any suggested tools that can be used to debug Flash? Both uboot and Linux are available
Regards,
Stephen