Repository navigation
device/serial: reopen the port after USB re-enumeration - #36
Merged
Merged
Conversation
A board whose console is USB CDC/ACM drops its serial port on every reset and re-creates it once it boots again. The serial device kept the stale handle, so every read and write after a reboot failed, and start failed when the port did not exist yet. A failed read or write now closes the port and reopens it, and the health check retries until the port is back. Start no longer requires the port to exist; the boot wait reopens it when the device enumerates. Signed-off-by: raiden00pl <raiden00@railab.me> Assisted-by: Claude Code:claude-opus-5-5
raiden00pl
requested review from
acassis,
cederom,
simbit18 and
xiaoxiang781216
October 13, 2026 10:33
xiaoxiang781216
approved these changes
Oct 13, 2026
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.
A board whose console is USB CDC/ACM drops its serial port on every reset and re-creates it once it boots again. The serial device kept the stale handle, so every read and write after a reboot failed, and start failed when the port did not exist yet.
A failed read or write now closes the port and reopens it, and the health check retries until the port is back. Start no longer requires the port to exist; the boot wait reopens it when the device enumerates.