Download FreeRTOS
 

Quality RTOS & Embedded Software

LIBRARIES
WHAT'S NEW
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.
OPC-UA over TSN with FreeRTOS.

Mounting a Formatted Partition
Creating a FreeRTOS-Plus-FAT Media Driver

Once a partition has been formatted it can be mounted. The FF_Mount() function is used for this purpose.

As an example, below is the outline of the prvMountPartition() function used by FreeRTOS-Plus-FAT's RAM disk driver. prvMountPartition() is called by the RAM disk's initialisation function and demonstrates how to use the FF_Mount() function. See the file ff_ramdisk.c in the FreeRTOS-Plus/Source/FreeRTOS-Plus-FAT/portable/common directory for the full version.


static BaseType_t prvMountPartition( FF_Disk_t *pxDisk, BaseType_t xPartitionToMount )
{
FF_Error_t xError;
BaseType_t xReturn;

/* Record the partition number the FF_Disk_t structure is managing. */
pxDisk->xStatus.bPartitionNumber = xPartitionToMount;

/* Mount the partition. */
xError = FF_Mount( pxDisk->pxIOManager, xPartitionToMount );

if( FF_isERR( xError ) == pdFALSE )
{
/* Record that the partition is now mounted. */
pxDisk->xStatus.bIsMounted = pdTRUE;
xReturn = pdPASS;
}
else
{
xReturn = pdFALSE;
}

return xReturn;
}

Mounting a Partition


Adding a Partition to the Virtual File System

FreeRTOS-Plus-FAT implements a virtual file system, in which each mounted partition appears as a directory. Mounted partitions are added to the virtual file system using the ff_fs_add() function.








Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.