Error after Format FAT filesystem

Hi people!

I have this problem with sample FAT_SHELL.c running on SD flash of
RCM4300 cpu. error 319 is rised (File is in an invalid state) Why??

A> ls
Open Directory ‘’ Error: File is in an invalid state. Probably because the FATf
ile structure was not zero when opened for the first time.
A> format 0
format 0 succeeded

Partition A is mounted.

A> ls
Open Directory ‘’ Error: File is in an invalid state. Probably because the FATf
ile structure was not zero when opened for the first time.
A> pdump
partition number 0, type 2
serialnumber = 8199164 (0x007d1bfc)
journal number (ftc_prt) = 0

     2 FATs (fat_cnt)                                                       
124482 bytes in a FAT (fat_len * 2)                                         
   244 sectors per FAT (sec_fat)                                            
   512 entries in root directory (root_cnt)                                 
     4 reserved sectors (res_sect)                                          
                                                                            
    16 sectors per cluster (sec_clust)                                      
   512 bytes per sector (byte_sec)                                          
  8192 bytes per cluster (clustlen)                                         
 62239 total clusters (totcluster) (486.242MB)                              
     0 bad clusters (badcluster) (0.000KB)                                  
 62239 free clusters (freecluster) (486.242MB)                              
     2 is next cluster (nextcluster)                                        
                                                                            
     5 is first sector of first FAT (fatstart)                              
   493 is first sector of root dir (rootstart)                              
   525 is first sector of data area (datastart)                             
     0 open files                                                           

mpart.bootflag = 0x00
mpart.starthead = 254
mpart.startseccyl = 0
mpart.parttype = 6
mpart.endhead = 254
mpart.endseccyl = 0
mpart.startsector = 1
mpart.partsecsize = 996351
mpart.status = 0080

dev.seccount = 996352
dev.heads = 1
dev.cylinder = 16
dev.sec_track = 62272
dev.byte_sec = 512
dev.byte_page = 512
dev.drv_num = 0
dev.ftc_dev = 0

A>

Thanks,
regards.

The question is how to do when it happen and I have to restart my board or only the progrm, because also unmount_partition doesn’t work!

Any suggestion?

Thanks

[:(]