Device: EK-TM4C1294XL
Project: Based off of timers example project
The example works fine for UART0. When I modify it for another UART channel, execution stops on the following statement:
UARTprintf("\033[2JTimers example\n");
See code snippet below...
int
main(void)
{
//
// Set the clocking to run directly from the crystal at 120MHz.
//
g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
//
// Initialize the UART and write status.
//
ConfigureUART();
UARTprintf("\033[2JTimers example\n"); //does not return from this statement
UARTprintf("T1: 0 T2: 0");
//
// Enable the GPIO port that is used for the on-board LEDs.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
//
// Enable the GPIO pins for the LEDs (PN0 & PN1).
//
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0 | GPIO_PIN_1);
//
// Enable the peripherals used by this example.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);
//
// Enable processor interrupts.
//
ROM_IntMasterEnable();
//
// Configure the two 32-bit periodic timers.
//
ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
ROM_TimerConfigure(TIMER1_BASE, TIMER_CFG_PERIODIC);
ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, g_ui32SysClock);
ROM_TimerLoadSet(TIMER1_BASE, TIMER_A, g_ui32SysClock / 2);
//
// Setup the interrupts for the timer timeouts.
//
ROM_IntEnable(INT_TIMER0A);
ROM_IntEnable(INT_TIMER1A);
ROM_TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
ROM_TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
//
// Enable the timers.
//
ROM_TimerEnable(TIMER0_BASE, TIMER_A);
ROM_TimerEnable(TIMER1_BASE, TIMER_A);
//
// Loop forever while the timers run.
//
while(1)
{
}
}
void
ConfigureUART(void)
{
RT for console I/O.
// //
//// UARTStdioConfig(0, 115200, g_ui32SysClock);
// UARTStdioConfig(0, 19200, g_ui32SysClock);
//
// Enable the GPIO Peripheral used by the UART.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
//
// Enable UART0.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART4);
while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_UART4)));
//
// Configure GPIO Pins for UART mode.
//
ROM_GPIOPinConfigure(GPIO_PA2_U4RX);
ROM_GPIOPinConfigure(GPIO_PA3_U4TX);
ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3);
//
// Initialize the UART for console I/O.
//
UARTStdioConfig(4, 19200, g_ui32SysClock);
}