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: Problem that UART Receive Status cannot be get from UARTRSR

Expert 1685 points
Part Number: MSP432E401Y

Hi,

I have a question about UART interrupts.

UART interrupt occurred and the UARTRSR was checked during interrupt processing. It is set to 0x000080 (FEMIS bit is set), and I know that UART interrupt has occurred due to a framing error.

After that, I cleared Framing Error Interrupt with UARTICR.

I finally got the value of UARTRSR, but I got 0x00000000.

Is this the correct behavior?

(I assumed that the FE bit would be set at 0x00000001 because interrupt occurred due to a framing error.)

Thanks,

Koki

  • Hi, 

    I think the clear action can be done by write anything to UARTRSR/UARTECR or a new data coming in. Please check if you have such actions during it. 

  • Hi, Li

    I think the clear action can be done by write anything to UARTRSR/UARTECR or a new data coming in. Please check if you have such actions during it. 

    ① Clear FE with UARTECR

    ② A new data coming

    If I have not done both ① and ②, will the value of UARTRSR be 0x00000001 (FE is set)?

    Currently, the value of UARTRSR is 0x00000000.

    (I know I have not done about ①)

    Thanks,

    Koki

  • Yes, it should be 0x00000001. But when the interrupt genetaed, the SR value is correct, Right? So the interrupt clear may clear the SR by your test. I will check it later. 

  • Hi, Li

     

    As you say, I got the value of UARTRSR before clearing UARTICR.

    But the situation was the same, the value of UARTRSR was 0x00000000.

    (The value of the UARTMIS register is 0x00000280)

     

    The following is the source code of the part that is confirmed by interrupt.

    uart_interrupt check.c
    void Uart_InterruptPeripheral(void)
    {
    	uint32	ui32IntStatus;					// interrupt status
    	uint8	ui8IntFlags = 0x00U;			// interrupt flag
    	uint32	ui32UartError = 0x00000000U;	// get UART Error
    	uint8	ui8UartError = 0x00U;			// UART Error
    
    	// Get interrupt factors (UARTMIS register)
    	ui32IntStatus = UARTIntStatus(UART2_BASE, UART_REGISTER_UARTMIS);
    	
    	// UART error interrupt judgment
    	if (((ui32IntStatus & (uint32)UART_RIS_OERIS) == (uint32)UART_RIS_OERIS) ||		// UART Overrun Error Raw Interrupt Status
    		((ui32IntStatus & (uint32)UART_RIS_BERIS) == (uint32)UART_RIS_BERIS) ||		// UART Break Error Raw Interrupt Status
    		((ui32IntStatus & (uint32)UART_RIS_PERIS) == (uint32)UART_RIS_PERIS) ||		// UART Parity Error Raw Interrupt Status
    		((ui32IntStatus & (uint32)UART_RIS_FERIS) == (uint32)UART_RIS_FERIS))		// UART Framing Error Raw Interrupt Status
    	{
    		// UART error interrupt flag ON
    		ui8RetIntFlags |= 0x01;
    	}
    	else {
    		// Do Nothing
    	}
    
    
    	// Clear interrupt factors 
    	UARTIntClear(UART2_BASE, ui32IntStatus);
    	
    	// UART error interrupt
    	if ((ui8IntFlags & 0x01) == 0x01) {
    		// Get UART Error
    		ui32UartError = UARTRxErrorGet(UART2_BASE);
    		// UART Overrun Error judgement
    		if ((ui32UartError & (uint32)UART_RXERROR_OVERRUN) == (uint32)UART_RXERROR_OVERRUN) {
    			// UART Overrun Error setting
    			ui8UartError |= 0x01U;
    		}
    		else {
    			// Do Nothing
    		}
    
    		// UART Break Error judgement
    		if ((ui32UartError & (uint32)UART_RXERROR_BREAK) == (uint32)UART_RXERROR_BREAK) {
    			// UART Break Error setting
    			ui8UartError |= 0x02U;
    		}
    		else {
    			// Do Nothing
    		}
    
    		// UART Parity Error judgement
    		if ((ui32UartError & (uint32)UART_RXERROR_PARITY) == (uint32)UART_RXERROR_PARITY) {
    			// UART Parity Error setting
    			ui8UartError |= 0x04U;
    		}
    		else {
    			// Do Nothing
    		}
    		// UART Framing Error judgement
    		if ((ui32UartError & (uint32)UART_RXERROR_FRAMING) == (uint32)UART_RXERROR_FRAMING) {
    			// UART Framing Error setting
    			ui8UartError |= 0x08U;
    		}
    		else {
    			// Do Nothing
    		}
    		// UART Error clear
    		UARTRxErrorClear(UART2_BASE);
    	}
    }
    

    Please continue to check.

     

    Thanks,

    Koki

  • Hi, Li

    Do you have any update?

    Koki

  • Hi, 

    I cannot find any issue with your code. Please check the registers at the interrupt entry (set a breakpoint). If the register is 0, please check if the error was generated. If it is not 0, please check which line caused to be cleared. And we can address the situation by the method.

  • Hi, Li

    . If it is not 0, please check which line caused to be cleared. And we can address the situation by the method.

    The operation results are summarized in the Excel.

    Result.xlsx
    As a result, when a UART error occurred and stopped at a breakpoint, the correct value was set in UARTRSR, but it was cleared by step execution.

    Thanks,

    Koki

  • Hi,

    Do you have any update?

    Thanks,

  • Hi, Koki,

    It seems that when you read the SR, it will be cleared autometically. I will check the drivelib and core. Please wait for a while.  

  • Hi, Li

    If you have any update, please let me know.

    Thanks,

    Koki

  • Hi,

    Do you have any update?

    Thanks,

  • Hi Koki

    Due to Hawken has leave TI now, I will keep follow this issue now. Here are some questions here

    What's the register is with the value 0x000080 you have mentioned below?

    It is set to 0x000080 (FEMIS bit is set)

    Could you help to introduce how do you configure the UART? Like have you enable parity check, how many stop bit do you use, what's the baud rate?

    Please capture the waves that I can help you to check if the correct condition it is.

  • Hi, Gary

    Due to Hawken has leave TI now, I will keep follow this issue now. Here are some questions here

    OK, It takes a long time to answer this form, so please respond as soon as possible.

     

    I would like to know the driver library specifications mentioned below.

    The operation results are summarized in the Excel.

    Result.xlsx
    As a result, when a UART error occurred and stopped at a breakpoint, the correct value was set in UARTRSR, but it was cleared by step execution.

    It seems that when you read the SR, it will be cleared autometically. I will check the drivelib and core. Please wait for a while.  

    Please take over to Hawken and investigate and tell us the specifications of the driver library.

     

    The contents I would like you to investigate are as follows.

    Whether the specifications are such that when OE to FE (Bit11 to Bit8) of UARTDR is rewritten, it is reflected in UARTRSR and cleared.

    Please see the Excel file for details.

    Thanks,

    Koki

  • Hi Koki

    It is better to show could you help to introduce how do you configure the UART? Like have you enable parity check, how many stop bit do you use, what's the baud rate?

    Please capture the waves that I can help you to check if the correct condition it is