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/MSP432E401Y: How to change UART_read read timeout

Part Number: MSP432E401Y

Tool/software: TI-RTOS

Dear Experts,

for a communication protocol I have to receive telegrams of very different length with very fast response times even in case of an error in transmission. I'm going to use the UART_read function in blocking mode. From the protocol definition I know how many characters I have to wait for, thus I can define a very tight receive timeout. Do I really have to close and open the UART object to set a new receive timeout?

  • I do not see why you would need to close then reopen to change the parameter readTimeout.   If you look in the UARTMSP432E4.c source file (C:\ti\simplelink_msp432e4_sdk_2_20_00_20\source\ti\drivers\uart) you can see that the timeout is restarted and closed with each api call.

    Have you tried the following...

        UART_Handle uart;
        UART_Params uartParams;
        UARTMSP432E4_Object           *object = uart->object;
    
    
        // main loop
    
            object->readTimeout = 200;  // your defined value(s)
            UART_read(uart, &input, 1)

    Chris

  • Hello Chris,

    thank you for your hint. Somewhere in the code there is a remark that the user should not alter the object, thus I had some concerns about touching it. But according to the driver code you are right.

    (Off topic: I worked intensively on the corresponding TivaC code, which sets the timeout only when opening the uart. Therefore I assumed the same to be true for TI Driver. Obviously the TI Driver code got some improvements ...)

**Attention** This is a public forum