Pico-PIO-USB: PIO USB v0.6.0 no longer enumerates devices

After upgrading the PIO USB library to version 0.6.0 the callback for a HID device mounting (void tuh_hid_mount_cb) no longer works.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 16 (2 by maintainers)

Most upvoted comments

I am experiencing something similar. I tried running the capture_hid_report on an “Adafruit RP2040 Feather with USB host” (so I had to adapt the pins to 16 and 17 and also add code to drive GPIO 18 high since that enables power on the DFP. With commit 0f747aaa0c16f750bdfa2ba37ec25d6c8e1bc117 the example works and the connected device (some USB RAW HID device that can be bought online) enumerates fine:

Root 0 connected
Device 0 Connected
control in[complete]
Enumerating 0b00:1000, class:0, address:1
...

However, with latest main (fe9133fc513b82cc3dc62c67cb51f2339cf29ef7) and exactly the same changes done by me, the enumeration fails:

Root 0 connected
Device 0 Connected
control in[error]
Enumeration failed(-1)

Same results here: v0.5.3

hello!
Root 0 connected
Device 0 Connected
control in[complete]
Enumerating 054c:0268, class:0, address:1
control out[complete]
control in[error]
Failed to get string descriptor (Manufacture)
control in[error]
Failed to get string descriptor (Product)
control in[complete]
control in[complete]
control out[complete]
inum:0, altsetting:0, numep:2, iclass:3, isubclass:0, iprotcol:0, iface:0
        bcdHID:1.11, country:0, desc num:1, desc_type:34, desc_size:148
control out[error]
control in[complete]
                Report descriptor:05 01 09 04 a1 01 a1 02 85 01 75 08 95 01 15 00 26 ff 00 81 03 75 01 95 13 15 00 25 01 35 00 45 01 05 09 19 01 29 13 81 02 75 01 95 0d 06 00 ff 81 03 15 00 26 ff 00 05 01 09 01 a1 00 75 08 95 04 35 00 46 ff 00 09 30 09 31 09 32 09 35 81 02 c0 05 01 75 08 95 27 09 01 81 02 75 08 95 30 09 01 91 02 75 08 95 30 09 01 b1 02 c0 a1 02 85 02 75 08 95 30 09 01 b1 02 c0 a1 02 85 ee 75 08 95 30 09 01 b1 02 c0 a1 02 85 ef 75 08 95 30 09 01 b1 02 c0 c0 
                        epaddr:0x02, attr:3, size:64, interval:1
                        epaddr:0x81, attr:3, size:64, interval:1

v0.6.1 / master

hello!
Root 0 connected
Device 0 Connected
control in[error]
Enumeration failed(-1)
Root 0 disconnected
Disconnect
Disconnect device 0

@sekigon-gonnoc please can you reopen this issue?

set the optimize option to something other than -Os

@sekigon-gonnoc (with CC: to @hathach ) , is it possible to apply a local area “no-optimize” effect by using #pragma GCC optimize feature https://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html with the PIO USB library and/or Adafruit Tiny USB library while keeping the rest of source codes (a sketch, Arduino Core, other libraries) compiled with -Os flag ?

set the optimize option to something other than -Os

👋 can you explain how to do that?

fwiw: i stumbled upon this with similar experience, 0.6.0 doesn’t run the callback, 0.5.3 seems to still work as i expect.

In the Arduino IDE it’s under “Tools->Optimize”