Hi
I have the usb_dev_serial.c example code (starterware 1_20_03_03) running on my evm L138 C6748. First thing I noticed was that it was slow - about 5kbytes/s. I am sending text files from Teraterm on a pc out via a virtual COM2 to the CDC device, via the UART and null modem cable to another Teraterm window on COM3.
I tried enabling caching, just in case CPU speed was a problem. It didn't change the transfer speed but it did stop the LCD display working, so I guess it needs a write-back somewhere in the graphics code. Anyway, ignore that for now.
Next I experimented with the baud rate, which made no difference because the baud rate setting is ignored by the example code. So I fixed this. Now it can run at any baud rate instead of being permanently stuck on 115200.
This brings up a new problem: at low baud rates the data transmission (from USB to UART) freezes after about 300 bytes. It happens when the buffer g_sRxBuffer gets full (256 bytes). Data receive (opposite direction) continues to work albeit very very slowly. I increased the size of the buffers to 1024 which means you can send more data (~1200 bytes) before it goes wrong, but once the buffer fills the transmission freezes. It seems the USB_EVENT_RX_AVAILABLE stops happening after the buffer is full and nothing will make it start again. Does anyone know why this is, and how to fix it?
I later discovered that running the host and virtual COM2 on a faster PC makes the buffer full problem happen even at 115200 baud.
I removed the call that outputs transmitted characters to the UART
UARTCharPutNonBlocking(ulBase, ucChar); from USBUARTPrimeTransmit()
That makes it go a lot faster and the buffer doesn't fill any more. I added a local echo so every character coming over USB is sent back to USB. This didn't slow the transfer at all. So I echoed every character 10 times and still the USB does not slow down, so I'm not sure what is limiting the speed of the transfer. Perhaps it is the host PC or teraterm. Echoing every character 40 times does slow down the transfer, but it is now moving about 150kbytes/s which is more respectable than 5!
Incidentally, I also noticed that the SysTickIntHandler() function doesn't get called. Does anyone know where this should be linked in? Presumably you have to set up a callback somewhere?
But my main concern is the transmission freeze when buffer is full - if anyone else has had this problem it would be great to hear from you.
Thanks and best wishes
Roy