Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7503

MicroPython • Multiple CDC ports in Micropython for RP2040 based board

$
0
0
Hello everyone,

Not sure if this is the right place, but I thought I might try here after seeing this post viewtopic.php?t=305834.

I’m working on a project that uses RP2040‑based boards with CircuitPython/MicroPython.

Initially I developed the firmware in CircuitPython, but I had to switch to MicroPython because CircuitPython does not support hardware interrupts and the “pseudo‑interrupt” mechanism provided by the countio module is limited to a few pins, which does not match the hardware configuration of one of our PCB.

I’m now trying to reproduce a feature that was pretty straightforward in CircuitPython: exposing two CDC (USB serial) ports to the host PC. One port would be used for flashing and REPL access, and the other would serve as a data channel for sending/receiving commands.

In CircuitPython this is handled by the usb_cdc module, which provides separate console and data instances that can be imported and used directly. Unfortunately, MicroPython does not include an equivalent usb_cdc module. I tried downloading the latest picopy variant posted in the forum thread I linked above, but the import failed with the following error:

Code:

***** FAILED *****Importing to core/modsys.cNot found 'MP_QSTR_micropython'Source   : ./fix/branding.fixDesc     : Branding fixFile     : modsys.cFind     : MP_QSTR_micropythonWas      : MP_QSTR_micropythonNow      : MP_QSTR_picopython***** FAILED *****
I briefly modified the import code to adapt to my project structure and to remove the sudo calls.

Could anyone point me to a current solution or suggest how to implement dual CDC ports on an RP2040 board under MicroPython?
I'm afraid getting this script to work for the current version of MicroPython might be a rabbit hole and I humbly ask for any guidance or clues beforehand.

Statistics: Posted by goboe — Mon Jan 19, 2026 3:30 pm — Replies 1 — Views 28



Viewing all articles
Browse latest Browse all 7503

Trending Articles