felis / USB_Host_Shield_2.0

Revision 2.0 of USB Host Library for Arduino.
https://chome.nerpa.tech
1.8k stars 779 forks source link

Trouble establising CDC ACM connection using Sparkfun USB-C host shield #827

Open mattilindroth opened 2 weeks ago

mattilindroth commented 2 weeks ago

Hi,

I am trying to make arduino act as a usb host for Ardusimple rtk3b device. I am trying to establish cdc acm- connection to read the data as from virtual serial port, as I can in windows. However I get stuck when trying to run the example for cdc acm. The ACM class method SetControlLineState(3) returns 5, which is apparently not good.

I tried the USB_desc- example which worked fine, and I can see the device descriptor, configuration descriptor, interface descriptors and endpoints and they make sense.

I verified from Ardusimple that CDC-ACM is the way to go.

I tried searching for meaning for this code 5 but I cannot find any. CoPilot says

The error code 5 in the USB Host Shield 2.0 library typically indicates a “Set Address” error.

but it has been hallucinating and claiming it means other errors too, so I tend to ignore it.

Any help is much appreciated. acm_terminal.zip

Best regards, Matti

mattilindroth commented 2 weeks ago

I set the ENABLE_UHS_DEBUGGING to 1 and I can see this output: Start ACM Init Addr:01 NC:01 Endpoint descriptor: Length: 07 Type: 05 Address: 84 Attributes: 03 MaxPktSize: 000A Poll Intrv: 20 Endpoint descriptor: Length: 07 Type: 05 Address: 86 Attributes: 03 MaxPktSize: 000A Poll Intrv: 20 Endpoint descriptor: Length: 07 Type: 05 Address: 81 Attributes: 02 MaxPktSize: 0040 Poll Intrv: 00 Endpoint descriptor: Length: 07 Type: 05 Address: 01 Attributes: 02 MaxPktSize: 0040 Poll Intrv: 00 Endpoint descriptor: Length: 07 Type: 05 Address: 83 Attributes: 02 MaxPktSize: 0040 Poll Intrv: 00 Endpoint descriptor: Length: 07 Type: 05 Address: 02 Attributes: 02 MaxPktSize: 0040 Poll Intrv: 00 Endpoint descriptor: Length: 07 Type: 05 Address: 85 Attributes: 02 MaxPktSize: 0040 Poll Intrv: 00 Endpoint descriptor: Length: 07 Type: 05 Address: 03 Attributes: 02 MaxPktSize: 0040 Poll Intrv: 00 Conf:01 SetControlLineState: 05 OnInit:05