You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many different devkits have USB-TO-UART chips with the same VID:PID, Name, SN identificators.
Build test farms (i.e. NuttX RTOS) that have many devkits connected via USB-TO-SERIAL adapters may not use boards with the same identification strings because often serial port device (i.e. /dev/cuaU*) numbers are assigned randomly on attach. Problem is even worse then 16 port USB HUBs are used with dynamic port power cycling.
It would be great to have ability to customize USB-TO-SERIAL chips (i.e. VID:PID, Name, SN) built directly into the pyserial.
It would enable easy identification of various develkits using the same USB-TO-UART chips based on unique VID:PID, Name, and SN and help in build/runtime testing automation.
I found two reference utilitities that can customize CP2102 chip:
cp210x-cfg works fine and allows Name and SN change to CP2102 on the ESP32-DevKitC several times.
For sure this functionality as described for CP2102 would be also nice to have for other vendors / chips like CH34XX and I think maybe there is a way to convince vendors to develop them? :-)
% uname -a
FreeBSD octagon 13.3-RELEASE-p7 FreeBSD 13.3-RELEASE-p7 GENERIC amd64
% ./cp210x-cfg
ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller
Model: CP2102
Vendor ID: 10c4
Product ID: ea60
Name: CP2102 USB to UART Bridge Controller
Serial: 0001
% dd if=/dev/random count=1M | md5
1048576+0 records in
1048576+0 records out
76f24aad88225fedf7260bb4f54c525d
536870912 bytes transferred in 3.788303 secs (141718053 bytes/sec)
% ./cp210x-cfg -h
Syntax:
cp210x-cfg [-h ] |
[-m vid:pid] [-d bus:dev]
[ -l | [-V vid] [-P pid] [-F flush] [-M mode] [-N name] [-S serial]]
-h This help
-m vid:pid Find and use first device with vid:pid
-d bus:dev Find and use device at bus:dev
-l List all CP210x devices connected
-V vid Program the given Vendor ID
-P pid Program the given Product ID
-F flush Program the given buffer flush bitmap (CP2105 only)
-M mode Program the given SCI/ECI mode (CP2105 only)
-N name Program the given product name string
-S serial Program the given serial string
Unless the -d option is used, the first found CP210x device is used.
If no programming options are used, the current values are printed.
% ./cp210x-cfg -S 76f24aad88225fedf7260bb4f54c525d
ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller
Model: CP2102
Vendor ID: 10c4
Product ID: ea60
Name: CP2102 USB to UART Bridge Controller
Serial: 76f24aad88225fedf7260bb4f54c525d
% ./cp210x-cfg
ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller
Model: CP2102
Vendor ID: 10c4
Product ID: ea60
Name: CP2102 USB to UART Bridge Controller
Serial: 76f24aad88225fedf7260bb4f54c525d
% ./cp210x-cfg -N ESP32DEVKITC-CDR-76f24aad88225fedf7260bb4f54c525d
ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller
Model: CP2102
Vendor ID: 10c4
Product ID: ea60
Name: ESP32DEVKITC-CDR-76f24aad88225fedf7260bb4f54c525d
Serial: ESP32DEVKITC-CDR-76f24aad88225fedf7260bb4f54c525d
% ./cp210x-cfg -N ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
ID 10c4:ea60 @ bus 000, dev 007:
ESP32DEVKITC-CDR-76f24aad88225fedf7260bb4f54c525d
Model: CP2102
Vendor ID: 10c4
Product ID: ea60
Name: ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
Serial: ESP32DEVKITC-CDR-76f24aad88225fedf7260bb4f54c525d
% ./cp210x-cfg
ID 10c4:ea60 @ bus 000, dev 007:
ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
Model: CP2102
Vendor ID: 10c4
Product ID: ea60
Name: ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
Serial: ESP32DEVKITC-CDR-76f24aad88225fedf7260bb4f54c525d
% ./cp210x-cfg -S ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
ID 10c4:ea60 @ bus 000, dev 007:
ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
Model: CP2102
Vendor ID: 10c4
Product ID: ea60
Name: ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
Serial: ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
% ./cp210x-cfg
ID 10c4:ea60 @ bus 000, dev 007:
ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
Model: CP2102
Vendor ID: 10c4
Product ID: ea60
Name: ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
Serial: ESP32DEVKITC-CeDeROM-76f24aad88225fedf7260bb4f54c525d
Hello world :-)
/dev/cuaU*
) numbers are assigned randomly on attach. Problem is even worse then 16 port USB HUBs are used with dynamic port power cycling.pyserial
.cp210x-cfg
works fine and allows Name and SN change to CP2102 on the ESP32-DevKitC several times.This issue has been cloned from: pyserial#779
The text was updated successfully, but these errors were encountered: