I am trying to eventually write a driver for SPI communications via uDMA between two TM4C129x processors. I have read through many of the forum posts here and the general recommendation was to get the uDMA_demo working first (over UART) and then change it to work with SPI as the configuration is similar.
I have the demo code working between two TM4C129x's but I am new to low level TIVA development and have a few questions.
1. With the demo code, uDMA is enabled in both the TX and RX directions. An interrupt is generated after each successful uDMA transfer. In the RX direction, the interrupt simply switches the ping pong buffer. In the TX direction, the interrupt signals that the transfer was done and a new one set up and the channel re-enabled so that there will be new data ready to go when the UART makes another request. Is this correct?
2. Assuming the above is true, how do we safely modify the TX buffer to send data out? IE, how do we ensure that the uDMA controller doesn't take a buffer that is partially full of data?
3. My application requires two processors to exchange data periodically (10x / second). I wanted to adapt the demo code for this purpose but am having trouble with the above question. I have read about initiating DMA request via SW but i'm not entirely sure on how to configure a peripheral (UART or SPI) for the SW DMA transfer. Do I keep the uDMA enabled in the TX direction when initiating the request via SW? Any help here would be greatly appreciated.
Thank you
Steve