Hello,
I have setup USART DMA using the SDK and Config Tools on the LPC55S06-EVK board, and I'm trying to send something on FLEXCOMM1. I also have interrupts enabled so that I can feed RX bytes as they come in, which works great by checking kUSART_RxFifoNotEmptyFlag in FLEXCOMM1_IRQHandler().
However, once I send something on TX using DMA, it does send the data out but as soon as the data has finished sending the FLEXCOMM1_IRQHandler() is called constantly with the flag kUSART_TxIdleFlag. The loop causes other code to no longer being able to run.
I understand from the docs that USART_TransferSendDMA() sets up an interrupt that should notify that the transfer is complete, and I have a callback function setup for that aswell, however it never gets there since the FLEXCOMM1_IRQHandler() loop is stuck.
Inside the FLEXCOMM1_IRQHandler(), if I try to disable the interrupt like this once the flag kUSART_TxIdleFlag is reached:
USART_DisableInterrupts(USART1, kUSART_TxIdleInterruptEnable);
It stops the loop, but then additional DMA transfers stops working. It only works for the first one.
The reason I cannot also use DMA or non-blocking interrupt method for RX also is because I don't know the expected number of bytes that are incoming, I just want to get them directly with the interrupt. Sending should be non-blocking so I want to use DMA for that.
Any ideas on what I should do when TX transfer is complete to make the interrupt handler loop not get stuck without breaking additional DMA transfers? It's worth to also mention that I don't have any interrupts enabled for TX, but I'm guessing the DMA transfer enables some.