Skip to content

feat: include serial number in list-ports output#998

Open
vfabr wants to merge 3 commits intoesp-rs:mainfrom
vfabr:feat-list-ports-serial
Open

feat: include serial number in list-ports output#998
vfabr wants to merge 3 commits intoesp-rs:mainfrom
vfabr:feat-list-ports-serial

Conversation

@vfabr
Copy link

@vfabr vfabr commented Jan 29, 2026

The current list-ports output lacks serial numbers, making it impossible to identify specific devices when multiple ESP32 are connected and now it is possible to get a port for the flash by PROBE.

$ probe-rs list  
The following debug probes were found:
[0]: ESP JTAG -- 303a:1001:B4:3A:45:AE:52:FC (EspJtag)
[1]: ESP JTAG -- 303a:1001:B8:F8:62:FC:17:8C (EspJtag)
$ espflash list-ports
/dev/ttyACM0  303A:1001:B4:3A:45:AE:52:FC          Espressif  USB JTAG/serial debug unit
/dev/ttyACM1  303A:1001:B8:F8:62:FC:17:8C          Espressif  USB JTAG/serial debug unit

Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I think it makes sense to add this information, but maybe on a different format? For USB-Serial/JTAG the format is good but for UART ports:
/dev/ttyUSB0 10C4:EA60:dc414a793059ed11a99bb5301d62bc44 Silicon Labs CP2102N USB to UART Bridge Controller

@vfabr
Copy link
Author

vfabr commented Jan 29, 2026

My problems are:
I wanted to get ability

  • to distinguish between several connected boards
  • to use a single one UNIQ for work with boards (run tests, flash firmware, flash storage, get additional info etc.)
    and representation like 303A:1001:B4:3A:45:AE:52:FC looks compatible with the probe-rs output

It seems JTAG serial_number based on MAC address and hardware burned into chip but USB_to_UART_Bridge may not have it or have the same. I've tried a few boards with USB and it looks like serial_number is not good choice here.

It looks indistinguishable

/dev/ttyUSB0  10C4:EA60:0001                       Silicon Labs  CP2102 USB to UART Bridge Controller
/dev/ttyUSB1  10C4:EA60:0001                       Silicon Labs  CP2102 USB to UART Bridge Controller

but interesting that Linux have the same problem

$ ls -la /dev/serial/by-path/
pci-0000:00:14.0-usb-0:5.3.1:1.0-port0 -> ../../ttyUSB1
pci-0000:00:14.0-usb-0:5.3.2:1.0-port0 -> ../../ttyUSB0

$ ls -la /dev/serial/by-id/
usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0 -> ../../ttyUSB1

$ ls -la /dev/ttyU*
/dev/ttyUSB0
/dev/ttyUSB1

compare with JTAG

$ ls -la /dev/serial/by-path/
pci-0000:00:14.0-usb-0:5.3.1:1.0 -> ../../ttyACM1
pci-0000:00:14.0-usb-0:5.3.2:1.0 -> ../../ttyACM0

$ ls -la /dev/serial/by-id/
usb-Espressif_USB_JTAG_serial_debug_unit_8C:D0:B2:A9:36:78-if00 -> ../../ttyACM0
usb-Espressif_USB_JTAG_serial_debug_unit_8C:D0:B2:A9:3F:5D-if00 -> ../../ttyACM1

$ ls -la /dev/ttyA*
/dev/ttyACM0
/dev/ttyACM1

I don't see any good solution for USB except to use MAC address for this aims. But it can be more complicated ... and I know nothing about the previous and next esp generations WROOM or P4 because I don't have it :))

For my current aims this is a good enough solution because I use only JTAG boards now. But I agree that could be more common and better implementation here. I need more time to try to do it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants