Repository navigation
Give Zephyr boards a USB serial number - #11579
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
cpu.uid, same after J-Link resetcpu.uidsame as on maincpu.uid, same after power cyclecpu.uidsame as on mainE6614103E7164037)cpu.uidEvery 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