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 <mrpollo@gmail.com>
This commit is contained in:
Ramon Roche
2026-07-07 14:13:36 -07:00
parent cabda5ade3
commit d13a6e44f0

View File

@@ -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/<vendor>/<model>/firmware.prototype."""
mdir = list_board_targets(root).get(target)
"""Numeric board_id from boards/<vendor>/<model>/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')