Skip to content

makefiles/serial: better MOST_RECENT_PORT=1 for CDC ACM #20951

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

Merged

Conversation

maribu
Copy link
Member

@maribu maribu commented Nov 5, 2024

  • Allow specifying an alternative board filter for the bootloader TTY, as this will present different vendor, model, and serial than RIOT's USB implementation.
  • Allow specifying the serial. This is useful when multiple CDC ACM devices are present.

Contribution description

Testing procedure

Connect multiple boards of the same type that use CDC ACM for stdio and get their serials:

$ make -C examples/default BOARD=wemos-zero list-ttys
make: Entering directory '/home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/examples/default'
path         | driver  | vendor      | model      | model_db | serial           | ctime    | iface_num
-------------|---------|-------------|------------|----------|------------------|----------|----------
/dev/ttyACM0 | cdc_acm | RIOT-os.org | wemos-zero | None     | A76A64C0D0458F79 | 13:20:37 | 0        
/dev/ttyACM1 | cdc_acm | RIOT-os.org | wemos-zero | None     | 65C57FC58B0D266F | 13:20:41 | 0        

Run make term passing SERIAL=... for the first board:

$ make -C examples/default BOARD=wemos-zero SERIAL=65C57FC58B0D266F term
make: Entering directory '/home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/examples/default'
/home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/dist/tools/pyterm/pyterm -p "/dev/ttyACM1" -b "115200" -ln "/tmp/pyterm-marian.buschsieweke@ml-pa.loc" -rn "2024-11-05_13.20.56-default-wemos-zero"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2024-11-05 13:20:56,101 # Connect to serial port /dev/ttyACM1

Same for the second:

$ make -C examples/default BOARD=wemos-zero SERIAL=A76A64C0D0458F79 term
make: Entering directory '/home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/examples/default'
/home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" -ln "/tmp/pyterm-marian.buschsieweke@ml-pa.loc" -rn "2024-11-05_13.21.07-default-wemos-zero"  
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2024-11-05 13:21:07,813 # Connect to serial port /dev/ttyACM0

Check that the correct /dev/ttyACM<NUM> devices is selected.

Issues/PRs references

None

- Allow specifying an alternative board filter for the bootloader TTY,
  as this will present different vendor, model, and serial than RIOT's
  USB implementation.
- Allow specifying the serial. This is useful when multiple CDC ACM
  devices are present.
@maribu maribu added Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 5, 2024
@maribu maribu requested a review from fabian18 November 5, 2024 12:27
@github-actions github-actions bot added Area: tools Area: Supplementary tools Area: boards Area: Board ports labels Nov 5, 2024
@riot-ci
Copy link

riot-ci commented Nov 5, 2024

Murdock results

✔️ PASSED

fdac725 makefiles/serial: better MOST_RECENT_PORT=1 for CDC ACM

Success Failures Total Runtime
10215 0 10215 16m:16s

Artifacts

Copy link
Contributor

@fabian18 fabian18 left a comment

Choose a reason for hiding this comment

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

Very convenient. Thank you.

@maribu maribu added this pull request to the merge queue Nov 10, 2024
Merged via the queue into RIOT-OS:master with commit 5d76abf Nov 10, 2024
28 checks passed
@maribu maribu deleted the makefiles/improve-tty-select-cmd-handling branch November 11, 2024 06:11
@maribu
Copy link
Member Author

maribu commented Nov 11, 2024

Thx!

@MrKevinWeiss MrKevinWeiss added this to the Release 2025.01 milestone Jan 20, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants