The f_mkfs fucntion creates a file system on the drive.
FRESULT f_mkfs ( BYTE Drive, /* Logical drive number */ BYTE PartitioningRule, /* Partitioning rule */ BYTE AllocSize /* Allocation unit size */ );
The f_mkfs function creates a FAT file system on the drive. There are two partitioning rules, FDISK and SFD, for removable media. It can be selected with a parameter and FDISK format is recommended for most case. This function currently does not support multiple partition, so that existing partitions on the physical dirve will be deleted and re-created a partition occupies entire disk space.
The FAT type, FAT12/FAT16/FAT32, is determined by only how many clusters on the drive and nothing else, according to FAT specification. Thus which FAT type is selected, is depends on the drive size and specified cluster size. The cluster size affects performance of file system and large cluster increases the performance, so that 64 sectors per cluster is recommended except for small drive.
This function is supported on only FatFs with _USE_MKFS option.