I am experiencing an issue whilst trying to debug UART3 on an LX4F232H5QD revision A3. I am using an XDS100V2 and CCS5.4 under Linux.
The following code for UART2 works successfully when debugging with the JTAG connected. Similar code also works successfully for UART0 and UART1 also:
else if(uart_number==2)
{
//PG5 - U2Tx
//PG4 - U2Rx
//PH5 - RS485/!RS232_UART0
//PH4 - HDPLX_UART0
//PH3 - RS/!TTL_UART0
//PK6 - UART0_TX/!RX
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH); //enable PORT H
GPIOPinTypeGPIOOutput(GPIO_PORTH_BASE, GPIO_PIN_5|GPIO_PIN_4|GPIO_PIN_3); //set PH5, PH4 and PH3 as outputs
GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_5|GPIO_PIN_4|GPIO_PIN_3, ((0x01<<5)|(0x01<<4)|(0x01<<3))); //write 1 only to PH5, PH4 and PH3
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK); //enable PORT K
GPIOPinTypeGPIOOutput(GPIO_PORTK_BASE, GPIO_PIN_6); //set PK6 as output
GPIOPinWrite(GPIO_PORTK_BASE, GPIO_PIN_6, 0x0); //write 0 only to PK6
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG); //enable PORT G
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART2); //enable UART 2
GPIOPinConfigure(GPIO_PG4_U2RX); //Set alternate pin configuration
GPIOPinConfigure(GPIO_PG5_U2TX); //Set alternate pin configuration
GPIOPinTypeUART(GPIO_PORTG_BASE, GPIO_PIN_5 | GPIO_PIN_4); //Configure UART pins as PG5 and PG4
sysclk=SysCtlClockGet(); //Get system clock speed
UARTConfigSetExpClk(UART2_BASE, sysclk, uart_speed,(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); //Configure UART2
UARTFIFODisable(UART2_BASE); //Disable FIFO
UARTIntEnable(UART2_BASE, UART_INT_RX); //Disable RX interrupt
IntEnable(INT_UART2); //enable UART2 interrupt
IntMasterEnable(); //enable interrupts
}
else if(uart_number==3)
{
//PC7 - U3Tx
//PC6 - U3Rx
//PJ0 - RS485/!RS232_UART0
//PH7 - HDPLX_UART0
//PH6 - RS/!TTL_UART0
//PK7 - UART0_TX/!RX
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH); //enable PORT H
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ); //enable PORT J
GPIOPinTypeGPIOOutput(GPIO_PORTH_BASE, GPIO_PIN_7|GPIO_PIN_6); //set PH7, PH6 as outputs
GPIOPinTypeGPIOOutput(GPIO_PORTJ_BASE, GPIO_PIN_0); //set PJ0 as an output
GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_7|GPIO_PIN_6, ((0x01<<7)|(0x01<<6))); //write 1 only to PH7, PH6
GPIOPinWrite(GPIO_PORTJ_BASE, GPIO_PIN_0, (0x01<<0)); //write 1 only to PJ0
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK); //enable PORT K
GPIOPinTypeGPIOOutput(GPIO_PORTK_BASE, GPIO_PIN_7); //set PK7 as output
GPIOPinWrite(GPIO_PORTK_BASE, GPIO_PIN_7, 0x0); //write 0 only to PK7
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); //enable PORT C
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3); //enable UART 3
GPIOPinConfigure(GPIO_PC6_U3RX); //Set alternate pin configuration
GPIOPinConfigure(GPIO_PC7_U3TX); //Set alternate pin configuration
GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_7 | GPIO_PIN_6); //Configure UART pins as PC6 and PC7
sysclk=SysCtlClockGet(); //Get system clock speed
UARTConfigSetExpClk(UART3_BASE, sysclk, uart_speed,(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); //Configure UART3
UARTFIFODisable(UART3_BASE); //Disable FIFO
UARTIntEnable(UART3_BASE, UART_INT_RX); //Disable RX interrupt
IntEnable(INT_UART3); //enable UART3 interrupt
IntMasterEnable(); //enable interrupts
}
However, UART3 gets stuck in a loop when the JTAG is connected. The loop that it gets stuck in UARTDisable which is called from UARTConfigSetExpClk.
Strangely though, when the JTAG is not connected, it works correctly.
Has anybody experienced anything similar?
Thanks
Lee