AnsweredAssumed Answered

K21 UART4 RX with DMA problem

Question asked by Jim Yang on Jun 30, 2016
Latest reply on Jul 3, 2016 by Jim Yang


Hi,

 

I meet a problem on UART4 Rx with DMA. I tried to modify and build driver_examples\uart\edma_transfer in KSDK2.0.

The modifications as following:

pin_mux.c

CLOCK_EnableClock(kCLOCK_PortC);

PORT_SetPinMux(PORTC, 14U, kPORT_MuxAlt3);

PORT_SetPinMux(PORTC, 15U, kPORT_MuxAlt3);

uart_edma_transfer.c

#define DEMO_UART UART4

#define DEMO_UART_CLKSRC kCLOCK_BusClk

#define UART_TX_DMA_CHANNEL 6U

#define UART_RX_DMA_CHANNEL 7U

#define UART_TX_DMA_REQUEST kDmaRequestMux0UART4

#define UART_RX_DMA_REQUEST kDmaRequestMux0UART4

#define ECHO_BUFFER_LENGTH 8

 

The test result is: TX is OK, but RX always get same data, g_rxBuffer full fill with the first byte.

I found that when enter DMA IRQ handler first time, UART4 S1[RDRF] is set to 1, then DMA IRQ handler will be called endlessly and RDRF is keep 0.

 

I also test UART3, it is normal.

Any additional configs are needed for UART4?

 

Thanks!

 

Jim Yang

Outcomes