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.

MCU-PLUS-SDK-AM243X: UART Interrupt triggered repeatedly after debug break

Part Number: MCU-PLUS-SDK-AM243X


We are using UART in Interrupt Mode, while this is running and actively communicating and we suspend the execution of the program in debug mode for some time.

Then continue execution, the UART interrupt starts to trigger repeatedly and never lets the normal code continue even when no data are present.

In the interrupt the UART_getIntrIdentityStatus() returns UART_INTID_CHAR_TIMEOUT and UART_getChar() returns false.

Any idea what could be the cause?

  • Update: it is not UART_INTID_CHAR_TIMEOUT but UART_INTID_RX_LINE_STAT_ERROR triggering the interrupt, the bit shift in defines confused me.
    And UART_readLineStatus() returns 224 (0xE0)

  • Hi Jan,

    I'll be looking into this issue and will come back before 5th September. Can you please share me your project that is causing this issue? Also, how are you interfacing your UART lines? Is it connected to someother MCU or device is sending some data over the UART lines?

    I suspect that, when the debug is halted, the incoming characters on the RX lines must still fill-up the buffer, once the debug is resumed these characters might be triggering the interrupt multiple time thereby causing the issue reported. Please provide me above info so that we can proceed forward with the debug. 

  • Hi Kowshik,

    Unfortunately I cannot share the project,

    UART is connected to L6362A for IO-Link communication. The issue appears when debugging while IO-Link is in operation.

    In our code we have no handling for UART_INTID_RX_LINE_STAT_ERROR so far, it just tried UART_getChar as normally.
    When we disable UART_INTR_LINE_STAT in UART_intrEnable, it seems to continue the code without issue, even resumes communication trough IO-link.

    Simplified interrupt callback code:

    void uart_master_isr(void *args)
    {
        UART_Config *p_cfg = args;
        uint32_t base_addr = p_cfg->attrs->baseAddr;
        uint32_t irq;
        uint8_t rd_data;
        
        while ((Bool)TRUE) {
            irq = UART_getIntrIdentityStatus(base_addr);
            
            if ((irq & UART_INTID_RX_THRES_REACH) == UART_INTID_RX_THRES_REACH) {
                if (UART_getChar(base_addr, &rd_data) == TRUE) {
                    ...
                }
            } else {
                break;
            }
        }
    }

    We had enabled those two interrupts:

    UART_intrEnable(base_addr, UART_INTR_LINE_STAT | UART_INTR_RHR_CTI);
    

  • Hi @Jan

    I guess it's better to include the handling for the RX_LINE_STAT_ERROR too. If you refer to the MCU+SDK driver uart_v2.c, you see that the UART_ProcLineStatusErr function handles it. 

    In short, this function simply flushes the RX FIFO buffer with erroneous data, disables the following interrupts, reconstructs the buffer. 

    Try implementing the MCU+SDK driver code for this error handling and let us know if need any more info.