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.

TM4C1294NCPDT with 2 UARTs under TIRTOS

Other Parts Discussed in Thread: TM4C1294NCPDT

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.

  • Hello Sergio,

    The same example of using UART0 can be used to create a second UART port initialization and data handling.

    Regards
    Amit
  • Hi Amit Ashara

    I am using TM4C1294NCPDT processor.

    In UARTConsole example for TM4C1294NCPDT, the UARTUtils.c module is prepared for UART0 only. For example, in openHandle() routine, there is a warning that is limited to UART0 only and, in fact, the routine doesn't support a list of parameters for another uart.

    Of course, I can modify all routines necessary, but I wonder that there are tons of applications using more than 1 uart and hope that there is an example for 2 or more uarts under TIRTOS for this processor.

    Could you send a such example or a specific instruction on how to setup the TIRTOS environment to support multiple uarts?

    Thanks in advance.

    Sergio
  • Hello Sergio,

    Normally I would go and create the routine using the lower TivaWare functions for any other UART other than the one which drives console

    Regards
    Amit
  • 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