From a5e5eecd3331f8755274f2834ba9655b3dcb9aa2 Mon Sep 17 00:00:00 2001 From: "Garrett L. Ward" Date: Sat, 12 Jul 2025 14:59:12 -0400 Subject: [PATCH] west: Look for STM32_Programmer_CLI in PATH on macOS On Windows and Linux, the stm32cubeprogrammer runner will use STM32_Programmer_CLI from PATH if it is available, but this was not implemented on macOS. Add PATH lookup for macOS as well, using the same approach as Windows and Linux. Fixes zephyrproject-rtos/zephyr#93056 Signed-off-by: Garrett L. Ward --- scripts/west_commands/runners/stm32cubeprogrammer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/west_commands/runners/stm32cubeprogrammer.py b/scripts/west_commands/runners/stm32cubeprogrammer.py index 1335fa3c66e9..3584b666154f 100644 --- a/scripts/west_commands/runners/stm32cubeprogrammer.py +++ b/scripts/west_commands/runners/stm32cubeprogrammer.py @@ -122,6 +122,10 @@ def _get_stm32cubeprogrammer_path() -> Path: return Path(os.environ["PROGRAMW6432"]) / cli if platform.system() == "Darwin": + cmd = shutil.which("STM32_Programmer_CLI") + if cmd is not None: + return Path(cmd) + return ( Path("/Applications") / "STMicroelectronics"