Skip to content

Commit a926e94

Browse files
authored
probe: Vega VT-LinkII support (#1341)
1 parent 1334c88 commit a926e94

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

pyocd/probe/pydapaccess/interface/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Copyright (c) 2019-2021 Arm Limited
33
# Copyright (c) 2021 mentha
44
# Copyright (c) 2021 Chris Reed
5+
# Copyright (c) 2022 Harper Weigle
56
# SPDX-License-Identifier: Apache-2.0
67
#
78
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -46,6 +47,7 @@
4647
CYPRESS_VID = 0x04b4
4748
KEIL_VID = 0xc251
4849
NXP_VID = 0x1fc9
50+
VEGA_VID = 0x30cc
4951

5052
# USB VID/PID pairs.
5153
ARM_DAPLINK_ID: VidPidPair = (ARM_VID, 0x0204) # Arm DAPLink firmware
@@ -72,6 +74,7 @@
7274
(CYPRESS_VID, 0xf155), # Cypress KitProg3 bulk
7375
(CYPRESS_VID, 0xf166), # Cypress KitProg3 bulk with 2x UART
7476
(KEIL_VID, 0x2750), # Keil ULINKplus
77+
(VEGA_VID, 0x9527), # Vega VT-LinkII
7578
NXP_LPCLINK2_ID,
7679
NXP_MCULINK_ID,
7780
]

pyocd/probe/pydapaccess/interface/hidapi_backend.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# pyOCD debugger
22
# Copyright (c) 2006-2020 Arm Limited
33
# Copyright (c) 2021 Chris Reed
4+
# Copyright (c) 2022 Harper Weigle
45
# SPDX-License-Identifier: Apache-2.0
56
#
67
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,6 +26,7 @@
2526
from .common import (
2627
filter_device_by_usage_page,
2728
generate_device_unique_id,
29+
is_known_cmsis_dap_vid_pid,
2830
)
2931
from ..dap_access_api import DAPAccessIntf
3032
from ....utility.compatibility import to_str_safe
@@ -115,7 +117,8 @@ def get_all_connected_interfaces():
115117

116118
for deviceInfo in devices:
117119
product_name = to_str_safe(deviceInfo['product_string'])
118-
if ("CMSIS-DAP" not in product_name):
120+
known_cmsis_dap = is_known_cmsis_dap_vid_pid(deviceInfo['vendor_id'], deviceInfo['product_id'])
121+
if ("CMSIS-DAP" not in product_name) and (not known_cmsis_dap):
119122
# Check the device path as a backup. Even though we can't get the interface name from
120123
# hidapi, it may appear in the path. At least, it does on macOS.
121124
device_path = to_str_safe(deviceInfo['path'])

pyocd/probe/pydapaccess/interface/pyusb_backend.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Copyright (c) 2020 Patrick Huesmann
44
# Copyright (c) 2021 mentha
55
# Copyright (c) 2021 Chris Reed
6+
# Copyright (c) 2022 Harper Weigle
67
# SPDX-License-Identifier: Apache-2.0
78
#
89
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -336,14 +337,16 @@ def __call__(self, dev):
336337
if filter_device_by_class(dev.idVendor, dev.idProduct, dev.bDeviceClass):
337338
return False
338339

340+
known_cmsis_dap = is_known_cmsis_dap_vid_pid(dev.idVendor, dev.idProduct)
339341
try:
340342
# First attempt to get the active config. This produces a more direct error
341343
# when you don't have device permissions on Linux
342344
config = dev.get_active_configuration()
343345

346+
344347
# Now read the product name string.
345348
device_string = dev.product
346-
if (device_string is None) or ("CMSIS-DAP" not in device_string):
349+
if ((device_string is None) or ("CMSIS-DAP" not in device_string)) and (not known_cmsis_dap):
347350
return False
348351

349352
# Get count of HID interfaces.
@@ -360,7 +363,7 @@ def __call__(self, dev):
360363
(error, dev.idVendor, dev.idProduct))
361364
# If we recognize this device as one that should be CMSIS-DAP, we can raise
362365
# the level of the log message since it's almost certainly a permissions issue.
363-
if is_known_cmsis_dap_vid_pid(dev.idVendor, dev.idProduct):
366+
if known_cmsis_dap:
364367
LOG.warning(msg)
365368
else:
366369
LOG.debug(msg)

pyocd/probe/pydapaccess/interface/pywinusb_backend.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# pyOCD debugger
22
# Copyright (c) 2006-2020 Arm Limited
33
# Copyright (c) 2021 Chris Reed
4+
# Copyright (c) 2022 Harper Weigle
45
# SPDX-License-Identifier: Apache-2.0
56
#
67
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,6 +23,7 @@
2223
from .common import (
2324
filter_device_by_usage_page,
2425
generate_device_unique_id,
26+
is_known_cmsis_dap_vid_pid,
2527
)
2628
from ..dap_access_api import DAPAccessIntf
2729
from ....utility.timeout import Timeout
@@ -103,7 +105,8 @@ def get_all_connected_interfaces():
103105
# find devices with good vid/pid
104106
all_mbed_devices = []
105107
for d in all_devices:
106-
if ("CMSIS-DAP" in d.product_name):
108+
known_cmsis_dap = is_known_cmsis_dap_vid_pid(d.vendor_id, d.product_id)
109+
if ("CMSIS-DAP" in d.product_name) or known_cmsis_dap:
107110
all_mbed_devices.append(d)
108111

109112
boards = []

udev/49-vtlinkii.rules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 30cc:9527 Essemi ESLinkII
2+
ATTR{idVendor}=="30cc", ATTR{idProduct}=="9527", MODE="666"
3+

0 commit comments

Comments
 (0)