New SdFat library (with and without DMA)

Please do not post requests
User avatar
Pito
Posts: 1529
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: New SdFat library (with and without DMA)

Post by Pito » Wed Sep 14, 2016 11:06 am

FYI - the latest SdFat-beta (MMini, 36MHz SPI) and the "bench" with 512bytes buffer size and new SdFatEX class:

Code: Select all

Type any character to start
FreeStack: 14444
Type is FAT32
Card size: 8.03 GB (GB = 1E9 bytes)

Manufacturer ID: 0X1B
OEM ID: SM
Product: 00000
Version: 1.0
Serial number: 0X8D172C54
Manufacturing date: 1/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
3528.36,22171,135,143
3654.74,7632,135,138

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
3280.63,1512,154,154
3282.78,1429,154,154

Done
Type any character to start
Great improvement here - the above speeds were possible only with 8kB buffer size in previous versions.
Cool!

BTW, BillG did 20MB/sec rd/wr with SDIO on Teensy 3.6 with the newest SdFat-beta..
Last edited by Pito on Thu Sep 15, 2016 8:10 am, edited 1 time in total.
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 6911
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: New SdFat library (with and without DMA)

Post by RogerClark » Wed Sep 14, 2016 8:49 pm

Re:SDIO

This may be possible with the Arduino Core that STM are developing.

I have asked them to put SDIO on their ToDo list, but at the momemt I dont know if they have the resources to create a SDIO lib for their core.

( see my announcement post in the announcements section)

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

Re: New SdFat library (with and without DMA)

Post by stevestrong » Thu Sep 15, 2016 7:34 am

Anyway, SDIO is not relevant for F103 family with less than 768kB flash, such as current blue and red pills.
For any other, specially Arch max, is more than welcome :)

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

Re: New SdFat library (with and without DMA)

Post by Pito » Thu Sep 15, 2016 8:05 am

Yea, SDIO is available on bigger chips only, also I've read somewhere ie. the 407 SDIO is buggy, the first well working on 446.
I did some naive experiments years back on 407 and chibios, I did 6MB/sec with 32kB blocks and a cheapo sdcard, not sure it was set up properly, however :?
Anyway, 3.5MB/sec with only a 512bytes large buffer on the MapleMini SPI is an impressive number, sure..
That is so close to the theoretical limit with 36MHz SPI clock.. Unbelievable :shock:
Pukao Hats Cleaning Services Ltd.

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

Re: New SdFat library (with and without DMA)

Post by stevestrong » Thu Sep 15, 2016 8:52 am

Hmm, write speed (3.5) higher than read speed (3.2) ? Is this really OK?
Anyway, just for the record, I found the SDIO bug discussion on ST forum.
Their benchmark: 2.8 write, 9.4 read using FatFS & SDIO 4 bit mode on STM32F4 disco.

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

Re: New SdFat library (with and without DMA)

Post by Pito » Sat Sep 17, 2016 10:26 am

Hmm, write speed (3.5) higher than read speed (3.2) ? Is this really OK?
Anyway, just for the record, I found the SDIO bug discussion on ST forum.
Their benchmark: 2.8 write, 9.4 read using FatFS & SDIO 4 bit mode on STM32F4 disco.
The write speed is higher as the modern cards have got an large ram buffer inside, so the writes are buffered somehow.. (Info: BillG, author of the SdFat).
On Teensy 3.6 Bill did 19/20MB/sec with SDIO and the latest SdFat-beta, he claims:
https://forum.pjrc.com/threads/36737-Tr ... post115239

PS: Mind he runs Teensy 3.6 @240MHz :shock:
https://www.kickstarter.com/projects/pa ... -35-and-36
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 6911
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: New SdFat library (with and without DMA)

Post by RogerClark » Sat Sep 17, 2016 11:03 am

Pito wrote:
PS: Mind he runs Teensy 3.6 @240MHz :shock:
https://www.kickstarter.com/projects/pa ... -35-and-36
OMG

Thats fast.

Hopefully STM will write an SDIO lib with DMA for their new core, and we will be able to get some high speeds using SDIO on the boards which support it.

Phono
Posts: 90
Joined: Tue May 05, 2015 6:08 am
Location: Ermont, France

Re: New SdFat library (with and without DMA)

Post by Phono » Thu Sep 22, 2016 7:31 pm

So let me jump into the bandwagon, and tell me the status of SDFat? Where can I find it? Is it now possible to select the SPI to be used, so that I can avail myself of the SD slot of the Olimex boards ?

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

Re: New SdFat library (with and without DMA)

Post by Pito » Fri Sep 23, 2016 10:28 am

https://github.com/greiman/SdFat-beta

You can assign what you want, I think it supports two SPIs with two cards in parallel now..
Pukao Hats Cleaning Services Ltd.

VadimEL
Posts: 66
Joined: Sat Aug 13, 2016 1:28 pm

Re: New SdFat library (with and without DMA)

Post by VadimEL » Thu Sep 29, 2016 9:23 pm

Need example, replace chars in file.

I have file like

Code: Select all

12345 434 3
fg23r 34f3 
2g42h 34 3
h3443 f34 43f
Need replace all 3 to 1, with minimal code. Please help =)

I know way
1)read all to mas
2)find char
3)replace
4)save to file
but it's to long way, need shorter, or it's the best way?

Post Reply