summaryrefslogtreecommitdiff
path: root/tools/ci_select.py
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2026-08-28 14:16:02 +0700
committerGitHub <[email protected]>2026-08-28 14:16:02 +0700
commiteca6caf673452c8ec940e2acf5e46d0631fb72bf (patch)
treece197bf019b29712095c3768c0fc23b26499cc79 /tools/ci_select.py
parent4c7bb3ced98cb7262dd8eefd6c9f7df6e42ffcee (diff)
Add RTT console/capture tooling (tools/rtt.py), rtt skill, and HIL harness support (#3853)
Promote SEGGER RTT from an inline debugging technique to a standalone skill backed by one stdlib-only implementation in tools/rtt.py: a CLI and importable module for console/capture over J-Link (RTTTelnetPort) and OpenOCD (rtt server) probes, with probe selection by serial or VID:PID, control-block address via --elf or --addr, bidirectional console, post-mortem ring dump, and --reset-before-attach for boot-time capture. The HIL harness reads a board's console over RTT when its probe has no VCOM ("logger": "rtt" plus a LOGGER=rtt variant define), covering device_info, pool-check aliveness, and CI wiring. Validated on 22 boards across both backends; 26 unit tests run in pre-commit.
Diffstat (limited to 'tools/ci_select.py')
-rwxr-xr-xtools/ci_select.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/tools/ci_select.py b/tools/ci_select.py
index ca9d54c27..1526f2064 100755
--- a/tools/ci_select.py
+++ b/tools/ci_select.py
@@ -132,7 +132,11 @@ _METRICS_RE = re.compile(
r'^(tools/metrics[^/]*\.py$|\.github/scripts/metrics_[^/]*\.py$)')
_FULL_RE = re.compile(
r'^(src/common/|src/osal/|src/tusb\.c$|src/tusb\.h$|src/tusb_option\.h$|'
- r'test/hil/|\.github/workflows/build.*\.yml$|\.github/actions/|\.github/scripts/|'
+ # tools/rtt.py is part of the harness, not a standalone tool: hil_util imports it
+ # at module load, so a break in it breaks every rig run the same way a test/hil/
+ # edit can (the pre-commit hil-test hook runs its unit tests for the same reason)
+ r'test/hil/|tools/rtt\.py$|'
+ r'\.github/workflows/build.*\.yml$|\.github/actions/|\.github/scripts/|'
# generates the whole CircleCI matrix, same authority as .github/**
r'\.circleci/|'
# rule 16 says `tools/build*.py`; name the two siblings the glob implies. Both
@@ -764,6 +768,16 @@ def _classify_one(path, repo_root, roster_boards, extras: set, s: _Sel,
# only the tests whose example builds the lib, and only those the rig runs
tests = {e for e in lib_examples(lib, repo_root)
if any(e in pool for pool in ALL_TESTS.values()) or e in extras}
+ if lib == 'SEGGER_RTT':
+ # no example names this lib, but a board whose roster entry says
+ # "logger": "rtt" (variant defines LOGGER=rtt) reads EVERY test's console
+ # through it -- a break here silently breaks all of that board's rows
+ rtt_boards = [b['name'] for b in roster_boards if b.get('logger') == 'rtt']
+ if rtt_boards:
+ s.roles.update(('device', 'host'))
+ s.add(rtt_boards, 'all',
+ f'{path}: SEGGER_RTT is the rtt console on {rtt_boards} -> all tests')
+ return
if not tests:
s.reasons.append(f'{path}: lib {lib} used by no HIL test, no contribution')
return
@@ -1139,9 +1153,13 @@ def _classify_build_one(path, repo_root, s: _BSel, get_deps_families=None):
lib = m.group(1)
exs = lib_examples(lib, repo_root)
if not exs:
- # empty means empty: no example's build pulls this lib in, so no build
- # compiles it (lib/SEGGER_RTT is only reached through LOGGER=rtt, which
- # no CI build sets)
+ # empty means empty: no example's build pulls this lib in, so no MAIN-
+ # matrix build compiles it. (lib/SEGGER_RTT is reached through LOGGER=rtt,
+ # which the main matrix never sets; the hil-build legs set it only for
+ # roster boards whose variant defines carry it, via the HIL SEGGER_RTT rule.
+ # No committed CI roster has such a board yet, so a SEGGER_RTT edit is
+ # currently neither built nor HIL-tested by CI -- verify vendor bumps
+ # manually until a rig board adopts "logger": "rtt".)
s.reasons.append(f'{path}: lib {lib} built by no example, no contribution')
return
s.add(all_bsp_families(repo_root), exs, f'{path}: lib {lib} -> {sorted(exs)}')