cancel
Showing results for 
Search instead for 
Did you mean: 

SD card driver for NUCLEO-L433RC-P ?

johngj
Senior

I have the NUCLEO-L433RC-P development board and looking for some code that will allow me to read and write to a micro SD card, but I can't seem to find anything in the example code for this processor.

I found some SD card example code but they were for a different processors and I don't know how to change the processor to an STM32L433

How can I get some software that will allow me to use an SD card with this development board ?

 

 

22 REPLIES 22

FatFs is widely used on many (most?) microcontrollers - it can be easily ported to any microcontroller:

http://elm-chan.org/fsw/ff/

 

SofLit
ST Employee

Hello,

Inspire from the example: Projects\STM32L476G-EVAL\Applications\FatFs provided in STM32CubeL4.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Thanks Andrew, I've been trying to use FatFs on an NXP dev board but with no success (see link below for details) which is why I was hoping ST would have an off the shelf solution.

https://community.nxp.com/t5/S32K/Issue-with-SD-card-using-SPI-on-S32K146-CMD17-response-not-zero/m-p/1791257#M30833

Fatfs is only the driver to control a FAT system, it does not include anything to send the SPI commands to the SD card ?

 

ST doesn't make examples for every conceivable part / board, but rather only those boards they build with specific hardware.

The L4 is perhaps a bit more complex in this regards as there are perhaps 3 SDIO/SDMMC implementations. But it should be possible to migrate the examples for DISCO or EVAL series boards to the NUCLEO with a suitably wired harness. Previously built working examples for clients.

I'd recommend boards like this WaveShare one with appropriate pull-ups and termination

https://www.waveshare.com/wiki/Micro_SD_Storage_Board

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

Thanks SofLit, I tried to use one of the FatFs_uSD_Standalone examples but it would not run because it was using the wrong processor and I don't know how to change it to a STM32L433.

The settings for MCU in the project properties are greyed out and cannot be changed...

 

johngj_0-1705597768010.png

 

 

 

 

 

 

You need to start from scratch using CubeMx to initialize the needed peripherals mainly the SDIO + Adding FatFs and populate your project by inspiring from the example.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
SofLit
ST Employee

See this video https://www.youtube.com/watch?v=I9KDN1o6924

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

@SofLit wrote:

You need to start from scratch using CubeMx

I find this a huge shortcoming!

Surely, one of the most common requirements must be to take some existing code (whether an ST example, or "own" code) and port it to a different processor?

eg, you've prototyped something on a Nucleo or Disco, but will a different variant in production.

Clearly, there can't be a dev board for every single part variant - so this really should be a key requirement for the tools to support?!

 

Thanks SofLit,  I followed the youtube video but get the following build errors...

johngj_0-1705673367025.png

The only difference between the youtube video and my project is that I am using the NUCLEO-L433RC-P (whereas the video is using the STM32F746G-DISCO).

I have to use SPI peripheral as the interface, because the L433RC does not have the SDMMC peripheral