Hello guys,
I have a very disturbing problem right know. Enabling the UART0 interrupt causes a FaultISR() call. This happens only in run mode. In debug mode, the code works fine.
Here is my code:
void UART_Init(void)
{
//
// Enable the peripherals.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
//
// Set GPIO A0 and A1 as UART pins.
//
GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
//
// Configure the UART for 38400, 8-N-1 operation.
//
UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 38400,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
//
// Enable the UART interrupt.
//
UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
IntEnable(INT_UART0);
}
void UART_IntHandler(void)
{
uint8 l_ucReceivedChar;
uint32_t ui32Status;
//
// Get the interrrupt status.
//
ui32Status = UARTIntStatus(UART0_BASE, true);
//
// Clear the asserted interrupts.
//
UARTIntClear(UART0_BASE, ui32Status);
//
// Loop while there are characters in the receive FIFO.
//
while(UARTCharsAvail(UART0_BASE))
{
l_ucReceivedChar = UARTCharGet(UART0_BASE);
ProcessRxChar(l_ucReceivedChar);
}
}
The UART_IntHandler function is added in the startup_ewarm,c file in the vectors table.
Any suggestions ?