cancel
Showing results for 
Search instead for 
Did you mean: 

STm32CubeIDE v1.3 with FatFS R0.12c problem to work with SD card when FreeRTOS is present

lorant124
Associate III

Hi,

I am trying to use the latest CubeIDE V1.3 with cubeMX v5.6 with FatFS R0.12c and with FreeRTOS cmsis_osv2 (tried it with cmsis_osv1 too but to same). I am using FreeRTOS in my project. The SD card is connected using SDIO 1-bits (SD 1 bit because MMC 1 bit doesnt work with fatfs) wide bus. The MCU is STM32L151RDT6. HAL driver is V1.9.

The problem is that f_mount function is never working.

I tried without Freertos, it is work fine but FREERTOS+SDIO+FATFS f_mount doesnt work.

If I using cmsis_v2 I have compiling error after generating code from MX.

undefined reference to `osSemaphoreCreate' syscall.c Middlewares/Third_Party/FatFs/src/option line 45 C/C++ Problem

undefined reference to `osSemaphoreWait' syscall.c Middlewares/Third_Party/FatFs/src/option line 84

because in cmsis_osv2 osSemaphoreCreate is renamed to osSemaphoreNew and osSemaphoreWait to osSemaphoreAcquire.

I fixed it with :

osSemaphoreId_t SEM;
....
SEM = osSemaphoreNew(1,0, &SEM_attributes);
...
if(osSemaphoreAcquire(SEM,_FS_TIMEOUT) == osOK)

please help.

Thank you

3 REPLIES 3
RHuan.2
Associate

I have exactly the same problem. Is anyway I can walk-around?

Thanks.

TPrio.2
Associate

Hi,

I've got the same problem. Was anyone able to fix it?

Thanks!

TPrio.2
Associate

Got around this issue by choosing the freertos interface CMSIS v1 instead of CMSIS V2