Multiple SD cards with Teensy 4.1

Status
Not open for further replies.

even_rats

Member
Hello!

I found the Micro SD Card Adaptor in the store. My question is: could I connect several of these to a Teensy 4.1 and have simultaneous access to, say, 6 different SD cards?

This project involves reading and/or writing multiple channels of audio at once, in real-time. So my motivation would be to get fast non-sequential reads and writes, vs trying to read/write 6 WAV files simultaneously from one SD card and bottlenecking somewhere at the card level. Does this idea make sense?
 
Last edited:
Hello!

I found the Micro SD Card Adaptor in the store. My question is: could I connect several of these to a Teensy 4.1 and have simultaneous access to, say, 6 different SD cards?

This project involves reading and/or writing multiple channels of audio at once, in real-time. So my motivation would be to get fast non-sequential reads and writes, vs trying to read/write 6 WAV files simultaneously from one SD card and bottlenecking somewhere at the card level. Does this idea make sense?

SD card are all memory. It does not involve drive head positioning, etc. that a spinning disk might encounter.

It would depend on whether the SPI driver for multiple SD cards can do DMA support to do things in parallel. My guess is it would need somebody motivated to go through all of the issues. You would need to grok the lower levels of the Teensy 4.x and the SPI drivers.

You probably would get the best results by not using SD cards, but instead soldering a flash memory chip onto the Teensy 4.1, and using the SPIFFS filesystem. I think things are still a little rough for doing that, and TeensyDunio 1.54 might begin the process of making it simpler to use.

And note, while you can hook up several micro SD drives with different CS pins, you do not have that many SPI streams. There are 3 streams used by the normal SPI library, but there is also FlexSPI support used for the 2 sets of chips you can solder to the Teensy 4.1. But I really don't know the details.
 
It would depend on whether the SPI driver for multiple SD cards can do DMA support to do things in parallel. My guess is it would need somebody motivated to go through all of the issues. You would need to grok the lower levels of the Teensy 4.x and the SPI drivers.
Gotcha. That sounds like it's over my head at this point.

You probably would get the best results by not using SD cards, but instead soldering a flash memory chip onto the Teensy 4.1, and using the SPIFFS filesystem.
I did read a bit about adding a flash chip. But I believe the maximum amount you can add is 16MB? I think I'd need a lot more for this project, in order to record several minutes each of 6 uncompressed audio streams. I could probably get by with 64MB if that were possible. But having comparatively limitless SD space would be ideal.
 
Bill's SdFat library might be able to give you the required sequential write speed. But it's quite a bit more complicated to use than the normal SD lib.

As for external RAM size, today 8MB chips are the largest available. I exchanged a few emails with ApMemory (the company who designed those chips) and they confirmed no plans exist for a larger QSPI PSRAM chip. So 2 chips for 16MB appears to be the largest memory size we'll probably ever have on Teensy 4.1.
 
Status
Not open for further replies.
Back
Top