scripts/pylib/twister: Add sn option to stm32cubeprogrgammer runner

In order to enable use of stm32cubeprogrammer runner with twister,
add "sn" tool specific option which allows to provide target serial
number and hence select the target to flash when multiple ones are
connected to the host.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2021-12-13 17:27:06 +01:00 committed by Christopher Friedt
parent 9e4edaec21
commit 652eb37b4d
1 changed files with 2 additions and 0 deletions

View File

@ -773,6 +773,8 @@ class DeviceHandler(Handler):
command_extra_args.append("cmsis_dap_serial %s" % (board_id))
elif runner == "jlink":
command.append("--tool-opt=-SelectEmuBySN %s" % (board_id))
elif runner == "stm32cubeprogrammer":
command.append("--tool-opt=sn=%s" % (board_id))
if command_extra_args != []:
command.append('--')