usb.core.find() fails
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- embedded-iot
调研方向
Start with the usb.core.find(find_all=True) call in the reproduction and compare its behavior on the listed working and failing CircuitPython builds for the Feather RP2040 USB Host. The issue also points to examples/usb_host_midi_simpletest_rp2040usbfeather.py as related context. Done means the call returns attached devices on the failing builds, including the SanDisk drive and other USB devices mentioned.
由索引模型根据 Issue 内容生成。
描述
CircuitPython version and board name
Adafruit CircuitPython 10.3.0-alpha.3-22-gdb82b25b4d on 2026-07-10; Adafruit Feather RP2040 USB Host with rp2040
Code/REPL
# List all attached USB devices (probably only one).
# For "Adafruit Feather RP2040 with USB Type A Host" device.
# Based (loosely) on examples/usb_host_midi_simpletest_rp2040usbfeather.py
import usb.core
import time
print("Looking for all USB devices...")
while True:
devices = usb.core.find(find_all=True)
if devices is None:
print("No devices")
else:
n = 0
print(f"Iterating on {devices=}....")
for device in devices:
n += 1
print(f"\t#{n}: {device=}")
try:
print(f"\t**** Found vendor:product {hex(device.idVendor)}:{hex(device.idProduct)}")
except Exception as e:
print(e)
continue
print(" Sleeping...")
time.sleep(1)
Behavior
**** Typical successful output:
soft reboot
code.py output:
Looking for all USB devices...
Iterating on devices=<USBDevices>....
#1: device=<Device>
**** Found vendor:product 0x781:0x5581
Sleeping...
Iterating on devices=<USBDevices>....
#1: device=<Device>
**** Found vendor:product 0x781:0x5581
Sleeping...
Traceback (most recent call last):
File "code.py", line 9, in <module>
File "usb_host_lsusb.py", line 27, in <module>
KeyboardInterrupt:
Code done running.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 10.3.0-alpha.3-13-gbaa3ca8650 on 2026-07-07; Adafruit Feather RP2040 USB Host with rp2040
>>>
**** Typical failure output:
soft reboot
code.py output:
Looking for all USB devices...
Iterating on devices=<USBDevices>....
Sleeping...
Iterating on devices=<USBDevices>....
Sleeping...
Iterating on devices=<USBDevices>....
Sleeping...
Traceback (most recent call last):
File "code.py", line 9, in <module>
File "usb_host_lsusb.py", line 27, in <module>
KeyboardInterrupt:
Code done running.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 10.3.0-alpha.3-22-gdb82b25b4d on 2026-07-10; Adafruit Feather RP2040 USB Host with rp2040
>>>
Description
Problem: usb.core.find(find_all=True) returns an empty generator even when something's plugged into the USB A port.
Additional information
This code stopped working with build
CircuitPython 10.3.0-alpha.3-22-gdb82b25b4d on 2026-07-10 (adafruit-circuitpython-adafruit_feather_rp2040_usb_host-en_US-20260710-main-PR11093-db82b25.uf2)
which was supposed to address a previously-reported issue with some MIDI keyboards. Now the issue happens with all USB devices (a SanDisk USB stick was used for testing, as well as other USB devices).
**** Fails on these builds (the one purporting to fix it, as well as the latest build available):
Adafruit CircuitPython 10.3.0-alpha.3-22-gdb82b25b4d on 2026-07-10; Adafruit Feather RP2040 USB Host with rp2040
Adafruit CircuitPython 10.3.0-alpha.3-25-g242fe31782 on 2026-07-13; Adafruit Feather RP2040 USB Host with rp2040
**** Succeeds on these builds (the one before the purported fix, and the latest alpha):
Adafruit CircuitPython 10.3.0-alpha.3 on 2026-06-24; Adafruit Feather RP2040 USB Host with rp2040
Adafruit CircuitPython 10.3.0-alpha.3-13-gbaa3ca8650 on 2026-07-07; Adafruit Feather RP2040 USB Host with rp2040
- 主要语言
- C
- 星标
- 4.6k
- 派生
- 1.4k
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 153
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
adafruit/circuitpython 的其他 Issue
-
board breaks api
难度 2/5 1-3 小时 新手友好度 68/100
adafruit/circuitpython#11099 · 3 条评论 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 38/100
adafruit/circuitpython#11515 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 35/100
adafruit/circuitpython#11514 · 4 条评论 ·
维护者通常 1 天内回复
-
silabs
难度 5/5 一周以上 新手友好度 20/100
adafruit/circuitpython#11507 · 1 条评论 ·
维护者通常 1 天内回复
-
circuitpython api enhancement
难度 5/5 一周以上 新手友好度 25/100
adafruit/circuitpython#11505 · 5 条评论 ·
维护者通常 1 天内回复
查看 adafruit/circuitpython 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
openwrt/firmware-utils#82 ·
-
Discover carries headerEdges that nothing reads since #1914 moved E0507/E0517 to the compiler graph未关闭tech-debt
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
2个显示的问题未关闭
难度 2/5 1-3 小时 新手友好度 62/100
coolsnowwolf/lede#14209 ·
-
难度 1/5 1 小时以内 新手友好度 75/100
polhenarejos/pico-hsm#147 ·
-
难度 1/5 1 小时以内 新手友好度 85/100
OpenPrinting/cups#1746 ·
维护者通常 1 天内回复