Hello, I'm trying to use UART2 but the application hangs after "UARTStdioInit(2);" instruction and I don't know why. Here is my code:
void main (void){
SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART2);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD;
HWREG(GPIO_PORTD_BASE + GPIO_O_CR) = 0x80;
GPIOPinConfigure(GPIO_PD7_U2TX);
GPIOPinTypeUART(GPIO_PORTD_BASE, GPIO_PIN_7);
GPIOPinConfigure(GPIO_PD6_U2RX);
GPIOPinTypeUART(GPIO_PORTD_BASE, GPIO_PIN_6);
UARTStdioInit(2);
SysCtlDelay(20000000);
while(1){
UARTprintf("Hello World!\n");
SysCtlDelay(200000);
}
}
Thank you!