Jerry Fan

MFS FAT implementation and number of FAT supported?

Discussion created by Jerry Fan Employee on Apr 10, 2013
Latest reply on Jun 27, 2013 by Pavel Chromy
Branched from an earlier discussion

I would like to continue this discussion about the FAT corruption.

In the MQX4.0. I found that when being mounted, the MFS did not care about the second FAT even #define MFSCFG_NUM_OF_FATS 2  

Please see the code in Mfs_fat.c line 207-211

 

  for ( i=0;i<(drive_ptr->FAT_CACHE_SIZE) && (error_code==MFS_NO_ERROR);i++ )

        {

error_code = MFS_Read_device_sector (drive_ptr, drive_ptr->FAT_START_SECTOR + needed_sector + i,

(pointer) &drive_ptr->FAT_CACHE_PTR[drive_ptr->BPB.SECTOR_SIZE*i]);

        }

 

ie. if the first FAT corrupted, it will not be recovered.

 

 

Did I miss something?

Outcomes