This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCU-PLUS-SDK-AM243X: FreeRTOS FAT file system (fs/freertos/fat) doesn't support FreeRTOS

Part Number: MCU-PLUS-SDK-AM243X

Hello,

I want to bring up FreeRTOS FAT file system (fs/freertos/fat) on the FreeRTOS -- not nortos. But current SDK source code supports nortos only. 

Do you have plans to support FreeRTOS?

I modified makefile.am243x.r5f.ti-arm-clang to support FreeRTOS.

I removed source/fs/freertos_fat/portable/nortos/portable.c and removed source/fs/freertos_fat/portable/nortos include path.

I added ff_locking.c and ff_time.c file in the FILES_common. I added FreeRTOS include path.

When I tried to build the library, I got a compile error as below:

Compiling: freertos_fat.am243x.r5f.ti-arm-clang.debug.lib: C:/ti/mcu_plus_sdk_am243x_08_03_00_18/source/fs/freertos_fat/FreeRTOS-FAT/ff_stdio.c
In file included from C:/ti/mcu_plus_sdk_am243x_08_03_00_18/source/fs/freertos_fat/FreeRTOS-FAT/ff_stdio.c:34:
C:/ti/mcu_plus_sdk_am243x_08_03_00_18/source/fs/freertos_fat/FreeRTOS-FAT/include\ff_stdio.h:155:10: error: Please define space for 3 entries
#error Please define space for 3 entries
^
1 error generated.

Here is compile error code in the ff_stdio.h:

#if ( ( configNUM_THREAD_LOCAL_STORAGE_POINTERS - ffconfigCWD_THREAD_LOCAL_INDEX ) < 3 )
#error Please define space for 3 entries
#endif

Both values are defined as below:

#define configNUM_THREAD_LOCAL_STORAGE_POINTERS (4)   <- FreeRTOSConfig.h
#define ffconfigCWD_THREAD_LOCAL_INDEX (4U)           <- FreeRTOSFATConfig.h

Do you have any suggestions for this issue?

  • Hello,

    I forgot to mention another problem that is missing portINLINE definition in the source\kernel\freertos\portable\TI_ARM_CLANG\ARM_CR5F\portmacro.h file.

    I added portINLINE macro definition to avoid freertos_fat compile error.

  • Hi Chaehee,

    The configNUM_THREAD_LOCAL_STORAGE_POINTERS is set as 4 for general use cases. We have not yet added support for FreeRTOS_FAT with freertos. The steps used by you are correct for porting. Corrections you need to do it configNUM_THREAD_LOCAL_STORAGE_POINTERS to be increased to as FreeRTOS_FAT itself uses 2 threads. Also you might need to increase the heap in your linker file to support configNUM_THREAD_LOCAL_STORAGE_POINTERS as 6.

    I see the definitions of portINLINE are present for M4/A53 core but not for R5F core. I will raise a ticket for the same. Thanks for pointing this out.

    Thanks and Regards,
    Aakash