Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

west: add monitor feature with options #97955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sylvioalves wants to merge 1 commit into zephyrproject-rtos:main
base: main
Choose a base branch
Loading
from sylvioalves:feature/west-monitor

Conversation

@sylvioalves
Copy link
Contributor

@sylvioalves sylvioalves commented Oct 21, 2025
edited
Loading

Add serial monitor for Zephyr with:

  • Auto-reconnect on USB disconnect
  • Automatic addr2line decoding from build/CMakeCache.txt
  • Custom vendor profiles
  • Reset control via DTR/RTS lines

More details in #97954

nashif reacted with thumbs up emoji bricle reacted with hooray emoji bricle reacted with rocket emoji kartben and ZhaoxiangJin reacted with eyes emoji
Copy link
Contributor Author

I will also provide test_monitor.py.

commands:
- name: monitor
class: Monitor
help: Serial monitor for Zephyr
Copy link
Contributor

Choose a reason for hiding this comment

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

Use same style as other help texts, i.e. start with a lowercase verb

sylvioalves reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

as mentioned, this needs to start with a lowercase verb

Copy link
Contributor

Choose a reason for hiding this comment

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

"monitor serial output from a board" probably works :)

Copy link
Contributor Author

@sylvioalves sylvioalves Oct 21, 2025
edited
Loading

Choose a reason for hiding this comment

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

I did update this when you commented. Outdated file I guess. I'll re-word on next push.

VENDOR_PROFILES_ERR = None

try:
from .profiles import PROFILES as VENDOR_PROFILES
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't dived into the code yet, but why do you approach this with a "profiles" mechanism? Isn't it possible to have a similar working like runners with sub-classes?

Copy link
Contributor Author

@sylvioalves sylvioalves Oct 21, 2025

Choose a reason for hiding this comment

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

Will also evaluate this, sounds good.

pdgendt reacted with thumbs up emoji
Copy link
Contributor Author

@sylvioalves sylvioalves Oct 21, 2025

Choose a reason for hiding this comment

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

@pdgendt So you mean having modules files like espressif.py as vendor profile sub-class instead of a common profiles.py? The custom vendor profile here is just a default set of configurations to be used when west monitor is called - to avoid lots of arguments - which differs a bit from current runners with sub-classes do. I mean, runner extend various options for the particular vendor where the goal here isn't to extend arguments but set the default ones.

Add serial monitor for Zephyr with:
- Auto-reconnect on USB disconnect
- Automatic addr2line decoding from build/CMakeCache.txt
- Custom vendor profiles
- Reset control via DTR/RTS lines
- Ctrl-R to reset, Ctrl-] to exit
Usage:
 west monitor # Basic monitor
 west monitor --decode # With address decoding
 west monitor --vendor espressif # Vendor defaults
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Copy link

Copy link
Contributor Author

sylvioalves commented Oct 21, 2025
edited
Loading

PR now only needs adjustments in the "profile/vendor" configuration. Will hold continuing with additional updates until we get a clear review on whether this can indeed be merged/maintained or not. In negative response, we can close it.

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

While this is nice, I think we need a discussion on whether this is something we want/need to maintain in-tree when external, maintained alternatives already exist. See the comments on #97954 (comment) an onwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@henrikbrixandersen henrikbrixandersen henrikbrixandersen requested changes

@carlescufi carlescufi Awaiting requested review from carlescufi

@marc-hb marc-hb Awaiting requested review from marc-hb

@mbolivar mbolivar Awaiting requested review from mbolivar

@swinslow swinslow Awaiting requested review from swinslow

@keith-zephyr keith-zephyr Awaiting requested review from keith-zephyr

@nashif nashif Awaiting requested review from nashif

@kartben kartben Awaiting requested review from kartben

@pdgendt pdgendt Awaiting requested review from pdgendt

Requested changes must be addressed to merge this pull request.

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add monitor serial support over west

AltStyle によって変換されたページ (->オリジナル) /