1
\$\begingroup\$

Below, is the SD card reader I would like to use. It's using SPI.

On an Arduino I got it to work (using SPI).

However, I want to test it on a STM32F103C8T6, and later use it in STM32F407VET6. However, I see both the F1 and F4 can use the FATFS file system, which I need, but only the F4 has the SDIO peripheral (the F1 has not).

But since it is an SPI SD reader, I don't think I will need SDIO anyway. However, still I wonder how to control it. Should I find out myself what SPI commands I should sent or are there better ways? Or should I get an SD card reader without SPI?

For my project, the requirements regarding SD are pretty low. I want to read one file from it, from max. 128 KB, and I don't care much about the speed (within one second is good enough). Maybe later I want to write to it too (also no fast time restrictions).

What would be the easiest way to read from this type of SD card reader?

I would rather use CubeMX and System Workbench (Eclipse).

SD card reader

\$\endgroup\$
  • 2
    \$\begingroup\$ This is not a SD-Card reader with SPI Interface, but a breakout board from SD-Card to a pin header. SD-Cards have a SDIO and SPI interface as standard. \$\endgroup\$ – Arsenal Sep 1 '17 at 8:07
  • \$\begingroup\$ @Arsenal ... Thanks Arsenal, in this case I think SPI is good enough, especially if I can combine it with FATFS (I already asked for an example to filo) \$\endgroup\$ – Michel Keijzers Sep 1 '17 at 9:37
2
\$\begingroup\$

The easiest way if of course SPI. I am not sure if SPI protocol is the only one publicly available.

Software side - use FATFS, there is an STM32F100 demo code already.

\$\endgroup\$
  • \$\begingroup\$ Thanks ... I was unaware the SD card in itself uses already SPI. And FATFS seems indeed logical to use. Where can I find the demo code (STM32F100)? \$\endgroup\$ – Michel Keijzers Sep 1 '17 at 9:36
  • 1
    \$\begingroup\$ In the stm32 directory of FatFS zipfile ;) \$\endgroup\$ – filo Sep 1 '17 at 11:53
  • \$\begingroup\$ And where can I find the STM32F100 demo code? I don't see that, thus also no stm32 directory. \$\endgroup\$ – Michel Keijzers Sep 1 '17 at 12:40
  • 1
    \$\begingroup\$ elm-chan.org/fsw/ff/ffsample.zip \$\endgroup\$ – filo Sep 1 '17 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.