Errors in 'clib_arm.c' while adding FAT file system component with FreeRTOS

Hi,

I am trying to setup FAT32 file system for SD card according to steps mentioned in (http://www.keil.com/pack/doc/mw/FileSystem/html/fs_create_app.html#fs_Device_Configuration). Following are my RTE component settings.

When compiling the project, I am getting the following errors with clib_arm.c. I guess it is due to assignment of INCLUDE_xSemaphoreGetMutexHolder to 0. But in FreeRTOSconfig.h, INCLUDE_xSemaphoreGetMutexHolder is set to 1.

//////////////////////////////////////////////////////////////////////////////////////////

compiling segger_rtt.c…
compiling segger_rtt_printf.c…
compiling segger_rtt_syscalls_keil.c…
compiling clib_arm.c…
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(46): warning: #77-D: this declaration has no storage class or type specifier
__WEAK
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(47): error: #65: expected a “;”
void _platform_post_stackheap_init (void);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(133): warning: #77-D: this declaration has no storage class or type specifier
__USED int _mutex_initialize(mutex *m);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(133): error: #65: expected a “;”
__USED int _mutex_initialize(mutex *m);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(134): warning: #77-D: this declaration has no storage class or type specifier
__USED void _mutex_acquire (mutex *m);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(134): error: #65: expected a “;”
__USED void _mutex_acquire (mutex *m);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(135): warning: #77-D: this declaration has no storage class or type specifier
__USED void _mutex_release (mutex *m);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(135): error: #65: expected a “;”
__USED void _mutex_release (mutex *m);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(136): warning: #77-D: this declaration has no storage class or type specifier
__USED void _mutex_free (mutex *m);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(136): error: #65: expected a “;”
__USED void _mutex_free (mutex *m);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(151): warning: #223-D: function “xSemaphoreCreateMutexStatic” declared implicitly
clib_mutex_id[i] = xSemaphoreCreateMutexStatic(&clib_mutex_cb[i]);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c(151): warning: #513-D: a value of type “int” cannot be assigned to an entity of type “SemaphoreHandle_t”
clib_mutex_id[i] = xSemaphoreCreateMutexStatic(&clib_mutex_cb[i]);
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\ARM\clib_arm.c: 7 warnings, 5 errors
compiling cmsis_os2.c…
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Include\freertos_os2.h(52): error: #35: #error directive: “Definition INCLUDE_xSemaphoreGetMutexHolder must be non-zero to implement Mutex Management API.”
#error “Definition INCLUDE_xSemaphoreGetMutexHolder must be non-zero to implement Mutex Management API.”
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\CMSIS\RTOS2\FreeRTOS\Source\cmsis_os2.c: 0 warnings, 1 error
compiling os_systick.c…
compiling EventRecorder.c…
compiling retarget_io.c…
assembling startup_va416xx.s…
compiling system_va416xx.c…
compiling FS_Config.c…
compiling FS_Debug.c…
compiling freertos_evr.c…
compiling event_groups.c…
compiling list.c…
compiling heap_2.c…
compiling port.c…
C:\Users\admin\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.3.0\Source\portable\RVDS\ARM_CM4F\port.c(499): warning: A1581W: Added 2 bytes of padding at address 0xba
compiling queue.c…
compiling tasks.c…
compiling timers.c…
“.\Objects\FAT_FreeRTOS.axf” - 6 Error(s), 38 Warning(s).

*** Performing Cross-Module-Optimization:
*** Feedback file ‘.\Objects\FAT_FreeRTOS.fed’ not found.
Target not created.
Build Time Elapsed: 00:00:19

It is difficult to say as neither freertos_os2.h or clib_armc. are our software. It could be an include file ordering issue? Can you post the code from clilb_arm.c that is generating the error.