When using the NXP/Keil usbcdc example, data appears to be lost when sending large amounts from target to host. Does the Keil usbcore/usbcdc lack flow control, or is this a limitation of the usb cdc specification?
Target: LPC1343 Compiler: gcc Host: Linux (Ubuntu)
vcomdemo.c V1.02 cdcuser.c V1.10 usbcore.c V1.20 serial.c V1.10
Changes below were made to the usbcdc example, to send an incrementing stream of bytes [0..255].
cat /dev/ttyACM0 > capture hexdump capture | less
* serial.c *
int ser_Read (char *buffer, const int *length) { static int increment = 0; buffer[0] = increment++; return 1; } void ser_AvailChar (int *availChar) { return 1; }
Was an issue with tty handling on Linux. To resolve: stty -F /dev/ttyACM0 raw
> Was an issue with tty handling on Linux.
Surely, PC applications may also "drop" data :-)
Software sniffer shows the culprit, device or PC app.
usbmon and WireShark on Linux biot.com/.../usb-sniffing-on-linux
Tsuneo