[INFO] SD module using SPI

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
pikumb
Posts: 3
Joined: Fri Jan 13, 2017 8:41 pm

[INFO] SD module using SPI

Postby pikumb » Fri Jan 13, 2017 9:46 pm

There's someone that can post a working project (possibly a demo) of an SD over SPI for a stmf32fx MCUtype? I've seen the mmc over spi driver provided by chibios (http://chibios.sourceforge.net/html/gro ... s_p_i.html) but I can't figure out how it works. :|

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: [INFO] SD module using SPI

Postby tfAteba » Fri Jan 13, 2017 9:59 pm

Hi Pikumb,

I think that you can find your happiness here:

viewtopic.php?t=1385

There is some links to example code.
regards,

Theo.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [INFO] SD module using SPI

Postby Giovanni » Sat Jan 14, 2017 8:14 am

This reminds me that there is no demo for that since version 3.x....

Giovanni

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: [INFO] SD module using SPI

Postby tfAteba » Sat Jan 14, 2017 12:48 pm

It will be nice to have a demo with the Nucléo board for example.

What do you think?
regards,

Theo.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [INFO] SD module using SPI

Postby Giovanni » Sat Jan 14, 2017 12:54 pm

Nucleo boards don't have a connector, it is not very convenient.

Giovanni

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: [INFO] SD module using SPI

Postby tfAteba » Sat Jan 14, 2017 1:10 pm

I understand you point of view, but in my case I was thinking about using an additional board like this one:

and make the wiring to the corresponding pins.
Attachments
sdcard.jpg
SDcard
regards,

Theo.

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: [INFO] SD module using SPI

Postby tfAteba » Sat Jan 14, 2017 1:25 pm

In my case, I already have the Nucléo board and this module so that whit I suggest this solution.
But effectively, it will be easy to use a board that include the SD-card slot.
regards,

Theo.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: [INFO] SD module using SPI

Postby Giovanni » Sat Jan 14, 2017 2:52 pm

I have a card with a slot, adapting the demo to Nucleo should be very easy, everything is modular as usual.

Giovanni

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: [INFO] SD module using SPI

Postby tfAteba » Sat Jan 14, 2017 2:59 pm

Cool, I will try to run it on the Nucléo board when you will summit the demo.
I'm a very busy at the moment but if I have the time, in next months, I will try to implement it my self.
regards,

Theo.

pikumb
Posts: 3
Joined: Fri Jan 13, 2017 8:41 pm

Re: [INFO] SD module using SPI

Postby pikumb » Sat Jan 14, 2017 5:20 pm

Sorry guys but I'm a newbie on chibios.
I want to use my stm32f303 discovery so all the work should be port these files (downloadable from the other topic you suggested) for the f4 to the f3. It was very simple beacuse I start a new project for my MCU and add fatfs libraries modifying only the makefile and add a bunch of directories and file. I try also to solve the mismatching between the other files like in mcuconf.h and halconf.h (but is common that these file are different and i switch to true all the things that I can according to the f4 files). The problem is for C libraries included in the main file and I can't figure out how to import them. Another problem is an error reported in the os file precisely in the GCC directory rules.mk file. I think this error shows because I've to fix all the differencies between the two MCU and I try to solve them in an incorrect way probably. Another error is in the sdc.h file where eclipse says that sdc_lld.h has "no such file or directory" but if I right click and select "Open Decalration" the correct file appears me. These two problem switching and other times both are stated and other times only one of the two. I post my port here hoping that once ported correctly, I can read and write some file on the SD using SPI.
ButIf this the process will reveal difficult, I would try to use the MMC over SPI solution that is contained in the Chibios HAL documentation. This seems to me like a very simple way to configure and use the sd reader (the one by sunfounder) that uses spi. There are a bunch of functions and seems to me that with some try and error I could simply can talk with the sd. If someone have a simple demo of the usage of this interface (MMC over SPI that should work also for SD card) will be very nice :)
Attachments
RT-STM32F303-DISCOVERY-SDREADER-1.rar
NOT WORKING!
(2.01 MiB) Downloaded 152 times


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 16 guests