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.

RTOS/TM4C123GH6PM: Using UART.h with a uart module other than UART0.

Part Number: TM4C123GH6PM

Tool/software: TI-RTOS

Hello, I am trying to read a distance sensor output using UART within the TI RTOS environment. Is it possible to use the driver library (UART.h, BOARD_initUART) with a UART peripheral other than UART0? The pins for UART0 are not available. In this code I am trying to set using a different peripheral, and have changed the pins within the EK_TM4C123GXL file to use pd6 and pd7 for uart2, but I am not sure what to use for UART_open() index, as it only accepts a 0, or it gives an error. Any help would be appreciated. Thank you.

char dist[100];

void task_sonar_fxn(void)
{
    UART_Handle uartSonar;
    UART_Params uartParams;

    UART_Params_init(&uartParams);
    uartParams.baudRate = 9600;
    uartParams.readEcho = UART_ECHO_OFF;
    uartSonar = UART_open(2, &uartParams); //Issue is on this line.
    if (uartSonar == NULL) {
            System_abort("Error creating UART!");
       }
    UART_read(uartSonar, dist, 100);
}