Download FreeRTOS

Quality RTOS & Embedded Software

New FreeRTOS Long Term Support version released
Simplifying Authenticated Cloud Connectivity for Any Device.
Designing an energy efficient and cloud-connected IoT solution with CoAP.
Introducing FreeRTOS Kernel version 11.0.0:
FreeRTOS Roadmap and Code Contribution process.


[FreeRTOS Embedded File System API]

unsigned char f_getfreespace ( F_SPACE *pxSpace );

Populate a structure with the following information about the embedded FAT file system drive.

  • Total drive space.
  • Free space remaining.
  • Used space.
  • Unusable (bad) size.


pxSpace   A pointer to an F_SPACE structure.

F_NO_ERROR   The F_SPACE structure was populated.

Any other value.   The F_SPACE structure was not populated. The returned value holds the error code.

Example usage:

void vDriveInfo( void )
F_SPACE xSpace;
unsigned char ucReturned;

/* Get space information on current embedded FAT file system drive. */
ucReturned = f_getfreespace( &xSpace );
if( ucReturned != F_NO_ERROR )
/* holds the total drive size, holds the
free space on the drive, xSpace.used holds the size of the used space
on the drive, xSpace.bad holds the size of unusable space on the
drive. */

/* xSpace could not be completed. ucReturned holds the error code. */

Example use of the f_getfreespace API function
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.