Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Homepage FreeRTOS+ Products FreeRTOS Labs Integration Services Contact / Enquiries


[FreeRTOS Embedded File System API]

unsigned char f_format( unsigned char ucFATType );

Format the drive. Formatting a drive will close any files that were open and destroy any data that already exists on the drive, including the master boot record.

The formatted drive will start with boot sector information created from the information retrieved from the f_getphy() routine, and use the entire physical space for the volume.

The format operation will fail if the format type is incompatible with the size of the physical media.


ucFATType   The following values are valid:
  • F_FAT12_MEDIA to format as FAT12.
  • F_FAT16_MEDIA to format as FAT16.
  • F_FAT32_MEDIA to format as FAT32.

F_NO_ERROR   The format operation was successful.

Any other value   The drive was not formatted successfully - the return value holds the error code.

Example usage:

void vFormatDrive( void )
unsigned char ucReturned;


    ucReturned = f_format( F_FAT16_MEDIA );
    if( ucReturned != F_NO_ERROR )
        /* The drive could not be formatted (is the disk in?).  ucReturned
        holds the error code. */
        /* The drive was formatted successfully. */
Example use of the f_format() API function

[ Back to the top ]    [ About FreeRTOS ]    [ FreeRTOS+ Sitemap ]    [ Main FreeRTOS Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.