Skip to main content
Graduate
March 20, 2020
Question

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

  • March 20, 2020
  • 3 replies
  • 1726 views

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

    This topic has been closed for replies.

    3 replies

    Visitor II
    May 1, 2020

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

    Thanks.

    Visitor II
    October 6, 2020

    Hi,

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

    Thanks!

    Visitor II
    October 6, 2020

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