This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

why my nandflash is used 100% when i erase the blocks?

 my nandflash's manufacture is hynix (HY27UG088GDM). I used it on dm355 ,the kernel  version  is mv_pro_4.0.1(linux2.6.10),I will erase and mount the nand flash as:

# flash_eraseall /dev/mtd3
Erasing 128 Kibyte @ 7b60000 -- 24 % complete.
Skipping bad block at 0x07b80000
Erasing 128 Kibyte @ 1ae80000 -- 86 % complete.
Skipping bad block at 0x1aea0000
Erasing 128 Kibyte @ 1efe0000 -- 99 % complete.
# mount -t yaffs2 /dev/mtdblock3 /mnt
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
block 989 is bad
block 3446 is bad
# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 9.5M 5.2M 3.8M 58% /
tmpfs 55.8M 0 55.8M 0% /tmp
/dev/root 9.5M 5.2M 3.8M 58% /dev/.static/dev
none 10.0M 2.5M 7.5M 25% /dev
tmpfs 55.8M 0 55.8M 0% /dev/shm
none 55.8M 12.0k 55.8M 0% /var/run
none 55.8M 0 55.8M 0% /tmp
/dev/mtdblock3 496.0M 494.4M 1.6M 100% /mnt

The mtdblock  I mounted as yaffs2 filesystem count'd been used because few space on it!

# cat /proc/yaffs
YAFFS builtec 23 2008 19:50:17
$Id: yaffs_fs.c,v 1.33 2005/10/27 22:24:04 marty Exp $
$Id: yaffs_guts.c,v 1.22 2005/10/13 02:17:00 charles Exp $

Device 0 "filesystem1"
startBlock......... 0
endBlock........... 3967
chunkGroupBits..... 2
chunkGroupSize..... 4
nErasedBlocks...... 19
nTnodesCreated..... 0
nFreeTnodes........ 0
nObjectsCreated.... 100
nFreeObjects....... 96
nFreeChunks........ 1216
nPageWrites........ 0
nPageReads......... 0
nBlockErasures..... 0
nGCCopies.......... 0
garbageCollections. 0
passiveGCs......... 0
nRetriedWrites..... 0
nRetireBlocks...... 0
eccFixed........... 0
eccUnfixed......... 0
tagsEccFixed....... 0
tagsEccUnfixed..... 0
cacheHits.......... 0
nDeletedFiles...... 0
nUnlinkedFiles..... 0
nBackgroudDeletions 0
useNANDECC......... 1
isYaffs2........... 1

nFreeChunks........ 1216  why so few?
nErasedBlocks...... 19   so few too

I cann't used it as a jffs2  filesystem too!

  • when i used nanddump to see the mtdinfo after flash erased,and find the oob areas are not always 0xff

    0x00000750: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000760: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000770: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x00000790: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000007a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000007b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000007c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000007d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000007e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    0x000007f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      OOB Data: ff ff ff ff ff ff e0 ff ff ff ff ff ff ff ff ff
      OOB Data: e0 ff ff ff ff ff e0 ff ff ff ff ff ff ff ff ff
      OOB Data: e0 ff ff ff ff ff e0 ff ff ff ff ff ff ff ff ff
      OOB Data: e0 ff ff ff ff ff e0 ff ff ff ff ff ff ff ff ff

    but the evm is always 0xff,what's wrong?

  • duke zuo said:
    when i used nanddump to see the mtdinfo after flash erased,and find the oob areas are not always 0xff

    I believe non zero values in the out of band (OOB) data after a complete erase indicates that there are factory marked bad blocks, though it could mean some other failure in either how the flash is being read or how the flash is being erased or in the flash itself. Unfortunately I am not really familiar enough with JFFS2 to say why your flash device is not being recognized to be as large as it should be.

  • If i use the mvl5.0.1 which supported linux kernel 2.6.18,the nand flash can been erase success!but my project is based the mvl4.0,if i change the kernel,i have to change the toolchain, nad have to port  driver  and gui(qt3.3.8  it just only supported by gcc3.4.3),so much works have to do for me!

  • what dvsdk version are you using?  perhaps we can give it a quick try to see if we see the same issue on our side with the same release.  I assume you are using our DM355 EVM as opposed to a proprietary EVM you desgined yourself, correct?  If you designed your own board with a different NAND part, that may explain this issue and will likely require you add the necessary NAND driver support for your NAND device to the kernel (maybe newer 2.6.18 kernel supports wider range of NAND parts).

    Alternatively, you could choose to port 2.6.18 NAND driver to mvl4.0 kernel (based on 2.6.10 driver); althought to be honest it is probrably better you port your software to the newer kernel than vice versa.

  • I also use mvl5.0.1 for developing DM365. But i am so curious with my flash related binaries. ( flash_erase ,  flash_eraseall, nandwrite ...etc )

    In DM355 , i could flash my nand successfully.

    But in DM365 , i use those functions from PSP_02_10_00_14 ,

    but those functions cannot flash my nand correctly...

    For example ,

    flash_eraseall /dev/mtd3 ( where my filesystem is )

    In DM355 , ok .

    In DM365 , it flash whole flash... (my uboot , kernal and filesystem)

     

    Could someone give me a hint???