non-blocking read from sd card on Teensy 4.1 ?

Interesting and challenging I would imagine.
In the latest version of Teensyduino, Paul has sped up SdFat.
After a bit of work weaning off of SD.h, I am hesitant to dive
into learning how to do DMA from SdFat.

Is there some access to this technology like a library?

thanks,

Richie
 
The SD card for Teensy 4.1 is over the SDIO interface on LPSPI1. Each SPI port has a 16 word FIFO buffer. You can configure this to trigger an interrupt when it receives data. This interrupt can then be used to initiate a DMA transfer from the buffer to wherever. I think when this DMA is complete, it can send a trigger back to the SPI bus to transfer more data, independent of the main processor.

There is a DMA library that might be able to help with the DMA side of things.

Also, the manual is a great source of information, but it's long and complicated: https://www.pjrc.com/teensy/IMXRT1060RM_rev2.pdf

Something things you might want to look at:
Receive Data Interrupt Enable
48.3.5.1 Output Triggers
Interrupt IRQ 32
Receive Data DMA Enable

It won't be easy probably. Good luck.
 
Back
Top