I have project based on LPC1788 with Nand flash and 2 SDRAM interfaced. after sometime my file system is getting corrupt , i have read the free memory space in nand flash but it is not full at single time also , but why file system data is corrupted dnt knw.. and my file system related operation is getting failed..
And after power On the machine, at the initialisation of nand flash where init_fs() is called , i got return value of retv :4
/*----------------------------------------------------------------------------- * Initialize FAT File System on the NAND Flash *----------------------------------------------------------------------------*/ void init_fs (void) { U32 retv;
while ((retv = finit ("N0:")) != 0) { if (retv == 1) { uart0_printf("\nNAND Flash Init Failed\n"); uart0_printf("\nRetrying...\n"); uart0_printf("\n RETV:%d\n",retv); } else if(retv > 1) { //retv = finit ("N0:"); if(retv <= 3) { uart0_printf("\nNAND Flash is Unformatted ,Need to format ...!\n"); cmd_format("EHT5P") ; uart0_printf("\n RETV:%d\n",retv); } } } if(retv == 0 ) { uart0_printf ("\nNand flash initialized \n\n\n"); uart0_printf("\n RETV:%d\n",retv); }
} as i get information related to same is as below:
Return Value
0 - No error. 1 - IO Error. IO/driver initialization failed, or there is no media, or media initialization failed. 2 - Volume Error. Mount failed. For FAT this means invalid MBR, boot record, or invalid FAT formatting. 3 - Driver Configuration Error. As a result of wrong configuration settings in File_Lib.c 4 - Journal initialization failed. FAT was initialized, but the FAT journal initialization failed. This could be due to the lack of free space on the media or invalid journal structure. File system is OK. Files can be opened, read, written, closed without using the journal.
after that my nand gets formatted ,why this issue occurs don't understand , i don't have deep knowledge about nand flash,
Someone plz help us out..or give me more info related to the same issue when such issue will occur?
Thanks in advance
Dear Surekha, Your return code from finit seems to comply with a FAT JOURNALED error. Did You originally formatted FAT JOURNAL your NAND memory? And in the FileConfig, is the FAT journal type selected?
We are working on a 1788 with a MICRON MT29F1 NAND Flash and randomly we experience a similar behaviour; at boot time the NAND results unformatted (finit reports 2) while perfect running before reset.
Did You get a solution?
Thanks a lot.