Skip to content

Give Zephyr boards a USB serial number - #11579

Merged
dhalbert merged 1 commit into
adafruit:mainfrom
mikeysklar:zephyr-cp-usb-serial-pr
Oct 13, 2026
Merged

dhalbert merged 1 commit into
adafruit:mainfrom
mikeysklar:zephyr-cp-usb-serial-pr

Conversation

@mikeysklar

Copy link
Copy Markdown
Collaborator

What

Zephyr boards now report a USB serial number, taken from the chip's unique ID.

Why

Without one, a computer cannot tell two identical boards apart.

Board Test Result
nRF54LM20 DK Serial shown, matches cpu.uid, same after J-Link reset 6/6
nRF54LM20 DK cpu.uid same as on main yes
Pico W Serial shown, matches cpu.uid, same after power cycle 6/6
Pico W cpu.uid same as on main yes
Pico W Serial same as stock CircuitPython (E6614103E7164037) yes
Feather nRF52840, FRDM-MCXN947 Build only builds
Pico 2 W Build only; serial will be the flash chip ID, like cpu.uid builds

Every Zephyr board here with USB has an ID driver.

The guard only matters for future boards without one.

Pico W ran with #11570 added, so it could be reflashed.

Written with Claude; tested on hardware by me.

🤖 Generated with Claude Code

zephyr-cp boards enumerate with no iSerial, so a host cannot tell two
identical boards apart and udev's /dev/serial/by-id names collide. The
TinyUSB ports report the chip's unique ID there.

Add Zephyr's serial number string descriptor, which the USB device stack
fills from hwinfo_get_device_id() (CONFIG_HWINFO is already on in
prj.conf). Only add it when the SoC has a hwinfo driver; without one the
stack logs an error and the descriptor request fails.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@dhalbert
dhalbert merged commit 53caded into adafruit:main Oct 13, 2026
48 checks passed
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.

2 participants