SDIO port to STM32F4x

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.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: SDIO port to STM32F4x

Post by Giovanni »

Very well, is the driver functional for F1 family too?

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: SDIO port to STM32F4x

Post by barthess »

I can not test it on F1x. But driver use the same concepts as previous realization. Platform specific code is DMA related and hidden in #if#endif blocks.
One question about naming conventions STM32_SDIO_XXXXX or STM32_SDC_XXXXX ?
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: SDIO port to STM32F4x

Post by barthess »

Code: Select all

/**
 * @brief   Driver configuration structure.
 * @note    It could be empty on some architectures.
 */
typedef struct {
  uint32_t dummy;
} SDCConfig;

may be delete "uint32_t dummy;" at all?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: SDIO port to STM32F4x

Post by Giovanni »

The driver is "SDC" so it should be named accordingly, empty structures are not standard C and some compilers warns about that.

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: SDIO port to STM32F4x

Post by barthess »

1) What about SDC_BUSY_HOOK() and SDC_IDLE_HOOK() to easy realize "hdd led indicator"?
2) Now we can have a deal with RTC. I propose to add it support after finalizing of RTC code on F4/F2 platforms.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: SDIO port to STM32F4x

Post by Giovanni »

Hi,

Better do not add macros in a LLD for things that can be done outside the driver, you can make a led blink without those, I can think several ways to do that. Adding options increases complexity and reduces maintainability.

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: SDIO port to STM32F4x

Post by barthess »

I create new branch from trunk. Code compiles without problems. I plans to concentrate efforts on test suit.
User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: SDIO port to STM32F4x

Post by Badger »

Hi barthess,

Do you use pullups for SDIO on the F4? It's been a while since I looked into it, but as far as I can remember the F1 datasheet showed the pullups where as I couldn't find a similar diagram for the F4. I guess an extended request would be: can you provide details of how you've connected the SD card to the STM32F4 in SDIO mode?

Thanks!
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: SDIO port to STM32F4x

Post by barthess »

I connect it like in STM32-LCD board (connection identical for F1 and F4) from Olimex but without pullup resistors. You can found datasheet with diagrams on Olimex page. I do not observe any problems without external pullups but strongly recommend to insert them to be safe. In my case I just forgot about them when developing board.
User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: SDIO port to STM32F4x

Post by Badger »

Thanks for the hint, I'll probably do my testing without them to see if I have success, and will try and find a resistor array for when I design a PCB! I'll order an SD card breakout so I can help with testing, I have lots of SD cards lying around :D
Post Reply