FreeRTOS+FAT implementation without malloc

kammce wrote on Thursday, January 31, 2019:

Is there a version or method of using FreeRTOS+FAT without requiring malloc? Is there a static version of this library?

heinbali01 wrote on Friday, February 01, 2019:

I’m afraid that FreeRTOS+FAT depends on dynamic allocation.

It does not call pvPortMalloc() directly, in stead it lets you define ffconfigMALLOC():

#define ffconfigMALLOC( uxSize )  pvPortMalloc( ( uxSize ) )

The cache memory though can be declared statically. See :

typedef struct xFF_CREATION_PARAMETERS
{
	uint8_t *pucCacheMemory;		/* User provided memory, or use NULL to malloc the cache memory. */
	uint32_t ulMemorySize;			/* Size of the cache memory, must be a multiple of 'ulSectorSize'. */
    ...
} FF_CreationParameters_t;

The creation parameters will be passed to :

FF_IOManager_t *FF_CreateIOManger( FF_CreationParameters_t *pxParameters, FF_Error_t *pError )

The cache memory is used as data buffers between driver and disk. Each block of cache is 512 bytes long.