Fastest access storage for Teensy 4.0

Status
Not open for further replies.

Myreauks

Active member
Hi!

I am trying to figure out what would be the absolute fastest storage for large amounts (>100Mb) of data like audio samples and such.
So far, the options I have come across are:

  1. The 8-pin connection for sd-card under the board on Teensy 4.
  2. External SPI flash chips (such as https://www.tindie.com/products/onehorse/spi-flash-memory-add-ons-for-teensy-3x/)

I guess out of these two the SD card would be faster? Are there any other options I am missing?

Best,
Miro
 
Hi!

I am trying to figure out what would be the absolute fastest storage for large amounts (>100Mb) of data like audio samples and such.
So far, the options I have come across are:

  1. The 8-pin connection for sd-card under the board on Teensy 4.
  2. External SPI flash chips (such as https://www.tindie.com/products/onehorse/spi-flash-memory-add-ons-for-teensy-3x/)

I guess out of these two the SD card would be faster? Are there any other options I am missing?

Best,
Miro

Just to be clear, are you talking 100 mega-bits, or 100 mega-bytes?. Normally flash memory uses mega-bits while SD cards use mega-bytes. That flash memory card you mentioned is 128 mega-bits, which is 16 mega-bytes in storage space. There are flash memory chips that offer 1 giga-bit (or 128 mega-byte) space, and it looks like you can go up to 4 giga-bit. But to use those, you will need to do some surface mount soldering.

I did some testing some time ago, comparing 3 storage methods:
  • SD card reader using the Audio Shield (1 bit SPI);
  • SD card reader using the SPI2 pins underneath the Teensy 4 (4 bit quad-SPI); (and)
  • 16 mega-byte flash memory card, soldered to the Audio shield (1 bit SPI).

Here are the results:

In short, there was a little speed up in going to the quad SPI micro-SD card, but not that much.

There was more of a speed up in going to the flash memory card, even though it is 1 bit SPI. There are drivers for 4 bit quad SPI flash memory (from FrankB if memory serves), but the driver hasn't been updated in years. So far, I have not tested it.

Now, I haven't dug in, but it kind of surprised me (since a micro-SD card is essentially flash memory). I suspect that it may be due to the micro-SD card being formatted for FAT32/VFAT, while the flash memory is likely formatted to use FAT16.
 
The 4 bit driver for Flash-SPI and had design problems (needed timed "NOP" loops), wasn't that much faster than 1bit, and did not get any feedback from others so I stalled the development.
In addition, Flash can be really incredible slow if you have to wait for a bolck-delete (can take minutes!). You can't overwrite flash. In all other cases, it is faster than SD.
But no way to store 100 MegaBytes on a single nor flash chip.
 
Just to be clear, are you talking 100 mega-bits, or 100 mega-bytes?. Normally flash memory uses mega-bits while SD cards use mega-bytes. That flash memory card you mentioned is 128 mega-bits, which is 16 mega-bytes in storage space. There are flash memory chips that offer 1 giga-bit (or 128 mega-byte) space, and it looks like you can go up to 4 giga-bit. But to use those, you will need to do some surface mount soldering.

I did some testing some time ago, comparing 3 storage methods:
  • SD card reader using the Audio Shield (1 bit SPI);
  • SD card reader using the SPI2 pins underneath the Teensy 4 (4 bit quad-SPI); (and)
  • 16 mega-byte flash memory card, soldered to the Audio shield (1 bit SPI).

Here are the results:

In short, there was a little speed up in going to the quad SPI micro-SD card, but not that much.

There was more of a speed up in going to the flash memory card, even though it is 1 bit SPI. There are drivers for 4 bit quad SPI flash memory (from FrankB if memory serves), but the driver hasn't been updated in years. So far, I have not tested it.

Now, I haven't dug in, but it kind of surprised me (since a micro-SD card is essentially flash memory). I suspect that it may be due to the micro-SD card being formatted for FAT32/VFAT, while the flash memory is likely formatted to use FAT16.

Hi!

Haha, I always get those two wrong. I most definitely meant 100 megabytes.
I took a look at the speeds you reached in your tests and the fastest was around 5MBytes/sec.

In this thread Bill Greiman has posted a benchmark on transfer speeds on Teensy 4.0 with uSDHC pins using his SDFat-beta library. He has reached speeds of "About 22 MB/sec read write." Is this benchmark a meaningful comparison to the speeds you reached?

If this translates to my use case with the same speed, it would be enough for playing multiple WAV files straight from the SD-card with playSdWav for example?
I am not sure if my math is correct here at all, but since one 16-bit 44.1KHz WAV streams 0.1764 MBps (According) then there should be plenty of overhead even if playing 5-10 files simultaneously from the SD-card. Or are there some other constraints to this solution that I am not taking into account?

Best,
Miro
 
Last edited:
Status
Not open for further replies.
Back
Top