we are working on a project which required to use usb cdc acm. compare with normal serial, the usb cdc acm always lost some packages when chip start and reboot. do anyone knows how could I fix it?
we are working on a project which required to use usb cdc acm. compare with normal serial, the usb cdc acm always lost some packages when chip start and reboot. do anyone knows how could I fix it?
Is the data lost from the PC to the UART, or lost from the UART to the PC?
Kenneth
lost from the UART to the PC
I assume the easiest would be to wait for data received from the PC then, before you start sending data to the PC. Then you know the CDC driver and PC app have loaded on the PC is running before you start sending data. Could that work?
Else I think you just have to have a fixed delay after USB have enumerated before you start sending data to the PC.
I assume the easiest would be to wait for data received from the PC then, before you start sending data to the PC. Then you know the CDC driver and PC app have loaded on the PC is running before you start sending data. Could that work?
Else I think you just have to have a fixed delay after USB have enumerated before you start sending data to the PC.
but then how about the package missing before reboot. it can print out by using uart only, but not with CDC
The UART can send data at any time, while for USB you need to wait until the host is ready. I suggest wait for APP_USBD_CDC_ACM_USER_EVT_PORT_OPEN event before pushing data on USB?
I can understand the part at the beginning when the chip start running. But in the end, what else can cause usb cdc do not print the message? we have the issue it lost several packages before rebooting.