[STM32GENERIC] SDIO DMA

Discussions about the STM32generic core
ag123
Posts: 663
Joined: Thu Jul 21, 2016 4:24 pm

Re: [STM32GENERIC] SDIO DMA

Post by ag123 » Fri May 19, 2017 5:23 pm

i think the simplified specs and available docs 'out there' makes SD over SPI and 1 pin sdio works, somehow the 4 pins 'high speed' variety which according to the simplified specs is 'mandatory' isn't public, we could only assume that 4 pins would work the same way as 1 pin, i guess that is a possible 'catch' about it

i think one of the better sites about the 4 pin sdio is this
https://yannik520.github.io/sdio.html
i'm yet to find any better resource for it on google

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

Re: [STM32GENERIC] SDIO DMA

Post by victor_pv » Fri May 19, 2017 7:13 pm

stevestrong wrote:Victor, can you provide the black F407VET board BIN file for testing? I have a 16GB CL10 card.
This is my latest working version. I can't include the elf because the forums complains it's too big
F407VET, 4bit, DMA, 512bytes cache
sdfat_sdio_test.zip
(23.98 KiB) Downloaded 20 times

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

Re: [STM32GENERIC] SDIO DMA

Post by stevestrong » Fri May 19, 2017 8:18 pm

First attempt:

Code: Select all

FreeStack: 125615
Type is FAT32
Card size: 15.93 GB (GB = 1E9 bytes)

Manufacturer ID: 0X3
OEM ID: SD
Product: SL16G
Version: 8.0
Serial number: 0X72F2CA43
Manufacturing date: 8/2015

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
336.72,58116,888,1519
425.03,76534,888,1203

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
2187.09,3711,216,233
2190.92,442,216,233

Done
Type any character to start
and after formatting the card:

Code: Select all

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
425.69,108119,888,1201
432.87,18740,883,1181

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
2094.55,441,216,243
2093.67,449,216,243

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

Re: [STM32GENERIC] SDIO DMA

Post by victor_pv » Fri May 19, 2017 8:45 pm

stevestrong wrote:First attempt:

Code: Select all

FreeStack: 125615
Type is FAT32
Card size: 15.93 GB (GB = 1E9 bytes)

Manufacturer ID: 0X3
OEM ID: SD
Product: SL16G
Version: 8.0
Serial number: 0X72F2CA43
Manufacturing date: 8/2015

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
336.72,58116,888,1519
425.03,76534,888,1203

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
2187.09,3711,216,233
2190.92,442,216,233

Done
Type any character to start
and after formatting the card:

Code: Select all

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
425.69,108119,888,1201
432.87,18740,883,1181

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
2094.55,441,216,243
2093.67,449,216,243
Not really fast, but it works :) let's see when Pito tests with his card.

User avatar
Pito
Posts: 1236
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [STM32GENERIC] SDIO DMA

Post by Pito » Sat May 20, 2017 6:38 am

You must have 32kB buffer with SDIO to see higher speeds.
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1236
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [STM32GENERIC] SDIO DMA

Post by Pito » Sat May 20, 2017 9:59 am

With CL10 Samsung and Sandisk:

Code: Select all

Use a freshly formatted SD for best performance.

Type any character to start
FreeStack: 125615
Can't access SD card. Do not reformat.
SD errorCode: 0X64,0X0
With CL4 Sandisk:

Code: Select all

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
297.58,212935,735,1719
304.19,211847,729,1682

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
1159.48,844,370,440
1159.21,845,369,441
After formatting the Sandisk CL10:

Code: Select all

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
435.63,32802,877,1172
436.01,11588,889,1173

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
1971.48,550,256,259
1972.26,521,256,259

Done
Type any character to start
Repeated 3x ok, after 4th run:

Code: Select all

Type any character to start
FreeStack: 125615
No error found.
after 5th run:

Code: Select all

Type any character to start
FreeStack: 125615
Can't access SD card. Do not reformat.
SD errorCode: 0X64,0X0
Pukao Hats Cleaning Services Ltd.

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

Re: [STM32GENERIC] SDIO DMA

Post by victor_pv » Sat May 20, 2017 2:05 pm

Pito wrote:With CL10 Samsung and Sandisk:

Code: Select all

Use a freshly formatted SD for best performance.

Type any character to start
FreeStack: 125615
Can't access SD card. Do not reformat.
SD errorCode: 0X64,0X0
With CL4 Sandisk:

Code: Select all

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
297.58,212935,735,1719
304.19,211847,729,1682

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
1159.48,844,370,440
1159.21,845,369,441
After formatting the Sandisk CL10:

Code: Select all

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
435.63,32802,877,1172
436.01,11588,889,1173

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
1971.48,550,256,259
1972.26,521,256,259

Done
Type any character to start
Repeated 3x ok, after 4th run:

Code: Select all

Type any character to start
FreeStack: 125615
No error found.
after 5th run:

Code: Select all

Type any character to start
FreeStack: 125615
Can't access SD card. Do not reformat.
SD errorCode: 0X64,0X0
I knows 512bytes will not get high speed, but right now I care most about it working right.
Where did you add the code to show the error codes? let's add that to the bench test to see what kind of errors are we getting.

User avatar
Pito
Posts: 1236
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [STM32GENERIC] SDIO DMA

Post by Pito » Sat May 20, 2017 4:29 pm

Where did you add the code to show the error codes? let's add that to the bench test to see what kind of errors are we getting.
http://www.stm32duino.com/viewtopic.php ... =90#p28184
Pukao Hats Cleaning Services Ltd.

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

Re: [STM32GENERIC] SDIO DMA

Post by victor_pv » Sat May 20, 2017 10:58 pm

Pito wrote:
Where did you add the code to show the error codes? let's add that to the bench test to see what kind of errors are we getting.
http://www.stm32duino.com/viewtopic.php ... =90#p28184
I mean in the source code, so I can add it to the code.

I have uploaded my working files to this branch:
https://github.com/victorpv/STM32GENERIC/tree/FW-Update

I have disabled DMA by default to run some more tests.
To enable and disable DMA, modify this line in SDIO.cpp

Code: Select all

_useDMA = false;

danieleff
Posts: 299
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: [STM32GENERIC] SDIO DMA

Post by danieleff » Sun May 21, 2017 6:35 am

It it strange but it only works if I set _useDMA = true;
with _useDMA = false;, I get write errors:

Code: Select all

FreeStack: 125619 
Type is FAT32 
Card size: 7.78 GB (GB = 1E9 bytes) 
 
Manufacturer ID: 0X2 
OEM ID: TM 
Product: SA08G 
Version: 2.2 
Serial number: 0XD1C17F26 
Manufacturing date: 6/2010 
 
File size 5 MB 
Buffer size 512 bytes 
Starting write test, please wait. 
 
write speed and latency 
speed,max,min,avg 
KB/Sec,usec,usec,usec 
HAL_SD_WriteBlocks error, hsd.ErrorCode: 4
error: write failed
HAL_SD_WriteBlocks error, hsd.ErrorCode: 4
Type any character to start 

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest