The number of USB devices you can have active at once is limited. Here we'll explain the limitations.
CircuitPython LimitationsYou can specify no more than eight HID devices in total. In addition, you can only define a single composite HID device, though you may be able to define more in the future.
Hardware LimitationsMicrocontrollers provide a limited number of USB endpoints. This is a hardware limitation. An endpoint is a single low-level USB communications channel. Typically endpoints are paired. Each endpoint pair has an IN endpoint and OUT endpoint. The naming is from the point of view of the host: IN means sending data from device to the host; OUT means sending data from the host to the device.
Endpoint pairs are numbered starting at 0. Endpoint pair 0 is always reserved for USB setup and control, so we can't use it for regular devices.
Each separate USB device needs to use one or more endpoint pairs. Here are the endpoint requirements for the devices we provide:
console
and data
usb_cdc
devices in CircuitPython, 2+2=4 pairs are needed in total.So if all these devices are enabled, including both usb_cdc
devices, you'll need 1+1+2+2+1=7 endpoint pairs.
The SAMD21, SAMD51, nRF52840, and RP2040 microcontrollers all provide 8 endpoint pairs each. since pair 0 is reserved, 7 pairs are available, and so enabling all the devices above just fits.
However, other microcontrollers provide fewer than 8 pairs:
console
and data
, you would have to turn everything else off, including CIRCUITPY.If your boot.py settings turn on too many devices, CircuitPython will go into safe mode after running boot.py, and will not run code.py. If you go into the REPL, you will see CircuitPython reporting the reason it is in safe mode, such as "USB devices need more endpoints than are available".
Page last edited February 18, 2025
Text editor powered by tinymce.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4