From d13a6e44f0684a0fc5fb5ce241c14e7bdc0e4444 Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Tue, 7 Jul 2026 14:13:36 -0700 Subject: [PATCH] fix(bench): resolve board_id for labeled build targets --target px4_fmu-v6xrt_bench previously skipped the early board_id check because only bare vendor_model targets were known; a label selects a .px4board config within the same board, so strip it and resolve to the board dir. The uploader still enforces board_id against the bootloader at flash time. Signed-off-by: Ramon Roche --- Tools/bench_test/px4bench/firmware.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Tools/bench_test/px4bench/firmware.py b/Tools/bench_test/px4bench/firmware.py index d57eda50b7d..ffa19c68679 100644 --- a/Tools/bench_test/px4bench/firmware.py +++ b/Tools/bench_test/px4bench/firmware.py @@ -209,8 +209,18 @@ def infer_build_target(hw_arch, root=None): def board_id_for_target(target, root=None): - """Numeric board_id from boards///firmware.prototype.""" - mdir = list_board_targets(root).get(target) + """Numeric board_id from boards///firmware.prototype. + + Accepts labeled build targets too (px4_fmu-v6xrt_bench resolves to the + px4_fmu-v6xrt board dir): the label selects a .px4board config within + the same board, so the board_id is unchanged. + """ + targets = list_board_targets(root) + mdir = targets.get(target) + if mdir is None: + base = [t for t in targets if target.startswith(t + '_')] + if base: + mdir = targets[max(base, key=len)] if mdir is None: return None proto = os.path.join(mdir, 'firmware.prototype')