Other Parts Discussed in Thread: EK-TM4C123GXL
Hi everyone,
I am trying to create an application where the TIVA is configured as USB device which communicates downstream through serial port.
I am already tested with success the usb_dev_bulk example, where the pc sends to the USB device a string which is answered with CAPs.
Now I am modifying this example to send the string received through USB from the PC to a a second device using an UART. There is no problem using UART0, buy I am not able to get it running with a different UART, even the use of a different one than UART0 seems to block the USB comunication.
This is my UART configuration:
//UART4 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART4); GPIOPinConfigure(GPIO_PC4_U4RX); GPIOPinConfigure(GPIO_PC5_U4TX); GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5); UARTClockSourceSet(UART4_BASE, UART_CLOCK_PIOSC); UARTStdioConfig(4, 115200, 16000000);
An later in main after receiving from USB I just use the UARTSend function :
.... UARTSend(UART4_BASE, (uint8_t*)tx_buffer, 6); .... //***************************************************************************** // // Send a string to the UART. This function sends a string of characters to a // particular UART module. // //***************************************************************************** void UARTSend(uint32_t ui32UARTBase, const uint8_t *pui8Buffer, uint32_t ui32Count) { // // Loop while there are more characters to send. // while(ui32Count--) { // // Write the next character to the UART. // MAP_UARTCharPut(ui32UARTBase, *pui8Buffer++); } }
The above code is working perfectly for UART0, but not for other UARTs. I think I have been very carefull with the GPIO, ports... configuration.
Any ideas or possible reasons?
Best regards