lpcware

uart dma example rework

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by dragilla on Sat Nov 19 02:53:24 MST 2011
Hey,
I'm trying to read data from gps on uart0 and resend it on uart1.
I'm using the uart_dma_test.c (from lpc17xx.cmsis.driver.library.zip) as my base.

I can do a simple loop reading and prinint data from gps. There data is of course incomplete because its is not buffered:

while(1) {
        len = 0;
        while (len == 0)
        {
            len = UART_Receive(LPC_UART0, buffer, sizeof(buffer), NONE_BLOCKING);
        }
        UART_Send(LPC_UART1, buffer, sizeof(buffer), BLOCKING);
}
So I know that both uart0 and uart1 are set up correctly. I can see the data showing up on my console.

Now I add uart1 to the uard_dma_test, change the uart_send port to uart1... and...
it doesn't send :/
I mean I can see it calling the UART_Send function and it's calling it with the gps data, but I don't see the output on the console.
I traced the uart send down to line

((LPC_UART1_TypeDef *)UARTx)->/*RBTHDLR.*/THR = Data & UART_THR_MASKBIT;
in lpc17xx_uart.c

Attached is my code.
Plaease help me to find the reason.

Outcomes