# Errors in 'clib\_arm.c' while adding FAT file system component with FreeRTOS

**URL:** <https://forums.freertos.org/t/errors-in-clib-arm-c-while-adding-fat-file-system-component-with-freertos/9076>\
**Category:** ARM\
**Created:** [February 26, 2020, 10:02am UTC](https://forums.freertos.org/t/errors-in-clib-arm-c-while-adding-fat-file-system-component-with-freertos/9076 "2020-02-26T10:02:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![satheesh](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@satheesh](https://forums.freertos.org/u/satheesh)\
**Post date:** [February 26, 2020, 10:02am UTC](https://forums.freertos.org/t/errors-in-clib-arm-c-while-adding-fat-file-system-component-with-freertos/9076/1 "2020-02-26T10:02:30Z")

</div>

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).](http://www.keil.com/pack/doc/mw/FileSystem/html/fs_create_app.html#fs_Device_Configuration) Following are my RTE component settings.

 ![RTE_FAT32_File_system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/6a3c0ad5503276f73486c36f757c4587073d486e.png)

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

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [February 26, 2020, 6:51pm UTC](https://forums.freertos.org/t/errors-in-clib-arm-c-while-adding-fat-file-system-component-with-freertos/9076/2 "2020-02-26T18:51:04Z")

</div>

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.
