The function fformat formats an EFS or FAT storage media for using a file system. The parameter drive is a pointer specifying the drive letter. Optionally, a drive label (for FAT) and options can be include in the parameter. The function closes all open files on the drive. Existing file handles become invalid. The function is included in the RL-FlashFS library. The prototype is defined in the file rtl.h. The general form for drive is:
drive := "[driveLetter][driveLabel] [/options]"
The following values are allowed for driveLetter: | driveLetter | Description |
|---|
| None | Default System drive as defined in the file File_Config.c | | "F:" or "F0:" | Flash drive | | "S:" or "S0:" | SPI Flash drive | | "R:" or "R0:" | RAM drive | | "M:" or "M0:" | Memory Card drive 0 | | "M1:" | Memory Card drive 1 | | "U:" or "U0:" | USB Flash drive 0 | | "U1:" | USB Flash drive 1 | | "N:" or "N0:" | NAND Flash drive |
The driveLabel characteristics are: | driveLabel | Description |
|---|
| drive_label | A drive label can be specified for FAT media. A label cannot include spaces or special characters. The maximum length is limited to 11 characters. |
The options are: | options | Description |
|---|
| default | When no format is specified, RL-FlashFS selects the best matching format automatically. However, it is possible to enforce FAT32. | | FAT32 | Formats the media for using the FAT32 file system. | | WIPE | Clears all data. Overwrites sectors with the default value of 0xFF. | | LOW | Clears all data. Performs low-level formatting first. |
|