-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] How to debug and enable a new CDC device? #6
Comments
I'm sorry, but I don't think that's gonna work. PicoLibSDK only handles basic USB functions. The modification for FTDI is quite extensive, it is not yet implementable in the library. Even CDC control packets are not supported in the library. Print to UART port (not via USB) is possible by enabling the USE_UART_STDIO switch in config.h. |
Ok, thank you. I think it's still possible... I'll work on it now. Thank you, this code looks great @Panda381 !! |
I was able to do some
to I'll work on the FTDI type of stuff now that I can debug this. Thanks for you quick responses! :-) |
See PR #7 for review (not really intended to merge). I think it's pretty close. |
Summary
I have a CDC device that uses the very common FTDI-232 serial-to-USB chip. Part of the device descriptor shows:
Notice that the Class and SubClass are listed here both as
0x00
, instead of what they should be for a normal CDC device. As a result, when the USB Host tries to enumerate this device, it's not quite sure what to do, so I think it just skips it. I would like for the USB Host to consider this device to be a CDC class device (which I think it is actually), even though it doesn't claim to be here. This capability was recently added to TinyUSB. Basically, I think TinyUSB is aware of this type of device and considers it to be a CDC class.In addition, there are some USB control commands that need to be sent to the device to set it up properly. These are sent as a USB control transfer with the following:
Question
First, when trying to debug this, it would be nice to be able to do a little "printf() debugging". I am using the PicoPad/USB/USBUART example (appropriately adjusted for just the Pico). I've configured it so that I can upload code and connect to the Pico through the UART, while being able to use the on-board physical microUSB port to connect to the Piccolo (CDC device). From the main code, I can use
Print("I'm here...\n");
statements, but I can't use them fromsdk_usb_host.c
, where I'm trying to debug to try to get this working for me. So my first question is, how can I use aPrint()
style message from withingsdk_usb_host.c
to help me debug this?Second, is there a way to send an arbitrary USB control transfer to the device to reset it and configure it's flow control, data bits, and baud as shown above? I think each of those
cmd()
calls (that code is actually in Ruby) just generate an 8-byte USB control packet that configures the device. My second question is, how can I send these packets to configure the device?Thanks!
The text was updated successfully, but these errors were encountered: