I2C2+DMA1 and UART4+DMA1
Hi all,
I'm having some trouble getting DMA to service sequential uses of I2C+DMA transactions.
I can have the I2C+DMA initialize our demodulator, which involves some 12,000 reads and writes. (So, I2C+DMA works *very, very well* when it works.) I can then send some text out UART using DMA, which works. (I’ve also done a lot of testing of just UART+DMA, and it similarly works very, very well when it works.) But, when I go back and try another I2C+DMA transaction -- even with no UART+DMA going on -- it hangs as soon as I try to start the DMA. That is, the stream turns on, but never seems to actually do anything, and no interrupts are ever called for it.
I took some screenshots of the registers for DMA1 as I was doing this, and there was absolutely no difference between the registers -- especially for stream 4, which is UART TX -- between just before doing the first, successful I2C+DMA series (demodulator initialization) and the second, unsuccessful I2C+DMA series (demodulator status getting). The only thing that happened between them was some UART+DMA, which completed fully and turned off the stream. Like I said, the registers for the UART+DMA stream were identical both before doing any UART stuff and after it was all done. Even LISR and HISR flags were fully cleaned up by UART to try and be safe.
The only thing I can think of is some artifact of the UART+DMA that is causing the DMA’s arbiter to get hung up on servicing UART and preventing I2C from getting time to run.
My work's wonderful firewall is unfortunately blocking my computer from logging into this forum, so I'm doing this mostly on my phone. As such, I will get back to posting the specific setup of each peripheral and DMA in a bit. But in short, the DMAs are just set up in normal mode (not circular, since lengths change) and are not using the FIFOs (direct mode). Stream 2 services I2C RX, stream 4 services UART TX, and stream 7 services I2C TX.
Thanks!
