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.
I do not make it to redirect the usb-serial to another uart than uart0.
In usb_dev_serial i changed the uart defines to match uart1:
#define USB_UART_BASE UART1_BASE
#define USB_UART_PERIPH SYSCTL_PERIPH_UART1
#define USB_UART_INT INT_UART1
#define TX_GPIO_BASE GPIO_PORTB_BASE
#define TX_GPIO_PERIPH SYSCTL_PERIPH_GPIOB
#define TX_GPIO_PIN GPIO_PIN_1
#define RX_GPIO_BASE GPIO_PORTB_BASE
#define RX_GPIO_PERIPH SYSCTL_PERIPH_GPIOB
#define RX_GPIO_PIN GPIO_PIN_0
In startup_ccs.c i changed:
void (* const g_pfnVectors[])(void) = {
....
IntDefaultHandler // UART0 Rx and Tx
USBUARTIntHandler, // UART1 Rx and Tx
...}
What am i missing?
Hello Fabian,
Can you explain what issue you are running into? I presume you have FTDI cable attached to UART1 that is then connected to the PC? If so, what behavior are you seeing when you try and send messages?
Best Regards,
Ralph Jacobi
Hello Ralph,
When i write to the USB Virtual COM-Port the Green On-Board Led flahes with every transmitted byte (as in the example), this seems to work. But it doesnt foward the the Byte to UART1.
In the other direction the blue Led should flash with every transmitted Byte on UART1, but it doesn't transmit/receive anything over UART1. In the code the USBUARTIntHandler is never reached.
Yes, my first try was an attached FTDI TTL-232R-RPi Cable. After not getting an uart response from the TIVA i checked with an oscilloscope whether the UART GPIOs toggle. With the FTDI Cable attached, the FTDI Chip transmitts data with the same baud (9600) as set in the TIVA-Code. With only a probe attached to Pins PB0 & PB1 both GPIOs keep beeing low .
Accordingly, I suspect that UART1, its Interrupt or its GPIOSs are not properly initialised.
Best regards,
Fabian
Hello Fabian,
Did you change the DEFAULT_BIT_RATE to 9600? The example is set to run at 115200.
I can try and test this out with my own FTDI cable tomorrow and see what I can observe, but any detailed investigation may need to wait until Friday.
Best Regards,
Ralph Jacobi
Hello Ralph,
Yes I also tried different baud rates (9600 & 115200), of course i matched to baudrate on the tiva-board with the settings on my computer (I use putty as terminal). Beside UART1 i also tried UART3 & UART5. No change in behaviour was observed.
Best regards,
Fabian
Hello Fabian,
I've been trying to find a solution to the issue with this but haven't been able to work out something yet.
From what I can tell the issue is that the USB library thinks the UART port is tied up, and the reason may be that there are a couple error bits set for some reason.
When testing with the ICDI, I don't see these bits getting set and the interface works fine. But something with the FTDI cable is causing the UART peripheral to trip those errors. Even after adding multiple clears and a check in the ISR for the error interrupt I was not able to get it working yet.
Unfortunately I can't spend further time investigating this today. I will see if I can get back to it on Monday or otherwise pass it on to a colleague to try and debug further.
Best Regards,
Ralph Jacobi
Hi,
I think the problem is that the code is missing the pinmuxing code. I tried on UART1 with PB0 (for RX) and PB1 (for TX) and it is working for me. You need to add the below two lines.
MAP_SysCtlPeripheralEnable(TX_GPIO_PERIPH);
MAP_SysCtlPeripheralEnable(RX_GPIO_PERIPH);
GPIOPinConfigure(GPIO_PB0_U1RX);
GPIOPinConfigure(GPIO_PB1_U1TX);
MAP_GPIOPinTypeUART(TX_GPIO_BASE, TX_GPIO_PIN);
MAP_GPIOPinTypeUART(RX_GPIO_BASE, RX_GPIO_PIN);
Hi Charles
Thank you very much, this resolved my issue. UART3 and different Baudrates are also working with those both Pins initalised.
I added the folling lines of code for UART3:
Added on top of File with the other defines:
#define TX_UART_PIN GPIO_PC7_U3TX
#define RX_UART_PIN GPIO_PC6_U3RX
Added to main function:
ROM_GPIOPinConfigure(TX_UART_PIN);
ROM_GPIOPinConfigure(RX_UART_PIN);
Best regards,
Fabian