2024-01-18 07:20 AM
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 ?
2024-01-18 07:54 AM
FatFs is widely used on many (most?) microcontrollers - it can be easily ported to any microcontroller:
2024-01-18 08:23 AM
Hello,
Inspire from the example: Projects\STM32L476G-EVAL\Applications\FatFs provided in STM32CubeL4.
2024-01-18 08:57 AM
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.
Fatfs is only the driver to control a FAT system, it does not include anything to send the SPI commands to the SD card ?
2024-01-18 09:09 AM - edited 2024-01-18 10:11 AM
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
2024-01-18 09:11 AM
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...
2024-01-18 09:21 AM - edited 2024-01-18 09:22 AM
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.
2024-01-18 09:23 AM
See this video https://www.youtube.com/watch?v=I9KDN1o6924
2024-01-19 01:29 AM
@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?!
2024-01-19 06:13 AM
Thanks SofLit, I followed the youtube video but get the following build errors...
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