-
Notifications
You must be signed in to change notification settings - Fork 2k
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
buid system: improve serial port selection #18167
Merged
Merged
Conversation
This file contains 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
maribu
added
Type: enhancement
The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Area: tools
Area: Supplementary tools
CI: skip compile test
If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs
labels
Jun 3, 2022
github-actions
bot
added
Area: boards
Area: Board ports
Area: build system
Area: Build system
labels
Jun 3, 2022
maribu
commented
Jun 3, 2022
maribu
force-pushed
the
dist/tools/usb-serial/ttys.py
branch
from
June 3, 2022 17:57
c6948ea
to
6f35842
Compare
The shorten() function was previously used to fit in overlong entries into the table. But since it is no longer used, it can be dropped.
This is useful when a debugger provides multiple serial interfaces, e.g. one to control the debugger and one as UART bridge.
When `MOST_RECENT_PORT` is set to `1`, the most recently added USB serial is selected. This is a crude but surprisingly effective filter. However, for the CC2560-Launchpad this doesn't work, as it provides two USB serials. The first USB serial interface is the targeted UART bridge and the second controls the debugger. Since the second is added a tiny fraction after the first, this reliably selects the wrong interface. Allowing the board to filter USB serials first can avoid this issue. This is also useful as e.g. an STM Nucleo board can easily be told apart from an `samr21-xpro` or an nRF52840dk using such filters.
maribu
force-pushed
the
dist/tools/usb-serial/ttys.py
branch
from
June 3, 2022 17:59
6f35842
to
2235874
Compare
benpicco
approved these changes
Jun 6, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty neat - and since this only affects runs with MOST_RECENT_PORT=1
set it will barely be noticed 😉
Thx! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: boards
Area: Board ports
Area: build system
Area: Build system
Area: tools
Area: Supplementary tools
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
CI: skip compile test
If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs
Type: enhancement
The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
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.
Contribution description
dist/tools/usb-serial/ttys.py
with a--ifcae-num
parameterTTY_BOARD_FILTER
to let boards provide flags fordist/tools/usb-serial/ttys.py
to filter only matching USB serialsMOST_RECENT_PORT=1
is enabled, this will fist apply the filter and select the most recent port of the matching USB serials (if more than one)TTY_BOARD_FILTER
for a couple of boardssame54-xpro
,nrf52840dk
,nucleo-f767zi
, and acc2650-launchpad
plugged in andmake BOARD=<foo> MOST_RECENT_PORT=1 term
will always pick the right USB serialTesting procedure
Plug in a Nucleo, a
samr21-xpro
(orsame54-xpro
), a random Nucleo, a cc2650-launchpad, and a nRF52840DK.make BOARD=<foo> MOST_RECENT_PORT=1 term
should always pick the right board, no matter which order the boards were plugged in.(I tested this successfully :))
Issues/PRs references
None