MicroPython is set to get official support for turning a Raspberry Pi Pico or other RP2040-based gadget into a USB Device — thanks to a new feature

MicroPython Plans a New Feature for the Raspberry Pi RP2040: Runtime-Defined USB Device Support

submited by
Style Pass
2024-03-30 11:30:04

MicroPython is set to get official support for turning a Raspberry Pi Pico or other RP2040-based gadget into a USB Device — thanks to a new feature expected to land in the v1.23 release, in a breaking change that will likely require existing USB projects to be reworked.

" USBDevice provides a low-level Python API [Application Programming Interface] for implementing USB device functions using Python code," the MicroPython documentation explains of the upcoming support. "This low-level API assumes familiarity with the USB standard. It’s not recommended to use this API directly, instead install the high-level usbd module from micropython-lib. This functionality is very new and the high-level usbd module is not yet merged into micropython-lib."

The Raspberry Pi RP2040 microcontroller, as found at the heart of the Raspberry Pi Pico development board and its radio-equipped Pico W sibling, has long supported acting as a USB Device — but that functionality has never been readily accessible to MicroPython users. The new USB driver functionality changes that, making it possible to turn the Raspberry Pi Pico or any other RP2040 board into a custom USB device defined at runtime.

Leave a Comment