Francesco Mattioli
Francesco Mattioli

Reputation: 44

How to identify the serial port of a specific Raspberry Pi Pico by changing ProductID

I am writing drivers to communicate with a raspberry Pi Pico through serial communication. The Raspberry Pi Pico software is written in MicroPython (rp2 port) . I need to identify when a specific Raspberry Pi Pico device is connected to the computer, I thought to do this by modifying The Vendor ID or/and the Product ID of the device, how can I do this? I have already looked inside the Micropython source but couldn't find which constants to modify. Does anyone know a solution?

EDIT

As @David Grayson pointed out I cannot change DEVICE ID and VENDOR ID. What if I want to change the device description instead? So that doing `lsusb' result in a more informative description. I currently get the following for my board.

...
Bus 005 Device 004: ID 2e8a:0005 MicroPython Board in FS mode
...

Can I change the description (MicroPython Board in FS mode) in some way?

Upvotes: 1

Views: 1555

Answers (1)

David Grayson
David Grayson

Reputation: 87486

The latest versions of the MicroPython RP2 port expose the unique ID of the flash chip as a USB serial number, so you should be able to just use the serial number to find your specific device. Linux makes it really easy by providing symbolic links in /dev/serial/by-id, but it is also possible in macOS and Windows.

Upvotes: 1

Related Questions