usb.core.find() fails
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- embedded-iot
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C
- Star
- 4.6k
- Fork
- 1.4k
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 161
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của adafruit/circuitpython
-
Web Workflow Locks UpĐang mởbug esp32 web workflow
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
adafruit/circuitpython#11616 · 9 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
nordic
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
adafruit/circuitpython#11611 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
zephyr: REPL on console?Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
adafruit/circuitpython#11606 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
busio zephyr
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
adafruit/circuitpython#11605 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
busio zephyr
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 28/100
adafruit/circuitpython#11604 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của adafruit/circuitpython
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
gbdev/homebrewhub-submit#20 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OpenPrinting/cups#1772 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
snowballstem/snowball#311 ·