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/MSP432E411Y: UARTMSP432E4_write - How to know about timeout

Part Number: MSP432E411Y

Tool/software: TI-RTOS

Dear TI-Experts,

how can I find out if UARTMSP432E4_write ran into timeout?

  • I do not believe that the way the API is written you can discern that a timeout occurred.  

        /* If writeMode is blocking, block and get the state. */
        if (object->state.writeMode == UART_MODE_BLOCKING) {
            /* Pend on semaphore and wait for Hwi to finish. */
            if (SemaphoreP_pend(object->writeSem, object->writeTimeout) !=
                    SemaphoreP_OK) {
                /* Semaphore timed out, make the write empty and log the write. */
                UARTIntDisable(hwAttrs->baseAddr, UART_INT_TX);
                UARTIntClear(hwAttrs->baseAddr, UART_INT_TX);
                object->writeCount = 0;
            }
            return ((int_fast32_t)(object->writeSize - object->writeCount));
        }

    Since the writeCount is set to zero when a timeout occurs and the writeCount is decremented to '0' and then a semaphore is posted the return value is the same.  I believe this is not intended but will verify.

    Regards,

    Chris

  • I have filed a bug against the driver to have this addressed.

    Thanks and Regards,
    Chris

**Attention** This is a public forum