Skip to main content
GAlso.1
Associate
March 13, 2023
Question

How to interface SD card with STM32L5 NUCLEO with SDMMC and FatFS

  • March 13, 2023
  • 3 replies
  • 2308 views

I am having trouble with getting FatFS to work with SDMMC. When I try to do f_mount, I keep getting an FR_NOT_READY error. It seems to be coming from when initializing the SD card in sd_diskio.c. The tutorials I have found online seem to have the BSP code already generated by the STM32CubeMX, but apparently starting with the L5 series, CubeMX no longer does this. I am wondering if there are any resources or source code that have working BSP code to properly get an SD card to read and write using FatFS.

Thanks for any help

    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    March 13, 2023

    Determine if it's using a GPIO to test for a card in the socket.

    L5, port in an example, should materially be able to use the same pins wired to a header

    STM32Cube_FW_L5_V1.2.0\Projects\STM32L562E-DK\Applications\FatFs\FatFs_uSD_Standalone

    STM32Cube_FW_L5_V1.2.0\Projects\STM32L552E-EV\Applications\FatFs\FatFs_uSD_DMA

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    GAlso.1
    GAlso.1Author
    Associate
    March 13, 2023

    Thanks for your response. The board I am using does not have a SD card socket, so I am using a SD breakout board to connect the SD card to the correct pins. Would I still be able to check if it's using a GPIO to test for a card in socket? And if so, how could I go about doing so?

    Nemui Trinomius
    Associate II
    August 28, 2023

    I made SDMMC example for NUCLEO-L552ZE-Q board(need GCC command line build environment).

    It supports SDXC and eMMC.

    http://nemuisan.blog.bai.ne.jp/?eid=192848#STM32L5

    Best regards,

    Nemui.