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. 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.
This function is supported on only FatFs with _USE_MKFS option.