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.
Somebody could advise how to setup 2 UARTs ( UART0, UART3 ) under TIRTOS? All examples available use UART0 only. UART0 will use printf as debugger console and UART3 will receive data from a GPS.
Thanks.
Sergio.
Hi Amit Ashara
Yes, I just did the following:
/*
* ======== uart3Fxn ========
* Task for this function is created statically. See the project's .cfg file.
*/
Void uart3Fxn(UArg arg0, UArg arg1)
{
UART_Handle uart3;
UART_Params uartParams;
printf("Opening uart3Fxn\n");
/* Create a UART with data processing off. */
UART_Params_init(&uartParams);
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readEcho = UART_ECHO_OFF;
uartParams.readReturnMode = UART_RETURN_NEWLINE;
uartParams.readTimeout = 2000; //2000 ms = 2s
uartParams.baudRate = 4800;
uart3 = UART_open(Board_UART3, &uartParams);
if (uart3 == NULL)
{
printf("Error opening the UART3\n");
Task_exit();
}
while(1)
{
memset(&buffer_RX , 0 , sizeof buffer_RX ); // clean receptor buffer
tamanho_mensagem = UART_read( uart3, buffer_RX, sizeof buffer_RX );
printf("GPS = %s", buffer_RX); // \n not necessary, since comes with message
}
}
So, UART0 is used for printf and UART3 for receiving messages from GPS.
All are working fine.
Thank you for your support.
Sergio