This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C5515 - Why is UART reset is required to start transmission in DMA mode ?

I have run the uart dma example provided in CSL and everything works.

When I tried to optimize the code, I noticed that in the example the UART_setup is called after the  DMA_start function.

When I tried multiple uart writes, I saw that although the UART_setup should be called only once during initialization, the transmission does not work if UART_setup  is not called after DMA_start . 

I found out that what triggers the transfer is the reset of the uart . When I add the following code after a call to DMA_start , everything wokrs :

hUart->uartRegs->PWREMU_MGMT = CSL_UART_PWREMU_MGMT_RESETVAL;

hUart->uartRegs->PWREMU_MGMT = 0x6001;

My question is why is this required ?

I am afraid it can cause problems if receiving data when initiating a transmmit.

Is there other way to start the transmission via DMA?

Thanks.

  • Writing a byte to the transmit register also triggers the transfer:

    hUart->uartRegs->THR

    So do I have to write the first byte manually to the THR, and then configure the DMA to transfer the rest ?

  • When the transmitter FIFO is empty, the UART sends an UTXEVT signal to the DMA controller. In response, the DMA controller refills the transmitter FIFO by way of the transmitter holdin register (THR). Aslo, an interrupt is generated when the transmitter FIFO is empty, and it is cleared when at least one byte is loaded into the FIFO. So, loading the THR should trigger a transfer.

    Regards.