FreeRTOS+FAT implementation without malloc
Posted by
kammce on January 31, 2019
Is there a version or method of using FreeRTOS+FAT without requiring malloc? Is there a static version of this library?
FreeRTOS+FAT implementation without malloc
Posted by
heinbali01 on February 1, 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 xFFCREATIONPARAMETERS
{
uint8t *pucCacheMemory; /* User provided memory, or use NULL to malloc the cache memory. */
uint32t ulMemorySize; /* Size of the cache memory, must be a multiple of ‘ulSectorSize’. */
…
} FF_CreationParameters_t;
~~~
The creation parameters will be passed to :
~~~
FFIOManagert *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.