Showing results for 
Search instead for 
Did you mean: 

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


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


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



Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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?

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

It supports SDXC and eMMC.

Best regards,