Other Parts Discussed in Thread: HALCOGEN
Hello,
I am using DMA to read/write data over SCI on a TMS570LC4357. I am working with fixed-length messages, so I would like to line up the messages with the start of the DMA receive block to make it easier to copy data out of the buffer. When messages get out of sync with the receive block, I attempt to reset the DMA control packet to get things back in sync. This works most of the time, but sometimes my reset function does not work.
Per the note in section 20.2.4 in the TRM, I should be able to reset the control packet by writing to one of the values. As I understand, this should reset the destination address to the value in IDADDR, which would accomplish what I'm trying to do. However, sometimes DMA gets into a state where writing to the control packet does nothing to reset the destination address and it remains out of sync. It'll remain in this state anywhere from a few seconds to a few minutes, but eventually it will reset properly and resynchronize.
I have tried:
1. Simply overwriting the IDADDR value in the control packet.
2. Disabling the DMA channel, writing IDADDR to a different value, restoring the correct IDADDR value, then enabling the DMA channel.
3. Disabling the DMA channel, rewriting all DMA control packet values, then enabling the DMA channel.
4. Polling DMASTAT before running #2.
5. Putting DMA FIFOs in bypass mode.
6. Both running this as the sole DMA channel in operation and running multiple DMA channels.
I found these similar threads, but these suggestions did not work:
e2e.ti.com/.../resetting-of-dma
e2e.ti.com/.../expected-dma-behavior-after-resetting-dma
e2e.ti.com/.../tms570-reset-dma-with-dma-btc-interrupt
Everything I have tried shows the behavior described above. If I comment out the write to IDADDR and get it out of sync, then the receive never resynchronizes. That leads me to think resync is working most of the time, and something else is preventing the control packet from resetting.
Thanks,
David