SD card library that support classic 4-wire SPI?

Hi. First, I don’t know if this is the best place to make a question like that…

I’m planing to use an ATSAM’E5’ MCU on my new projects and I want to use a classic 4-wire SPI to interface between the MCU and the SD card (CLK, SS/CS, MOSI, MISO signals), and not to use the “SD/MMC interface” which has 4-bit data bus plus other signals.

Also I want to run freeRTOS on the MCU and use a SD card library (I need to define which lib will be) that can work using classic SPI interface between the MCU and the SD card.

Is that ok? Are there freeRTOS’s SD card libs that support 4-wire SPI interface?

Regards.

The FreeRTOS+FAT product (in the labs….still) is normally used with 4-wire SPI interface - but this is just the physical interface to the media - you can write
the physical interface using any means supported by your SD card and target hardware (i.e. does the target hardware have a SPI bus and is that SPI bus wired up to the SD card slot).

1 Like

Hi. Actually, I already did the PCB layout of my new prototype.
I did connected, in hardware, one SPI module of the MCU to the SPI pins of the SD card socket/connector.
My doubt is, if I make my prototype this way, if will the SD card libs work or not, considering the hardware interface that I have stablished between the MCU and the SD card…

The generic libraries talk to the media driver, they have no dependency on how the media is connected, you ‘just’ need to implement the media driver.

1 Like

Hi. Thanks.
I’m very new to RTOSs on MCUs, could you briefly explain about the media driver?
Also, do you know if there are people using SD card with 4-wire SPI like I pretend to use?

The media driver is nothing to do with the RTOS, it is the driver used to communicate between the microcontroller and the physical media on which the file system is stored (in your case an SD card).

As per my first reply in this thread - with our particular file system I have seen more people use SPI than not.

1 Like

Thanks for help @rtel
In my case, I did a PCB layout, that I have not produced prototypes yet, but I will do soon. On this layout I used a 4-wire classic SPI to make the physical interface between the MCU and the SD card. I was not sure if this is suitable in terms of RTOS, this is why I asked before producing the PCBs, and now I have a confirmation that I not need to change the electrical schematic/layout.
Thanks again.
Regards.