Any example of working CDC in device mode? #90
Replies: 3 comments 1 reply
-
Have you been able to make any progress on this? Even with fixing up the code so I can get the OUT endopint and then read from it, it is not reliable, but I have been able to do a loopback once. |
Beta Was this translation helpful? Give feedback.
-
So I have just found why the receive is not working: In order to receive data on the OUT endpoint you have to first prime it using This is actually very similar to TinyUSB, but the difference is that TinyUSB has a callback mechanism when a "driver" is opened (basically when the device is enumerated). In this callback we would then initiate a transfer on a CDC's OUT endpoint so the application can receive data using @sekigon-gonnoc Am I fundamentally missing something or is this still evolving? |
Beta Was this translation helpful? Give feedback.
-
I'm looking for the same thing. correct me if I wrong: |
Beta Was this translation helpful? Give feedback.
-
Not sure if device CDC is supported, I modified examples/usb_device from HID to CDC, but it doesn't work. When connecting both native USB port and Pio/USB port to PC, the native USB port reports a COMM device and it actually works (with tud_cdc_rx_cb/tud_cdc_read/tud_cdc_write). However, Pio/USB port shows as another COMM port on PC and it could not be connected, sometimes it's access denied, but also saw mulfunctional error, or file not found.
The same hardware works well with un-modified examples/usb_device for HID device, so I think the wiring should be good.
My test code attached (no change for CMakeLists.txt; tried both values for class/subclass/protocol in desc_device):
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions