Teensy-4.1 - which SD lib?

Status
Not open for further replies.

mwpaus

New member
Hi all,

I'm just starting my first Teensy 4.1 project.
I'm using the Arduino framework as supplied by PlatformIO inside Visual Studio Code.

Which SD library should I be using?
It needs to be fast (4bit SDIO) & efficient as I need to read video data.

Thanks in advance!
 
Get you the latest TeensyDuino and use the standard SD library (it uses SdFat-beta allowing exFAT disks and 4bit SDIO)
No more issues in the future
OK, as the port is brand-new there may be some minor hick-ups
 
Last edited by a moderator:
Yup, SdFat-beta gives the very best performance.

If you're using PlatformIO, you probably have code based on Teensyduino 1.53 or older. The new SD - SdFat integration is only in the latest beta, and to be honest, it's very new and we're still finding & fixing bugs.
 
Thanks guys. Sounds like it not worth the trouble for the moment for a quick project :(

Out of interest, why isn't elm-chan's FatFs used?
It's pretty much the go-to for microcontroller FS and is easily ported (i have done it a few times before for Cortex-M uC's).
 
Thanks guys. Sounds like it not worth the trouble for the moment for a quick project :(

Out of interest, why isn't elm-chan's FatFs used?
It's pretty much the go-to for microcontroller FS and is easily ported (i have done it a few times before for Cortex-M uC's).

It is ported https://github.com/WMXZ-EU/uSDFS and is used for USB-Host MSC
I ask myself the question. HW interface is pretty easy, and AFAIK it is used in most MCU development SW, but Arduino works has its own rules
 
@mwpaus
I am like you just starting down the Teensy 4.1 path after picking one up the other day. I'm looking for the best SD performance I can get for various data logging, data replay, etc. So far it looks like the best write performance is around 20MB/s for a small handfull of cards I have laying around. (benched 10 so far) Read performance tops out around 22.8MB/s for almost all my cards. Looks to be a clocking limitation for going any faster since all the cards hit the same speed wall.
FastestSDs4-1.png
These are the best three cards I have. Read speeds are nearly identical, and write speeds are where there is a "slight" difference. The Samsungs are some of my older cards. The newer ones do not seem to have as good of write speed. The SanDisk is probably the newest I tested. I probably have some cards that "could" perform better, but they are probably in use.

Code:
Samsung 32 PRO
size,write,read
bytes,KB/sec,KB/sec
512,20599.29,22821.74
1024,20899.73,22777.86
2048,20942.15,22836.52
4096,20843.75,22879.44
8192,20932.53,22876.82
16384,20933.16,22870.45
32768,20974.19,22962.36

Samsung 32 EVO
size,write,read
bytes,KB/sec,KB/sec
512,20418.88,22620.01
1024,19616.83,22647.12
2048,20070.84,22699.89
4096,20302.80,22718.76
8192,20589.08,22733.42
16384,20744.93,22781.94
32768,20181.32,22721.90

SanDisk 16 Extreme
size,write,read
bytes,KB/sec,KB/sec
512,20113.38,22829.56
1024,20546.26,22854.50
2048,20253.34,22913.25
4096,20619.75,22943.45
8192,20304.71,22956.32
16384,20633.24,22963.24
32768,20292.14,22966.82

EDIT: Just found a Samsung Evo that cracked the 21MB/s barrier

Code:
size,write,read
bytes,KB/sec,KB/sec
512,21177.79,22892.11
1024,21324.06,22927.84
2048,21342.02,22953.37
4096,21380.37,22965.12
8192,21402.73,23022.54
16384,21391.87,23029.43
32768,21128.82,23034.05
 
Last edited:
Status
Not open for further replies.
Back
Top