From 142392e355e795120203fec99bb98f3ddc686655 Mon Sep 17 00:00:00 2001 From: Chris Reed Date: Fri, 21 Jul 2023 15:42:06 -0500 Subject: [PATCH] probe: cmsis-dap: use test binary from builtin board data for v2.1 based board info If a CMSIS-DAP probe supports the v2.1 board and target info, but the board also has builtin board ID based data, then use the test binary name from the builtin data with the probe-supplied data. --- pyocd/probe/cmsis_dap_probe.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyocd/probe/cmsis_dap_probe.py b/pyocd/probe/cmsis_dap_probe.py index 42cbe46f6..8ef53da21 100644 --- a/pyocd/probe/cmsis_dap_probe.py +++ b/pyocd/probe/cmsis_dap_probe.py @@ -238,7 +238,11 @@ def associated_board_info(self) -> Optional["BoardInfo"]: assert target_device_name board = "Generic " + (part_number or target_device_name) - info = BoardInfo(name=board, target=target_device_name, vendor=vendor) + # If we also have the ID based info, then use the test binary from that. + binary_name = info.binary if (info is not None) else None + + # Create a new board info object with the data from the probe. + info = BoardInfo(name=board, target=target_device_name, vendor=vendor, binary=binary_name) return info