#include <rtl.h>
int fformat (
const char* drive); /* drive to format */
Description
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 0
"N1:"
NAND Flash drive 1
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.
LOW_EB
Clears all data. Performs low-level formatting and
erases bad blocks first.
note
LOW and LOW_EB options are used to low-level format the
NAND drive. LOW will erase all good blocks, but will preserve
bad blocks. LOW_EB will also erase bad blocks - this is
particulary usefull at the NAND driver development time, when blocks
may be accidentally marked as bad - this is often the cause of
fformat failure on NAND devices.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.