I finally managed to bring the SDIO files in an acceptable form to be published.
It works with 24MHz clock and 4bits wide bus, and tested only for the generic F407VET6 board.
I have committed 2 files to libmaple core directory, and 2 files to a new SDIO lib under STM32F4/libraries.
Usage:
- get the master branch from my repo
- get the SdFat lib from https://github.com/greiman/SdFat
- insert into line 164 of SdFatConfig:
Code: Select all
#elif defined(__STM32F4__)
#define ENABLE_SDIO_CLASS 1
Code: Select all
#include "SdioF4.h" // instead of #include "SdFat"
Code: Select all
void yield() {}
Note:
This is due to the EX class way of working, and NOT because the SDIO driver writes wrong data.
I have tested intensively, and the reads were always identical with the writes.
Current benchmarks:
- using bench.ino -- buffer size 512 bytes
Code: Select all
write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
439.69,18756,870,1163
433.55,117741,865,1180
read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
2353.90,1252,211,216
2353.90,440,211,216
- using STM32F4SdioDemo.ino (see attached binary and INO files): (DO NOT USE the SdFatSdioEX" class!!!) - this has the "yield()" function already included.
Code: Select all
size,write,read
bytes,KB/sec,KB/sec
512,432.94,2069.58
1024,710.33,2451.21
2048,1510.87,4270.57
4096,3418.99,5956.09
8192,5170.13,8611.31
16384,6654.81,9750.35
32768,8493.92,10667.59
totalMicros 56530544
yieldMicros 37059984
yieldCalls 51335
yieldMaxUsec 87835
kHzSdClk 24000
Done
- Use it on you own risk!
Although I tested as much as I could, and all examples worked, I cannot exclude that bugs are still in the software, so don't blame me if data gets lost from the card.
Just post here if you encounter any problem, or make a PR on github if you find a bug.