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.

MSPM0G3507: UART not working intermittently

Part Number: MSPM0G3507

Hi team,

I am facing a strange issue where the UART is not able to receive data.

 

I have two uart configured UART0 and UART2, both UART are able to transmit data but the receive is inconsistent.

 

Sometimes the UART0 is not working, UART2 is not working or both UART0 & UART2 are not working, but sometimes both are working and the system runs with no issue.

 

The behaviour is like sometime the register UARTx->CPU_INT.MIS is set to 0x400 (RXINT) but the routine is not called, and sometimes the register is not set also the routine is not called.

 

Please suggest how can this be fixed.

  • Hi Ankit,

    Could you check:

    • Whether UART RX interrupt is triggered (UART IIDX register shows pending RXINT interrupt)
    • Whether UART NVIC is enabled. 
    • Do you test on launchpad or on your own board, and what do you connect to UART pins.

    Best Regards,

    Pengfei

  • Hi,

    Here are some observations,

    When UART0 is not functioning the register UART0->CPU_INT.MIS has a value of 0x400 and UART0->CPU_INT.IIDX has a value of 0xB (screenshot attached).

    When UART2 is not functioning the register UART2->CPU_INT.MIS has a value of 0x0 and UART2->CPU_INT.IIDX has a value of 0x0.

    I confirmed that the UART NVIC is enabled (screenshot attached).

    Also, this is performed on custom board with MCU "MSPM0G3507SDGS28R" (28 pinouts).

    Additionally, I tested this with SYSOSC @32MHz and HFXT->SYSPLLCLK0 @80MHz, same behavior each time. The uart baud rate was always 115200.

  • Make sure you always read the RXDATA register (DL_UART_Main_receiveData()) in response to an RX interrupt. I see OVRERR (0x10) set in the RIS, so I suspect this is what has happened. My observation was that clearing the RX interrupt (DL_UART_clearInterruptStatus()) doesn't clear the "lock" on RXDATA.

    I've also seen your UART0 case (0x400 in MIS) after clearing the IRQ (NVIC_ClearPendingIRQ()) while it was Pending in the NVIC, though this is probably a much more rare thing.

  • My issue is that the Interrupt routine is not called on UART RX.

    How to call the Routine function when the UART0->CPU_INT.MIS is found to be set for receive (0x400)?

  • My suggestion was intended to avoid getting into this state in the first place (without really knowing how it happened).

    If you've lost a Pending (in the NVIC) IRQ, it won't be presented again. In another thread (here) I used OVRERR to deal with the condition, since Overruns are a side-effect.

    [Edit: The link wasn't very visible after all.]

  • Issue is resolved, thank you.