Skip to content

Conversation

maribu
Copy link
Member

@maribu maribu commented Jun 2, 2025

Contribution description

This adds a default TTY_BOARD_FILTER for use with the Tigard debugger, so that when the programmer is a Tigard that tigard is also used by default for the serial connection.

In addition, this allows selecting the TTY via the programmer serial number.

Testing procedure

make term with multiple /dev/ttyUSB* present but only one Tigard connected should reliably select the Tigards UART with MOST_RECENT_PORT=1 and the Tigard selected as program adapter.

Issues/PRs references

None

@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 2, 2025
@github-actions github-actions bot added Area: build system Area: Build system Area: tools Area: Supplementary tools labels Jun 2, 2025
@riot-ci
Copy link

riot-ci commented Jun 2, 2025

Murdock results

✔️ PASSED

41fd70e build-sytem/openocd: detect serial port TTY

Success Failures Total Runtime
10379 0 10379 10m:59s

Artifacts

@crasbe crasbe added the Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation label Jun 2, 2025
Copy link
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

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

I wonder if the added code wouldn't be more at home in makefiles/tools/openocd-adapters/ftdi.inc.mk.

Since MOST_RECENT_PORT, OPENOCD_FTDI_ADAPTER and SERIAL are command line arguments, I don't see a reason why it wouldn't work there.

maribu and others added 2 commits June 16, 2025 09:09
This allows the serial PORT selection to make use of info provided by
the programmer. This is especially useful when a programmer provides both
programming interface (e.g. SWD) and a serial (e.g. intraged USB-UART
bridge or exposes SWO logging as a TTY).
This adds a default `TTY_BOARD_FILTER` for use with the Tigard debugger,
so that when the programmer is a Tigard that tigard is also used by
default for the serial connection.

In addition, this allows selecting the TTY via the programmer serial
number.

Co-authored-by: crasbe <crasbe@gmail.com>
@maribu maribu force-pushed the build-system/openocd/tigard/tty-detection branch from 573a2b6 to 41fd70e Compare June 16, 2025 07:10
@maribu
Copy link
Member Author

maribu commented Jun 16, 2025

I wonder if the added code wouldn't be more at home in makefiles/tools/openocd-adapters/ftdi.inc.mk.

Done. I had to change the order the serial and the programmer config are processes, so that by the time serial.inc.mk is processed the info about the Tigard is available.

I'll do some quick regression testing for a few boards. I have the feeling that boards with a bootloader that supports programming via UART might rely on the other order and now needs fixing.

@maribu
Copy link
Member Author

maribu commented Jun 16, 2025

No regressions on arduino-mega2560, wemos-zero and msba2. Those are already the three different "flash via serial" bootloader types that come to my mind.

I guess changing the order to first process the programmer then the serial is fine. (And that change will also make life easier for adding support for SWO to RIOT, so it is not only beneficial for this use case.)

@maribu maribu added this pull request to the merge queue Jun 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 16, 2025
@crasbe crasbe added this pull request to the merge queue Jun 16, 2025
Merged via the queue into RIOT-OS:master with commit b1296af Jun 16, 2025
26 checks passed
@maribu maribu deleted the build-system/openocd/tigard/tty-detection branch June 16, 2025 12:47
@maribu
Copy link
Member Author

maribu commented Jun 16, 2025

Thx a lot :)

@Teufelchen1 Teufelchen1 added this to the Release 2025.07 milestone Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants