west: runners: stm32cubeprogrammer: Fixed behaivor if programmer is in path

Enabled west commands to use CubeProgrammer installed in custom directory.

Signed-off-by: Moritz Geier <moritz.geier@proton.me>
This commit is contained in:
Moritz Geier 2024-06-21 14:18:38 +02:00 committed by Anas Nashif
parent b0936ae353
commit da87952948
1 changed files with 4 additions and 0 deletions

View File

@ -85,6 +85,10 @@ class STM32CubeProgrammerBinaryRunner(ZephyrBinaryRunner):
)
if platform.system() == "Windows":
cmd = shutil.which("STM32_Programmer_CLI")
if cmd is not None:
return Path(cmd)
cli = (
Path("STMicroelectronics")
/ "STM32Cube"