Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Multiple SD cards with Teensy 4.1

  1. #1
    Junior Member
    Join Date
    Jul 2020
    Location
    The Road
    Posts
    8

    Multiple SD cards with Teensy 4.1

    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 by even_rats; 07-30-2020 at 06:11 PM.

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,887
    Quote Originally Posted by even_rats View Post
    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.

  3. #3
    Junior Member
    Join Date
    Jul 2020
    Location
    The Road
    Posts
    8
    Quote Originally Posted by MichaelMeissner View Post
    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.

    Quote Originally Posted by MichaelMeissner View Post
    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.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,061
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •