This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

FlashFS NAND K9F5608 not work

Hi,

I'm having trouble configuring the NAND K9F5608U in FlashFS.
The File_Config.c file has no configuration options for this memory. If I am not wrong, the setting should be:

Page size = 16384 + 512 bytes
Block size = 32 pages
Devise size = 2048 blocks

I have done work NAND K9F1G08U but my hardware requires K9F5608U (I'm using a LPC2478).

Some help?

Parents
  • Hi,

    Look..

    finit("N0:"); // return 2 (Volume Error)
    fformat("N0:"); // return 0 (EFS)
    finit("N0:"); // return  0
    
    ...
    
    finit("N0:"); // return 2 (Volume Error)
    fformat("N0: /FAT32"); // return 1
    finit("N0:"); // return 2 (Volume Error)
    
    ...
    
    finit("N0:"); // return 2 (Volume Error)
    fformat("N0: /FAT32 /WIPE"); // return 1
    finit("N0:"); // return 2 (Volume Error)
    
    
    ...
    
    finit("N0:"); // return 2 (Volume Error)
    fformat("N0: /FAT32 /WIPE /LOW_EB"); // return 1
    finit("N0:"); // return 2 (Volume Error)
    

    file_lib.c for FAT32

    nand0_UnInit: return 1
    nand0_RdSect: return __TRUE (ftl_ReadSect return RTV_NOERR)
    nand0_WrSect: return __TRUE (ftl_WriteSect return RTV_NOERR)
    nand0_RdInfo: return 1
    nand0_DevCtrl: return M_NOCHKMEDIA (code == DC_CHKMEDIA)
    nand0_DevCtrl: return 1 (code == DC_FORMAT)
    
    nand0_dev->PgLay.Pos_LSN = 0x00
    nand0_dev->PgLay.Pos_COR = 0x04
    nand0_dev->PgLay.Pos_BBM = 0x05
    nand0_dev->PgLay.Pos_ECC = 0x06
    nand0_dev->PgLay.SecInc = 0x0210
    nand0_dev->PgLay.SpareOfs = 0x0200
    nand0_dev->PgLay.SpareInc = 0x0210
    

Reply
  • Hi,

    Look..

    finit("N0:"); // return 2 (Volume Error)
    fformat("N0:"); // return 0 (EFS)
    finit("N0:"); // return  0
    
    ...
    
    finit("N0:"); // return 2 (Volume Error)
    fformat("N0: /FAT32"); // return 1
    finit("N0:"); // return 2 (Volume Error)
    
    ...
    
    finit("N0:"); // return 2 (Volume Error)
    fformat("N0: /FAT32 /WIPE"); // return 1
    finit("N0:"); // return 2 (Volume Error)
    
    
    ...
    
    finit("N0:"); // return 2 (Volume Error)
    fformat("N0: /FAT32 /WIPE /LOW_EB"); // return 1
    finit("N0:"); // return 2 (Volume Error)
    

    file_lib.c for FAT32

    nand0_UnInit: return 1
    nand0_RdSect: return __TRUE (ftl_ReadSect return RTV_NOERR)
    nand0_WrSect: return __TRUE (ftl_WriteSect return RTV_NOERR)
    nand0_RdInfo: return 1
    nand0_DevCtrl: return M_NOCHKMEDIA (code == DC_CHKMEDIA)
    nand0_DevCtrl: return 1 (code == DC_FORMAT)
    
    nand0_dev->PgLay.Pos_LSN = 0x00
    nand0_dev->PgLay.Pos_COR = 0x04
    nand0_dev->PgLay.Pos_BBM = 0x05
    nand0_dev->PgLay.Pos_ECC = 0x06
    nand0_dev->PgLay.SecInc = 0x0210
    nand0_dev->PgLay.SpareOfs = 0x0200
    nand0_dev->PgLay.SpareInc = 0x0210
    

Children
  • Found the problem..

    finit("N0: /FAT32"); // Error
    finit("N0: /fat32"); // Ok
    

    File system working!

  • NAND drive can only be formatted with FAT12, FAT16 or FAT32 file system. You cannot format your device with FAT32 because it is to small (FAT32 volume requires at least 65,527 clusters of space).

    if (fformat("N0:") == 0) {
      /* NAND drive formatted with FAT12 or FAT16 or FAT32 (depends on its size) */
    }
    
    if (fformat("N0: /fat32") = 0) {
      /* NAND drive formatted with FAT12 or FAT16 (depends on its size) */
      /* because FlashFS does not detect lowercase switch */
    }
    
    if (fformat("N0: /FAT32") == 0) {
      /* NAND drive formatted with FAT32 */
    }
    

    Since size of your device is 32MB, it was most likely formatted using FAT16 ;)