Hello!
I'd like to implement a 3rd (CDC) interface into my composite device which already have a raw HID and a DFU interface, both working. Unfortunately, I don't really understand the working principle of the usb_dev_serial example. I've got a couple of questions and I'd be grateful if someone will be able to answer it.
1. In the example, the comments indicate that there will be some kind of 'UART redirection' but I can't see anything like that. UART0 and PA0-PA1 pins are configured the same way like 'normal' UART. In addition, PA0-PA1 is connected to the ICDI interface to act as a debug UART. How the interface know that from now the ICDI debug interface is not needed because we intend to replace with CDC? I really don't get it.
2. I also don't understand what the CDC RXHandler and TXHandler are actually doing. In TXHandler, there is a comment
// Since we are using the USBBuffer, we don't need to do anything // here. //
but where are we using the USBBuffer, actually? The example is not echoing or sending anything..
In the RXHandler, there is a rather obscure part
// A new packet has been received.
//
case USB_EVENT_RX_AVAILABLE:
{
//
// Feed some characters into the UART TX FIFO and enable the
// interrupt so we are told when there is more space.
//
USBUARTPrimeTransmit(USB_UART_BASE);
ROM_UARTIntEnable(USB_UART_BASE, UART_INT_TX);
break;
}
so we received something and now we force transmit some dummy bytes instead of reading out or what? I'm clueless.
Finally, the example blinks the blue (receive traffic) and green (transmit traffic) LED, to indicate that something happened. I'm using Minicom on Ubuntu, I can connect to ttyACM0 but when I press a key it seems that both LEDs blink at the very same time. Is it normal?
What would be useful is an explanation how USB CDC actually relates to the UART peripherial. As far I know - after studying the USB lib UG, reading through e2e - there is no information which answers my questions.The example should have an echo functionality too, it would be much easier to understand what is going on and why.