Hi,
I am trying to configure UART1 with the DMA controller enabled. Everything works fine when DMA controller is set as flow controller, but I cannot get the thing working when UART1 peripheral is set as the flow controller.
According to the UM, in DMA mode the receiver DMA is asserted on the event of the receiver FIFO level becoming equal to or grater than trigger level, or if a character timeout occours.
Is there any working example that show how to configure UART with DMA, using the peripheral as the flow controller?
The flow controller is the one who knows that the whole DMA transaction is over. However, most peripherals (including UART) cannot act as flow controller, because they cannot count the number of transfers done. So I see no reason to make UART1 the flow controller.
The concept of flow control is different from the peripheral request which triggers a transfer! In your case selecting peripheral-to-memory (DMA control) will let the UART request transfers whenever the FIFO reached the trigger level (burst request) or whenever a timeout occurs (single request). Since the DMA is the flow controller, it will stop the transaction and disable the DMA channel once the programmed number of transfers (i.e. UART characters) has been transferred.