SdFAT and Serial buffers on the Teensy 3.x series

Status
Not open for further replies.

Constantin

Well-known member
I have dumb question re: how well the SdFAT library co-exists with the Serial buffer. For example, can the Serial1 or Serial2 buffer fill up quietly in the background while SDFat is doing something in the foreground? (like wait for a volume to open up)

I vaguely remember SDFat using interrupts, ditto for the FIFO buffer on Serial1 and Serial2 that puts stuff into the RAM buffer, however. So does anyone have an idea how well they co-exist?

FWIW, the data transmission rates are relatively low (115.2kbps), the datagrams are under 100 bytes, and I intend to set aside 255 bytes of RAM for each Serial buffer (that is, if I figure out how).
 
I'd expect it to work with larger buffers and getting them emptied between an Sd waits - serialEvent() code is very handy for that to get data to local buffer each loop cycle. The Serial# FIFO's are independent hardware and their interrupts hopefully don't conflict in priority where the serial would get blocked transferring to the queue buffer .

I think you edit these in serial#.c - including priority I see there if it fails::
Code:
#define TX_BUFFER_SIZE     40 // number of outgoing bytes to buffer
#define RX_BUFFER_SIZE     64 // number of incoming bytes to buffer
#define IRQ_PRIORITY  64  // 0 = highest priority, 255 = lowest
 
Status
Not open for further replies.
Back
Top