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.

MSP432E401Y: UART driver library specifications

Guru 12065 points
Part Number: MSP432E401Y

Hi, 

I have a question about the UART driver library.

In the receive interrupt, the interrupt factor is cleared and the UART Error is acquired as described below.

 

// Clear interrupt factor
UARTIntClear (m_ui32UartModule [enPortId], ui32IntStatus);

// Get UART Error
ui32UartError = UARTRxErrorGet (m_ui32UartModule [enPortId]);

 

After clearing the interrupt factor, when trying to get a UART error, the UARTRSR value was read as 0x00.

(Originally, 0x01 should be read by the value of UARTRSR, but it has probably been cleared by UARTIntClear)

Is it a specification that UARTRSR is cleared at the same time when the interrupt factor is cleared?

When I set the breakpoint with UARTIntClear () and checked the value of UARTRSR, I got 0x01 (before it was cleared).

Thanks,

Koki

  • Is it a specification that UARTRSR is cleared at the same time when the interrupt factor is cleared?

    In simplelink_msp432e4_sdk_4_20_00_12/source/ti/devices/msp432e4/driverlib/uart.c the UARTIntClear() function simply writes to the UART Interrupt Clear (UARTICR) register.

    From MSP432E4 SimpleLinkTm Microcontrollers Technical Reference Manual (Rev. A) I can't see any indication that writing to the UARTICR register will clear the flags in the UARTRSR registers.

    I haven't yet attempted to repeat your observation. Does your code enable the FIFOs in the UART?

  • Hi, 

    I haven't yet attempted to repeat your observation. Does your code enable the FIFOs in the UART?

    Yes, the FIFO settings are enabled.

     

    In addition, the timing when the specific UARTRSR is cleared is summarized in an Excel file.

     Result .xlsx

    Please continue to check the specifications of DriverLib.

    Thanks,

    Koki

  • In addition, the timing when the specific UARTRSR is cleared is summarized in an Excel file.

    The Excel sheet shows is after the step execution that the RSR register value clears:

    After the step execution occurs, the value of the DR register also changes from 0x500 which has the BE Break Error and FE Framing Error bits set to 0 (no errors).

    The description of the UARTRSR/UARTECR Register contains:

    In addition to the UARTDR register, receive status can also be read from the UARTRSR register. If the status is read from this register, then the status information corresponds to the entry read from UARTDR prior to reading UARTRSR.

    The UARTDR register is read-sensitive, in that a read of UARTDR removes an entry from the receive FIFO.

    Therefore, think the issue is that because the debugger (Keil µVision?) is set to display the value of the UARTDR register, is that after the step the debugger read of the UARTDR register pops an entry from the receive FIFO which then changes the value reported for the UARTRSR register.

    Does the program operate correctly it you don't have the debugger displaying the value of the UARTDR register?

  • Hi Koki

    Have you capture the wave there to see if there is really error there?

  • Hi, 

    Does the program operate correctly it you don't have the debugger displaying the value of the UARTDR register?

    I stored the UARTRSR and UARTMIS values in variables and checked the register values without a debugger. The source code is below.

    ===================================================================

    void Uart_Interrupt ()

    {

    uint32 ui32IntStatus;

    int32 ui32UartError = 0;

    ui32IntStatus = UARTIntStatus(UART2_BASE, UART_REGISTER_UARTMIS);

    if (((ui32IntStatus & (uint32)UART_RIS_OERIS) == (uint32)UART_RIS_OERIS) ||

                 ((ui32IntStatus & (uint32)UART_RIS_BERIS) == (uint32)UART_RIS_BERIS) ||

                 ((ui32IntStatus & (uint32)UART_RIS_PERIS) == (uint32)UART_RIS_PERIS) ||

                 ((ui32IntStatus & (uint32)UART_RIS_FERIS) == (uint32)UART_RIS_FERIS))

                  {

                      ui32UartError = UARTRxErrorGet(UART2_BASE);

                  }

                                :

                                :

    ====================================================================

    The result was as follows after the UART Framing error was generated.

    ui32UartError = 0x00000000
    ui32IntStatus = 0x00000280

    From the above results, the value read by the UARTRSR register has changed with no debugger connected.

    It seems that the value read by the UARTRSR register has changed even when the UARTDR is not displayed by the debugger.

    Please continue to check.

    Thanks,

    Koki

  • Do you have any update?

  • Do you have any update?

  • Hi Koki

    Could you help to use UARTRxErrorGet() before UARTIntStatus()?