Skip to main content
Visitor II
May 15, 2023
Solved

STM32U5 File system with FreeRTOS

  • May 15, 2023
  • 5 replies
  • 7162 views

Hello,

I'm using NucleoU575 with CubeMx and I want to make a file system on my SD card.

I want to use FreeRtos but there are no Fatfs in CubeMx and the FileX cannot work with FreeRtos (image). Is there anyway i can use Fatfs with STM32U5 ?

Thank you.


_legacyfs_online_stmicro_images_0693W00000bk2bEQAQ.png 

    This topic has been closed for replies.
    Best answer by coppercrimp

    I had this same problem. Luckily I found it pretty easy to port FatFS over the the STM32U5. Just create a a new project in CubeMX using a microcontroller that *does* support FatFS. In my case I created a project using the STM32L4R9ZG. Then I copied all the FATFS files and directories over to my STM32U5 project. From there its pretty much a simple matter of changing all the header file references from STM32L4R9 device to STM32U5.

    For my project I'm using a STM32U575RIT6 with a SD card interface. I was able to get everything working with FatFS and the SDMMC bus in 4 bit mode

    5 replies

    Visitor II
    May 15, 2023

    I had this same problem. Luckily I found it pretty easy to port FatFS over the the STM32U5. Just create a a new project in CubeMX using a microcontroller that *does* support FatFS. In my case I created a project using the STM32L4R9ZG. Then I copied all the FATFS files and directories over to my STM32U5 project. From there its pretty much a simple matter of changing all the header file references from STM32L4R9 device to STM32U5.

    For my project I'm using a STM32U575RIT6 with a SD card interface. I was able to get everything working with FatFS and the SDMMC bus in 4 bit mode

    M326.1Author
    Visitor II
    May 15, 2023

    Thank you very much, @Community member​ 

    Visitor II
    March 3, 2024

    Use ThreadX RTOS instead. You can then enable FileX normally.

    Explorer
    June 24, 2025

    Hi. I'm also trying to interface a microSD card via SPI (SPI3) in STM32U5 B-U585I-IOT02A Discovery kit. 
    While attempting this setup,I encountered the following error:
    f_mount error (3)
    This corresponds to FR_NOT_READY, which indicates that the physical drive cannot work.

    I documented the steps I followed and would really appreciate if anyone could kindly take a look and point out any possible issues or missing parts in my configuration or code.


    To make it easier to review, I’ve attached:
         • A full report (PDF) describing my setup and code steps
         • The complete STM32CubeIDE project (ZIP)