Hi All,
I am trying to get basic uart functionality going on a LM3S2772 and I am having trouble with the program entering the NMI handler.
this occurs when I try and configure the GPIO to Uart function. (GPIOPinTypeUART) - From Stellaris library
Function is called with arguments
GPIO_PORTA_BASE = 0x40004000
GPIO_PIN_0 = 0x00000001
GPIO_PIN_1 = 0x00000002
Any help will be greatly appreciated !
CODE:
int
main(void)
{
volatile unsigned long ulLoop;
//
// Enable the GPIO port that is used for the on-board LED.
//
SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOB;
//SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOG;
//Enable Uart0
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
// Set GPIO A0 and A1 as UART pins.////
//
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); //<--------- HERE. PC enters NMIsr at this point, does not execute first line in this function !!
//
// Configure the UART for 115,200, 8-N-1 operation.
//
UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
//
// Do a dummy read to insert a few cycles after enabling the peripheral.
//
ulLoop = SYSCTL_RCGC2_R;
//
// Enable the GPIO pin for the LED (PG1). Set the direction as output, and
// enable the GPIO pin for digital function.
//PB1 AND PB4
GPIO_PORTB_DIR_R = 0x12;
GPIO_PORTB_DEN_R = 0x12;