Repository navigation
Serial monitor: choose and check the baud rate on a UART - #16
Merged
Merged
Conversation
Without -b, the monitor starts on a UART (a USB-UART adapter or a non-USB port) at the most likely rate: the built firmware's console rate (CONFIG_ESP_CONSOLE_UART_BAUDRATE in build/<SysType>/raft/sdkconfig when the console is on a UART), the rate last found working on the adapter (remembered in the user's config folder, monitor_bauds.json, by USB IDs and serial number), the -b given last time (raft.info), then 115200. While the output is unreadable (the byte patterns a UART gives at the wrong rate, no log lines) for over 0.5 s, other rates are tried until log text is readable; once readable only 3 s of unreadable output changes it, so binary bursts and the boot ROM's 115200 output after a reset don't. Changes are shown in the output and log. -b on the command line is used as it is; the ESP32's native USB (vid 303a) ignores the rate and isn't checked. Under WSL, -b is passed to raft.exe only when given so that raft.exe (which can identify the adapter) chooses the rate. Tests use a simulated UART receiving at the wrong rates. README: Monitor baud rate. Co-Authored-By: Claude Opus 5.5 <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.
Summary
The serial monitor now chooses the baud rate itself, and checks it, when
-bisn't given. This applies toraft monitorand to the monitor at the end ofraft run.303a) ignores the rate and isn't checked.-bgiven: that rate is used and never changed.CONFIG_ESP_CONSOLE_UART_BAUDRATEinbuild/<SysType>/raft/sdkconfig, when the console is on a UART)-bfrom last time (raft.info)-b, a rate saved inraft.infois now only a starting point and no longer fixes the rate.monitor_bauds.jsonin the user's config folder (~/.config/raft, or%APPDATA%\rafton Windows).-bis passed toraft.exeonly when given. Otherwiseraft.exechooses the rate, because only it can identify the adapter.README: new Monitor baud rate section. The
-bhelp text was updated formonitorandrun.Testing
cargo test: 162 passed, 15 of them new. A simulated UART receiving at the wrong rate covers 12 rate pairs, plus the detector, a reset during boot, a binary burst, the starting-rate order, sdkconfig parsing and the adapter store.raft.exebuilt from this branch, and resets through the Axiom's USB port.-b 921600: stayed at 921600, unreadable as expectedraft.exe: started at 921600 from the build's console settingThis PR and #15 both change the
runhandler inmain.rs, so whichever merges second needs a small conflict fixed.🤖 Generated with Claude Code