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.

UART4 interrupts keep firing for Lauchpad EK-TM4C1234GXL

Other Parts Discussed in Thread: EK-TM4C123GXL

HI, 

I'm trying to communicate the EK-TM4C123GXL with a bluetooth module through UART.

I take the uart_echo example and expand it to use UART0 to display info and UART4 to do the actual work. 

I'm able to send command and get correct response to show up in the scope. 

But the interrupt handler for UART4 seems to keep firing indefinitely. Here is part of my code: 

//*****************************************************************************
//
// The UART interrupt handlers.
//
//*****************************************************************************
void
UARTIntHandler0(void)
{
    uint32_t ui32Status;

    //
    // Get the interrrupt status.
    //
    ui32Status = ROM_UARTIntStatus(UART0_BASE, true);

    //
    // Clear the asserted interrupts.
    //
    ROM_UARTIntClear(UART0_BASE, ui32Status);

    //
    // Loop while there are characters in the receive FIFO.
    //
    while(ROM_UARTCharsAvail(UART0_BASE))
    {
        //
        // Read the next character from the UART and write it back to the UART.
        //
        char ch = ROM_UARTCharGetNonBlocking(UART0_BASE);
        ROM_UARTCharPutNonBlocking(UART0_BASE, ch);

        if (ch=='1') {
            GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, RED_LED);
        }
        else if (ch=='2') {
            GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, 0);
        }
        else if (ch=='3') {
        	//ble_cmd_system_hello();
        	UART4Send((uint8_t *)"\4\0\0\0\1",5);
                //blink the LED
           	GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, GREEN_LED);
                SysCtlDelay(SysCtlClockGet() / (1000 * 3));
                GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, 0);
        }
    }
}

void
UARTIntHandler4(void)
{

	uint32_t ui32Status;

	//
	// Get the interrrupt status.
	//
	ui32Status = ROM_UARTIntStatus(UART4_BASE, true);

	//
	// Clear the asserted interrupts.
	//
	ROM_UARTIntClear(UART4_BASE, ui32Status);
        // Show that some respnoses are received
	UART0Send((uint8_t *)"h",1);

}


//*****************************************************************************
//
// This example demonstrates how to send a string of data to the UART.
//
//*****************************************************************************
int
main(void)
{
    //
    // Enable lazy stacking for interrupt handlers.  This allows floating-point
    // instructions to be used within interrupt handlers, but at the expense of
    // extra stack usage.
    //
    FPUEnable();
    FPULazyStackingEnable();

    //
    // Set the clocking to run directly from the crystal.
    //
    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                       SYSCTL_XTAL_16MHZ);

    //
    // Enable the GPIO port that is used for the on-board LED.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

    //
    // Enable the GPIO pins for the LED (PF2).
    //
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED);

    //
    // Enable the peripherals used by this example.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART4);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);

    //
    // Enable processor interrupts.
    //
    IntMasterEnable();

    //
    // Set GPIO A0 and A1 as UART pins.
    //
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);
    GPIOPinConfigure(GPIO_PC4_U4RX);
    GPIOPinConfigure(GPIO_PC5_U4TX);
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5);

    //
    // Configure the UART for 115,200, 8-N-1 operation.
    //
    UARTConfigSetExpClk(UART0_BASE, ROM_SysCtlClockGet(), 115200,
                            (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                             UART_CONFIG_PAR_NONE));
    UARTConfigSetExpClk(UART4_BASE, ROM_SysCtlClockGet(), 115200,
                                (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                                 UART_CONFIG_PAR_NONE));
    UARTFlowControlSet(UART4_BASE, UART_FLOWCONTROL_NONE);
    //
    // Enable the UART interrupt.
    //
    IntEnable(INT_UART0);
    UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
    IntEnable(INT_UART4);
    UARTIntEnable(UART4_BASE, UART_INT_RX | UART_INT_RT);
    ROM_UARTEnable(UART4_BASE);

    //
    // Prompt for text to be entered.
    //
    UART0Send((uint8_t *)"\033[2JEnter text: ", 16);

    //
    // Loop forever echoing data through the UART.
    //
    while(1)
    {
    }
}

Thanks,

  • Hi Hao,

        Have you setup your UARTIntHandler4() at your startup file?

    -kel

  • Beyond Uart4's proper entry w/in start-up file - how have you insured that PC4 (UART_RX) remains @ logic "high" during both the "pre & post" data reception periods?  (it is the high to low transition @ PC4 which invokes UART4 interrupt)

    Suspect that your RF module must tie to and drive PC4.  Is that RF Module properly tied to the MCU's ground?  Does that RF Module either "pull-up" to MCU's Vcc or output logic "high" in absence of valid data reception?  How do you know - have you measured?  If you're lucky - simple addition of 4K7 - 10K pull-up R to PC4 may resolve.

    And - always wise to "co-power" the RF Module and your MCU board - so that both power up/down together.  This joint power may "over-stress" an inadequate board/module power supply - you must maintain Vcc for the MCU at all times during operation.

  • Here is part of my startup_ccs.c. I think I should have it right. 

    void (* const g_pfnVectors[])(void) =
    {
        (void (*)(void))((uint32_t)&__STACK_TOP),
                                                // The initial stack pointer
        ResetISR,                               // The reset handler
        NmiSR,                                  // The NMI handler
        FaultISR,                               // The hard fault handler
        IntDefaultHandler,                      // The MPU fault handler
        IntDefaultHandler,                      // The bus fault handler
        IntDefaultHandler,                      // The usage fault handler
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // SVCall handler
        IntDefaultHandler,                      // Debug monitor handler
        0,                                      // Reserved
        IntDefaultHandler,                      // The PendSV handler
        IntDefaultHandler,                      // The SysTick handler
        IntDefaultHandler,                      // GPIO Port A
        IntDefaultHandler,                      // GPIO Port B
        IntDefaultHandler,                      // GPIO Port C
        IntDefaultHandler,                      // GPIO Port D
        IntDefaultHandler,                      // GPIO Port E
        UARTIntHandler0,                         // UART0 Rx and Tx
        IntDefaultHandler,                      // UART1 Rx and Tx
        IntDefaultHandler,                      // SSI0 Rx and Tx
        IntDefaultHandler,                      // I2C0 Master and Slave
        IntDefaultHandler,                      // PWM Fault
        IntDefaultHandler,                      // PWM Generator 0
        IntDefaultHandler,                      // PWM Generator 1
        IntDefaultHandler,                      // PWM Generator 2
        IntDefaultHandler,                      // Quadrature Encoder 0
        IntDefaultHandler,                      // ADC Sequence 0
        IntDefaultHandler,                      // ADC Sequence 1
        IntDefaultHandler,                      // ADC Sequence 2
        IntDefaultHandler,                      // ADC Sequence 3
        IntDefaultHandler,                      // Watchdog timer
        IntDefaultHandler,                      // Timer 0 subtimer A
        IntDefaultHandler,                      // Timer 0 subtimer B
        IntDefaultHandler,                      // Timer 1 subtimer A
        IntDefaultHandler,                      // Timer 1 subtimer B
        IntDefaultHandler,                      // Timer 2 subtimer A
        IntDefaultHandler,                      // Timer 2 subtimer B
        IntDefaultHandler,                      // Analog Comparator 0
        IntDefaultHandler,                      // Analog Comparator 1
        IntDefaultHandler,                      // Analog Comparator 2
        IntDefaultHandler,                      // System Control (PLL, OSC, BO)
        IntDefaultHandler,                      // FLASH Control
        IntDefaultHandler,                      // GPIO Port F
        IntDefaultHandler,                      // GPIO Port G
        IntDefaultHandler,                      // GPIO Port H
        IntDefaultHandler,                      // UART2 Rx and Tx
        IntDefaultHandler,                      // SSI1 Rx and Tx
        IntDefaultHandler,                      // Timer 3 subtimer A
        IntDefaultHandler,                      // Timer 3 subtimer B
        IntDefaultHandler,                      // I2C1 Master and Slave
        IntDefaultHandler,                      // Quadrature Encoder 1
        IntDefaultHandler,                      // CAN0
        IntDefaultHandler,                      // CAN1
        IntDefaultHandler,                      // CAN2
        0,                                      // Reserved
        IntDefaultHandler,                      // Hibernate
        IntDefaultHandler,                      // USB0
        IntDefaultHandler,                      // PWM Generator 3
        IntDefaultHandler,                      // uDMA Software Transfer
        IntDefaultHandler,                      // uDMA Error
        IntDefaultHandler,                      // ADC1 Sequence 0
        IntDefaultHandler,                      // ADC1 Sequence 1
        IntDefaultHandler,                      // ADC1 Sequence 2
        IntDefaultHandler,                      // ADC1 Sequence 3
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // GPIO Port J
        IntDefaultHandler,                      // GPIO Port K
        IntDefaultHandler,                      // GPIO Port L
        IntDefaultHandler,                      // SSI2 Rx and Tx
        IntDefaultHandler,                      // SSI3 Rx and Tx
        IntDefaultHandler,                      // UART3 Rx and Tx
        UARTIntHandler4,                      // UART4 Rx and Tx
        IntDefaultHandler,                      // UART5 Rx and Tx
        IntDefaultHandler,                      // UART6 Rx and Tx
        IntDefaultHandler,                      // UART7 Rx and Tx
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // I2C2 Master and Slave
        IntDefaultHandler,                      // I2C3 Master and Slave
        IntDefaultHandler,                      // Timer 4 subtimer A
        IntDefaultHandler,                      // Timer 4 subtimer B
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // Timer 5 subtimer A
        IntDefaultHandler,                      // Timer 5 subtimer B
        IntDefaultHandler,                      // Wide Timer 0 subtimer A
        IntDefaultHandler,                      // Wide Timer 0 subtimer B
        IntDefaultHandler,                      // Wide Timer 1 subtimer A
        IntDefaultHandler,                      // Wide Timer 1 subtimer B
        IntDefaultHandler,                      // Wide Timer 2 subtimer A
        IntDefaultHandler,                      // Wide Timer 2 subtimer B
        IntDefaultHandler,                      // Wide Timer 3 subtimer A
        IntDefaultHandler,                      // Wide Timer 3 subtimer B
        IntDefaultHandler,                      // Wide Timer 4 subtimer A
        IntDefaultHandler,                      // Wide Timer 4 subtimer B
        IntDefaultHandler,                      // Wide Timer 5 subtimer A
        IntDefaultHandler,                      // Wide Timer 5 subtimer B
        IntDefaultHandler,                      // FPU
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // I2C4 Master and Slave
        IntDefaultHandler,                      // I2C5 Master and Slave
        IntDefaultHandler,                      // GPIO Port M
        IntDefaultHandler,                      // GPIO Port N
        IntDefaultHandler,                      // Quadrature Encoder 2
        0,                                      // Reserved
        0,                                      // Reserved
        IntDefaultHandler,                      // GPIO Port P (Summary or P0)
        IntDefaultHandler,                      // GPIO Port P1
        IntDefaultHandler,                      // GPIO Port P2
        IntDefaultHandler,                      // GPIO Port P3
        IntDefaultHandler,                      // GPIO Port P4
        IntDefaultHandler,                      // GPIO Port P5
        IntDefaultHandler,                      // GPIO Port P6
        IntDefaultHandler,                      // GPIO Port P7
        IntDefaultHandler,                      // GPIO Port Q (Summary or Q0)
        IntDefaultHandler,                      // GPIO Port Q1
        IntDefaultHandler,                      // GPIO Port Q2
        IntDefaultHandler,                      // GPIO Port Q3
        IntDefaultHandler,                      // GPIO Port Q4
        IntDefaultHandler,                      // GPIO Port Q5
        IntDefaultHandler,                      // GPIO Port Q6
        IntDefaultHandler,                      // GPIO Port Q7
        IntDefaultHandler,                      // GPIO Port R
        IntDefaultHandler,                      // GPIO Port S
        IntDefaultHandler,                      // PWM 1 Generator 0
        IntDefaultHandler,                      // PWM 1 Generator 1
        IntDefaultHandler,                      // PWM 1 Generator 2
        IntDefaultHandler,                      // PWM 1 Generator 3
        IntDefaultHandler                       // PWM 1 Fault
    };
    
  • In the "UARTIntHandler0()" I notice a delay of at least 1 second, for blinking the led. If the interrupt priorities are equal (which seems to be the case here as the code is not explicitly setting priorities, hence default priorities), "UARTIntHandler4()" would be executed only after exiting "UARTIntHandler0()", that is at least after 1 second.

    This may or may not be a reason for what you report but it is not advisable to wait in an interrupt handler. A better approach is to raise a flag in the interrupt handler and handle the LED blinking in the main code.

    Hope this helps!

    Regards,
    Sai
  • Hi cb1,

    After checking with the scope, I think the voltage are at correct levels, and the ground are connected. 

    I also tried to use polling to access UART4, it receives correct response. 

    Hao

  • @ Hao,

    To aid myself/others to best assist:

    a) Are you saying that UART4_RX pin is at logic "high" (> 0.7 Vdd) both before and after any UART4 activity?  You must use a scope to check this - narrow pulses too often will not be detected by a DMM.

    b) If (a) above is true - can you temporarily remove the connection from your RF link to UART4_RX?  Suggest that you add a pull-up R (4K7 - 10K) and tie to UART4_RX and 3V3.  After that installation - repower your board and observe if UART4 continues to "fire."  (it should not)

    c) As earlier helper (Sheldon I believe) stated - your interrupt should be short/sweet - no delays should occur w/in an interrupt.  And - you should clear the interrupt - fully/completely - w/in your interrupt handler - and very near the top of that handler.  Have you done this?

    d) Always wise to check again - insure that no other signals or board routings contact UART4_RX.  (these may cause your unwanted interrupt triggering)

    e) Kindly present your test results - w/as much detail as possible - & we'll try to resolve your issue...

  • Hi cb1,

    a) Yes, my scope shows at UART4_RX(PC4), the voltage is 3.18V at UART4_RX both before and after receiving any data, I can clearly see the UART activity waveform. While the interrupts keep firing, the UART4 masked interrupt register (UART_MIS) actually reads 0 in CCS, UART_DR, UART_FR, UART_RIS sometimes changes. If I keep reading these register, the interrupts tend to stop after a short while, if I don't auto-refresh, then it can go on for several minutes. If I set breakpoint in the interrupt handler, and resume, the interrupt will only fire twice in total. 

    b) I connected a 5.6K resistor between 3V3 and UART4_RX, no interrupts fired, the scope read 3.22V from UART4_RX. 

    c) All my interrupt handler for UART4 do, for now, is to clear the interrupt and then send one char to UART0, it is the same code I posted in the first post.  

    d) There shouldn't be anything contacting UART4_RX

    Thanks,

    Hao

  • @ Hao,

    So - when you, "pull-up" UART4_RX - and introduce no low-driving signals - no UART4 interrupts were observed.  This may lead us to believe that your RF device is a possible source of what appears to be, "spurious interrupts."  Have you a 2nd RF device to substitute - and observe if your issue continues?

    Suggest you further investigate - as follows:

    a) temporarily remove any UART0 operation w/in UART4's handler.  (we are testing to see if UART0 may someway/somehow - cause UART4's handler to, "re-trigger.")  Best not to "guess" or pre-judge - and to actually do your best to comply.  Plz report if the removal of UART0 operation from UART4's handler causes any noticeable change.

    b) believe any low-going pulse upon UART4_RX will cause entry to UART4's handler.  You may temporarily route a free GPIO output into UART4_RX (all other connections removed) and see if a brief, low going pulse - causes entry into UART4's handler - and if retriggering occurs.  (again eliminate UART0 operation from this handler)  Again - report results.

    c) always best if you can "repeat" any "issue" across a 2nd board - or across a 2nd port.  Have you another UART which you can use (temporarily) as a substitute for UART4?  Goal is to see if that UART will also suffer multiple re-triggers.

    d) should - as I hope - the removal of the UART0 opereration from w/in the UART4 handler cause the halt of multiple UART4 interrupts - simply set a "marker flag" w/in UART4 handler.  Then read this "marker flag" w/in your "main" and if set use that condition to bring about your UART0 operation - outside of any interrupt handler.

  • Hi cb1,

    I don't have a 2nd RF device, but I have followed you suggestions for investigation. 

    Here is the result of my experiment:

    a) I set a flag in the interrupt handler, and put a check for the interrupt handler in the main loop, if the flag is true then send a char to UART0 and clear the flag. In the end, I still get repeating interrupts.

    b) I use PA2 to send a low-pulse. When a low pulse is sent, the interrupts still fires repeatedly. 

    c) I tried with UART5(PE4, PE5), the same problem remains. 

    The following is my experimental code:

    bool flag;
    
    
    //*****************************************************************************
    //
    // The UART interrupt handler.
    //
    //*****************************************************************************
    void
    UARTIntHandler0(void)
    {
        uint32_t ui32Status;
    
        //
        // Get the interrrupt status.
        //
        ui32Status = ROM_UARTIntStatus(UART0_BASE, true);
    
        //
        // Clear the asserted interrupts.
        //
        ROM_UARTIntClear(UART0_BASE, ui32Status);
    
        //
        // Loop while there are characters in the receive FIFO.
        //
        while(ROM_UARTCharsAvail(UART0_BASE))
        {
            //
            // Read the next character from the UART and write it back to the UART.
            //
            char ch = ROM_UARTCharGetNonBlocking(UART0_BASE);
            ROM_UARTCharPutNonBlocking(UART0_BASE, ch);
    
            if (ch=='1') {
                GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, RED_LED);
            }
            else if (ch=='2') {
                GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, 0);
            }
            else if (ch=='3') {
               	GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, GREEN_LED);
                ROM_GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2, 0);
                SysCtlDelay(SysCtlClockGet() / (1000 * 3));
                ROM_GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2, GPIO_PIN_2);
                GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, 0);
            }
    
        }
    }
    
    void
    UARTIntHandler5(void)
    {
    
    	uint32_t ui32Status;
    
    	//
    	// Get the interrrupt status.
    	//
    	ui32Status = ROM_UARTIntStatus(UART5_BASE, true);
    
    	//
    	// Clear the asserted interrupts.
    	//
    	ROM_UARTIntClear(UART5_BASE, ui32Status);
    
    	flag = true;
    }
    
    //*****************************************************************************
    //
    // This example demonstrates how to send a string of data to the UART.
    //
    //*****************************************************************************
    int
    main(void)
    {
        //
        // Enable lazy stacking for interrupt handlers.  This allows floating-point
        // instructions to be used within interrupt handlers, but at the expense of
        // extra stack usage.
        //
        FPUEnable();
        FPULazyStackingEnable();
    
        //
        // Set the clocking to run directly from the crystal.
        //
        SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                           SYSCTL_XTAL_16MHZ);
    
        //
        // Enable the GPIO port that is used for the on-board LED.
        //
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    
        //
        // Enable the GPIO pins for the LED (PF2).
        //
        GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED);
        GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_2);
    
        //
        // Enable the peripherals used by this example.
        //
        ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_UART5);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
    
        //
        // Enable processor interrupts.
        //
        IntMasterEnable();
    
        //
        // Set GPIO A0 and A1 as UART pins.
        //
        GPIOPinConfigure(GPIO_PA0_U0RX);
        GPIOPinConfigure(GPIO_PA1_U0TX);
        GPIOPinConfigure(GPIO_PE4_U5RX);
        GPIOPinConfigure(GPIO_PE5_U5TX);
        GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
        GPIOPinTypeUART(GPIO_PORTE_BASE, GPIO_PIN_4 | GPIO_PIN_5);
    
        //
        // Configure the UART for 115,200, 8-N-1 operation.
        //
        UARTConfigSetExpClk(UART0_BASE, ROM_SysCtlClockGet(), 115200,
                                (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                                 UART_CONFIG_PAR_NONE));
        UARTConfigSetExpClk(UART5_BASE, ROM_SysCtlClockGet(), 115200,
                                    (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                                     UART_CONFIG_PAR_NONE));
        UARTFlowControlSet(UART5_BASE, UART_FLOWCONTROL_NONE);
        //
        // Enable the UART interrupt.
        //
        IntEnable(INT_UART0);
        UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
        IntEnable(INT_UART5);
        UARTIntEnable(UART5_BASE, UART_INT_RX | UART_INT_RT);
        ROM_UARTEnable(UART5_BASE);
    
        //
        // Prompt for text to be entered.
        //
        //UARTSend((uint8_t *)"Enter command: \n", 16);
        ROM_GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2, GPIO_PIN_2);
        UART0Send((uint8_t *)"\033[2JEnter text: ", 16);
    
        //
        // Loop forever echoing data through the UART.
        //
        while(1)
        {
        	if (flag) {
        		UART0Send((uint8_t *)"h",1);
        		flag = false;
        	}
        }
    }
  • Would like to eliminate use of any other UARTs (thus kill for now - UART0 operation.)  

    Just provide a brief, "Hi - Lo - Hi" pulse into UART4's RX pin.  This pulse should not persist @ logic "Lo" beyond the time duration of your UART4 interrupt handler.  (if that pulse "lingers low" - you'll likely wind up back w/in that handler)

    I'd like to avoid setting UART4 RX pin as UART (for testing).  Instead - configure it as a simple input w/weak pull-up R.  Then configure this pin for GPIO input pin interrupt - and write simple handler.  Provide brief low going signal & see how the GPIO interrupt behaves.

    Very helpful to run these tests upon 2 (or more) boards - single board anomaly eats time, effort, money...

    It remains unclear as to how you've prevented RS232 level signals from being applied to any of your UART RX inputs.  (it is possible that you have no RS232 levels - but it is mandatory that you avoid such excessive levels being introduced to the MCU.)  

    When multiple UARTs are, "in play" it is always possible that you can transpose UART numbers - and configure improperly or service incorrectly. 

    You must understand each/every one of the interrupt configuration requirements w/in your start-up file.  I note that many of your code listings extend far down the page - with the bulk of the later entries "empty."  We don't favor CCS so I'm unable to provide substantial guidance in that regard.

    Note too that while you include, "IntEnable(INT_UART5);" I find no similar treatment for, "IntEnable(INT_UART0);" - lacking this call should cause issues...  (when/while UART0 was in play) 

    And - there should be many examples of UART operation throughout StellarisWare, rebrandWare, and Ap Notes.  Suggest that you search for shortest, simplest such UART example - and load & try that.