You set the TD_AUTO_EXEC_NEXT bit for the 1st and 2nd TDs. This bit is used to trigger the next TD automatically. Following is the description in the DMA datasheet.
When 1st byte is received from the SPI master, the 1st TD reads the received value and writes it to the buffer. After that the 2nd TD will be executed without waiting for receiving the 2nd byte. So, the SPI's DATA register is read and stored into the buffer.
If you want to execute one DMA transfer for an SPI byte, the flag should not be set for both TDs.
Thanks for the help. I am almost there.
So if I want it to fill one buffer, then the next buffer, then return to the first buffer, continuously, which TD should the flag be set for?
Is it possible for it to refill a single buffer over and over forever without restarting the DMA request?
What I'm trying to do here is have a really large FIFO buffer that I can read separately. I am using a counter on the IRQ line to count how many bytes have been received.
It looks like it works correctly if I remove the NEXT flag from both TDs