This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello Than,
The following is missing
ROM_GPIOPinConfigure(GPIO_PC6_U3RX);
ROM_GPIOPinConfigure(GPIO_PC7_U3TX);
Please add it before the call ROM_GPIOPinTypeUART
Regards
Amit
Ak, Amit , in example usb_dev_serial use UART0 , why we don't use :
ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
Hello Than
UART-0 Port Control, Digital Enable and AFSEL is by default set for UART at reset. However other UART's do not have this feature and user code needs to configure the same
Regards
Amit
I know this is an old thread, but I just encountered the same problem with the usb_dev_serial example for the EK-TM4C123GXL in TivaWare_C_Series-2.1.0.12573.Amit Ashara said:UART-0 Port Control, Digital Enable and AFSEL is by default set for UART at reset. However other UART's do not have this feature and user code needs to configure the same
I suggest the example could be improved to explicitly call GPIOPinConfigure rather then relying upon defaults.
E.g. after changing the example to use UART1 instead of UART0 I added two new defines TX_GPIO_PIN_CONFIGURE and RX_GPIO_PIN_CONFIGURE:
//***************************************************************************** // // GPIO peripherals and pins muxed with the redirected UART. These will depend // upon the IC in use and the UART selected in USB_UART_BASE. Be careful that // these settings all agree with the hardware you are using. // //***************************************************************************** //***************************************************************************** // // Defines required to redirect UART1 via USB. // //***************************************************************************** #define TX_GPIO_BASE GPIO_PORTB_BASE #define TX_GPIO_PERIPH SYSCTL_PERIPH_GPIOB #define TX_GPIO_PIN GPIO_PIN_1 #define TX_GPIO_PIN_CONFIGURE GPIO_PB1_U1TX #define RX_GPIO_BASE GPIO_PORTB_BASE #define RX_GPIO_PERIPH SYSCTL_PERIPH_GPIOB #define RX_GPIO_PIN GPIO_PIN_0 #define RX_GPIO_PIN_CONFIGURE GPIO_PB0_U1RX
Which got used in main:
// // Enable and configure the UART RX and TX pins // ROM_SysCtlPeripheralEnable(TX_GPIO_PERIPH); ROM_SysCtlPeripheralEnable(RX_GPIO_PERIPH); ROM_GPIOPinConfigure(TX_GPIO_PIN_CONFIGURE); ROM_GPIOPinConfigure(RX_GPIO_PIN_CONFIGURE); ROM_GPIOPinTypeUART(TX_GPIO_BASE, TX_GPIO_PIN); ROM_GPIOPinTypeUART(RX_GPIO_BASE, RX_GPIO_PIN);