Hi Jan,
I have a question about how to avoid USB CDC/ACM losing (discarding) data.
According with this post the correct behavior should be discard data if buffer is full:
http://nuttx.org/doku.php?id=wiki:nxinternal:usb-out-nakBut many people on "forums" suggest the correct way should be sending NAK or stall (and let the HW to send NAK itself) if buffer is full, see:
http://www.eevblog.com/forum/microcontrollers/usb-cdc-'flow-control'/https://groups.google.com/forum/#!topic/lufa-support/bkduO55cQjMhttps://www.embeddedrelated.com/showthread/lpc2000/36681-1.phpFrom the last link:
"The windows implementation of CDC (usbser.sys) does not handle
handshaking signals reliably. I believe the Linux one does, as do most
of the 3rd party drivers to go with prolific or FTTI chipsets.
That said, I'm not sure if any actually implement flow control using
CTS/RTS. The other controls signals such as DTR/DST/DCD/RI etc should be
handled correctly and passed through as notify control, but flow control
would be better handled by the NAK process."
In your post
http://janaxelson.com/usb_virtual_com_port.htmYou wrote:
"If the buffer is full, the virtual COM-port device can NAK attempts by the USB host
to send more data. When the remote device asserts CTS, the virtual COM-port
device can send the buffered data and accept new data from the host. To use
CTS in this way, the USB host doesn’t need to know the state of CTS."
What is the correct way to solve this issue? Should it be implementing Flow Control (RTS/CTS) ?
What is the best/reliable way to solve this issue? (the correct way could not be the best way)
BR,
Alan