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

MDK5 NAND Page Data Layout setting

Hello.
I am using MDK5 now. (stm32f2xx)
When I used MDK4 before, I set nand configuration for NAND Page Data Layout.

////////////////////////////////////////////////////////////////////////////
static U32 Init (NAND_DRV_CFG *cfg) {

/* Setup OneNAND Page Layout */ cfg->PgLay->Pos_LSN = 2; cfg->PgLay->Pos_COR = 1; cfg->PgLay->Pos_BBM = 0; cfg->PgLay->Pos_ECC = 8; cfg->PgLay->SectInc = 512; cfg->PgLay->SpareOfs = 2048; cfg->PgLay->SpareInc = 16;

/* Init NAND Driver Peripheral */ /* ... */ return RTV_NOERR;
}

http://www.keil.com/support/man/docs/rlarm/rlarm_fs_cfgspare.htm

////////////////////////////////////////////////////////////////////////////

Can I use nand configuration in MDK5?

Parents
  • I modified a FS_Config_NAND_0.h like this

    Connect to hardware via Driver_NAND#     : 0
    Device Number                            : 0
    Bus Width                                : 8-bit
    Page Size                           : 4096+244 bytes   // special setting. not default
    Block Size                               : 64 pages
    Device Size[blocks]                      : 4096
    Page Caching                             : 8 pages
    Block indexing                           : 16 blocks
    Software ECC                             : Hamming (SLC)
    Drive Cache Size                         : 8 KB
    

    and I programmed the sample like this

    finit ("N0:");
    printf("finit = 0x%x\r\n",stat) ;
    
    fmount ("N0:");
    printf("fmount = 0x%x\r\n",stat) ;
    
    stat = 0 ;
    opt = "/FAT32";
    stat = fformat ("N0:",opt) ;
    printf("fformat = 0x%x\r\n",stat) ;
    
    
    result :
    finit = 0x0
    fmount = 0x9
    fformat = 0x9
    
    #define fsMediaError    0x09       // Media error
    
    

    I don't know why I can not format a NAND Filesystem in KEIL5(MDK5).

    But I succeeded to format a NAND Filesystem using a NAND Page Data Layout in KEIL4(MDK4).

Reply
  • I modified a FS_Config_NAND_0.h like this

    Connect to hardware via Driver_NAND#     : 0
    Device Number                            : 0
    Bus Width                                : 8-bit
    Page Size                           : 4096+244 bytes   // special setting. not default
    Block Size                               : 64 pages
    Device Size[blocks]                      : 4096
    Page Caching                             : 8 pages
    Block indexing                           : 16 blocks
    Software ECC                             : Hamming (SLC)
    Drive Cache Size                         : 8 KB
    

    and I programmed the sample like this

    finit ("N0:");
    printf("finit = 0x%x\r\n",stat) ;
    
    fmount ("N0:");
    printf("fmount = 0x%x\r\n",stat) ;
    
    stat = 0 ;
    opt = "/FAT32";
    stat = fformat ("N0:",opt) ;
    printf("fformat = 0x%x\r\n",stat) ;
    
    
    result :
    finit = 0x0
    fmount = 0x9
    fformat = 0x9
    
    #define fsMediaError    0x09       // Media error
    
    

    I don't know why I can not format a NAND Filesystem in KEIL5(MDK5).

    But I succeeded to format a NAND Filesystem using a NAND Page Data Layout in KEIL4(MDK4).

Children