-
Notifications
You must be signed in to change notification settings - Fork 8.3k
runners: stm32cubeprogrammer: add support for --dev-id #100220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
runners: stm32cubeprogrammer: add support for --dev-id #100220
Conversation
Add support for the standard `--dev-id` argument used to select target ST-Link debug probe based on serial number. Note that this could already be achieved using custom argument `--conn-modifiers`. (`--dev-id <XXX>` is equivalent to `--conn-modifiers sn=<XXX>`) Signed-off-by: Mathieu Choplain <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's migrate Twister hardware adapter script to make use of this new option instead of current tool-opt.
|
+ zephyr/scripts/pylib/twister/twisterlib/handlers.py Lines 640 to 641 in 1a49b41
|
erwango
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making #100220 (review) blocking.
Now that the STM32CubeProgrammer runner supports the standard `--dev-id` argument, replace usage of `--tool-opt` in the pytest harness hardware adapter. Signed-off-by: Mathieu Choplain <[email protected]>
Now that the STM32CubeProgrammer runner supports the standard `--dev-id` argument, replace usage of `--tool-opt` in the Twister device handler code. Signed-off-by: Mathieu Choplain <[email protected]>
7195e1d
|
Updated (hopefully) all places making use of |
|
|
About CI failures:
is entirely out of my control. How can I override CI to ignore this false positive? Or is it a legitimate error?
I understand CI wants - elif runner == 'jlink':
+ elif runner == 'jlink' or (runner == 'stm32cubeprogrammer' and self.device_config.product != "BOOT-SERIAL"):
base_args.append('--dev-id')
base_args.append(board_id)
- elif runner == 'stm32cubeprogrammer' and self.device_config.product != "BOOT-SERIAL":
- base_args.append('--dev-id')
- base_args.append(board_id)I have no problem with this but it would create an inconsistency. Should I do it anyways? Or should another solution be adopted? One idea that comes to mind is unifying all "conforming" runners under a single if board_id := self.device_config.id:
if runner == 'pyocd':
extra_args.append('--board-id')
extra_args.append(board_id)
elif runner == "esp32":
extra_args.append("--esp-device")
extra_args.append(board_id)
- elif runner in ('nrfjprog', 'nrfutil', 'nrfutil_next'):
- extra_args.append('--dev-id')
- extra_args.append(board_id)
elif runner == 'openocd' and self.device_config.product in ['STM32 STLink', 'STLINK-V3']:
extra_args.append('--cmd-pre-init')
extra_args.append(f'hla_serial {board_id}')
elif runner == 'openocd' and self.device_config.product == 'EDBG CMSIS-DAP':
extra_args.append('--cmd-pre-init')
extra_args.append(f'cmsis_dap_serial {board_id}')
elif runner == "openocd" and self.device_config.product == "LPC-LINK2 CMSIS-DAP":
extra_args.append("--cmd-pre-init")
extra_args.append(f'adapter serial {board_id}')
- elif runner == 'jlink':
- base_args.append('--dev-id')
- base_args.append(board_id)
elif runner == 'stm32cubeprogrammer' and self.device_config.product != "BOOT-SERIAL":
base_args.append('--dev-id')
base_args.append(board_id)
elif runner == 'linkserver':
base_args.append(f'--probe={board_id}')
+ else:
+ # 'nrfjprog', 'nrfutil', 'nrfutil_next', 'jlink'
+ base_args.append('--dev-id')
+ base_args.append(board_id)(We could also hardcode I'll let maintainers decide 🙂 |



Add support for the standard
--dev-idargument used to select target ST-Link debug probe based on serial number. Note that this could already be achieved using custom argument--conn-modifiers. (--dev-id <XXX>is equivalent to--conn-modifiers sn=<XXX>)