[libmaple] SDIO

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
acronis
Posts: 142
Joined: Thu Mar 02, 2017 12:32 pm

Re: [libmaple] SDIO

Post by acronis » Fri Aug 04, 2017 7:36 am

Removed the SPI library.Error remained. If swap - then everything is fine

Error:

#include <Adafruit_TFTLCD_16bit_STM32.h> // Hardware-specific library
#include "SdioF4.h"


Ok:

#include "SdioF4.h"
#include <Adafruit_TFTLCD_16bit_STM32.h> // Hardware-specific library

stevestrong
Posts: 1748
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] SDIO

Post by stevestrong » Fri Aug 04, 2017 7:41 am

Good that is working in this way. Keep it.

victor_pv
Posts: 1681
Joined: Mon Apr 27, 2015 12:12 pm

Re: [libmaple] SDIO

Post by victor_pv » Mon Aug 07, 2017 7:16 pm

Steve, I have started working on the port to the F1.
So far I have a couple of questions for you:
1.- The function sdio_gpios_init() sets the pins for 4bit mode. Would not be helpful to allow the library to work in 1bit wide mode for anyone wanting to save a few GPIOs for something else, in which case the function should be able to set the pins for either 4bit or 1bit modes?
The function sdio_set_dbus_width() could call that one with a parameter to set the required number of pins to the right mode.


2.- There is a define for:

Code: Select all

#define SDIOCLK
Wouldn't it be helpful to set this to a formula that calculates that from the different bus divider, pll, etc, in case boards with other clock frequencies are added and supported?

EDIT:
Removed my edit since I was understanding a piece of code wrong.

stevestrong
Posts: 1748
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] SDIO

Post by stevestrong » Tue Aug 08, 2017 7:51 am

Victor,
1. As far as I know:
- the SDIO 1 bit mode rd/wr performance is below the SPI performance.
- the number of pins needed for SDIO 1 bit mode is equal to number of pins needed by SPI.
- SDIO is available only for HIGH_LINE devices, where the number of pins is large enough.
Considering these, the SDIO 1 bit mode it only makes really sense if there is no free GPIO left and no free SPI port left on the chip, which I cannot really imagine.
However, you could implement it for the F1 line if you want, for the F4 family, where there are a lot of GPIOs available, I wouldn't bother.

2. I agree, the clock should be best calculated from the current PLL and clock settings.
- But the time I developed that, I considered that for F4 I will anyway use only the 168MHz. Anyway, feel free to add the feature you want.

victor_pv
Posts: 1681
Joined: Mon Apr 27, 2015 12:12 pm

Re: [libmaple] SDIO

Post by victor_pv » Tue Aug 08, 2017 9:00 pm

stevestrong wrote:
Tue Aug 08, 2017 7:51 am
Victor,
1. As far as I know:
- the SDIO 1 bit mode rd/wr performance is below the SPI performance.
There there is not much of a need to do it. I thought SDIO was more efficient than SPI mode even at 1bit. If not, a shared SPI with separate CS is a better way to save pins.
stevestrong wrote:
Tue Aug 08, 2017 7:51 am
2. I agree, the clock should be best calculated from the current PLL and clock settings.
- But the time I developed that, I considered that for F4 I will anyway use only the 168MHz. Anyway, feel free to add the feature you want.
I'll look at it, At the moment I'm using a define like you, but I still need to find time to test it, then ext will try to change that for the F1, and next hopefully send you a PR for the F4.

acronis
Posts: 142
Joined: Thu Mar 02, 2017 12:32 pm

Re: [libmaple] SDIO

Post by acronis » Fri Aug 18, 2017 7:08 am

Hello stevestrong !

Can you tell time when you are planning to add support for I2C ?

stevestrong
Posts: 1748
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] SDIO

Post by stevestrong » Fri Aug 18, 2017 7:16 am

Sorry, no, I cannot tell because currently I have no application for F4 which would involve I2C.

My priorities include the black F4 on-board SPI flash.
Then I intend to test the blue F4 board. I think that board includes an I2C flash chip, so this will bring your request forward.
As further step the Seed arch max is targeted.

Meanwhile, anyone is welcome to contribute.

Or, if you cannot wait, try the alternative cores: generic, HAL, stm32duino.

acronis
Posts: 142
Joined: Thu Mar 02, 2017 12:32 pm

Re: [libmaple] SDIO

Post by acronis » Fri Aug 18, 2017 7:40 am

I really like Your library, You already realized that I am using in my projects.
Required only support I2C.
I really like the black Board STM32F407VET6.
I'll wait for your implementation !
All the best to You !

Post Reply