-
Notifications
You must be signed in to change notification settings - Fork 18
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
trunner: add multi possible device search for targets #376
base: master
Are you sure you want to change the base?
Conversation
d8b023b
to
a750e03
Compare
all_ports = list_ports.comports() | ||
vid_pid_list = vid_pid_parser(port_hint) | ||
ports = [] | ||
|
||
for port in all_ports: | ||
for vid, pid in vid_pid_list: | ||
if port.vid == vid and port.pid == pid: | ||
ports.append(port) |
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.
all_ports = list_ports.comports() | |
vid_pid_list = vid_pid_parser(port_hint) | |
ports = [] | |
for port in all_ports: | |
for vid, pid in vid_pid_list: | |
if port.vid == vid and port.pid == pid: | |
ports.append(port) | |
vid_pid_list = vid_pid_parser(port_hint) | |
ports = [port for port in list_ports.comports() if (port.vid, port.pid) in vid_pid_list] |
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.
It seems to be simple, so I'd prefer to use this version
a750e03
to
8efe664
Compare
def find_port(port_hint: str) -> str: | ||
port = None | ||
|
||
for p in list_ports.grep(port_hint): |
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.
After some thinking, we can simply pass a part of port name, which is correct for both older and newer board. For older the device string from list_ports()
is:
/dev/ttyACM0 - DAPLink CMSIS-DAP - mbed Serial Port
for newer one:
/dev/ttyACM0 - MCU-LINK on-board (r0E2) CMSIS-DAP V2.250 - VCOM
So I propose looking for CMSIS-DAP
for armv7m7 targets. Then all this additional code is not needed.
JIRA: CI-500
Description
In replace target to new version, there was problem with new device ID and vendor ID.
That means we are forced to replace it in target variables, but we want also have the possibility to run older versions of the boards. That's why we want to utilize multiple possible vid/pid configuration to the same target.
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment