Skip to content

Commit f63bc32

Browse files
committed
CMSIS-DAP: update list of known CMSIS-DAP probes.
- Add Cypress KitProg and MiniProg4, Atmel-ICE, and NXP MCU-Link to list of known CMSIS-DAP probes. - Add NXP MCU-Link to list of probes to filter by HID usage page. - Update udev rules correspondingly. - Update list of probes in readme.
1 parent f7484ee commit f63bc32

File tree

4 files changed

+69
-16
lines changed

4 files changed

+69
-16
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ Requirements
6363
- A recent version of [libusb](https://libusb.info/). See [libusb installation](#libusb-installation) for details.
6464
- Microcontroller with an Arm Cortex-M CPU
6565
- Supported debug probe
66-
- [CMSIS-DAP](http://www.keil.com/pack/doc/CMSIS/DAP/html/index.html) v1 (HID),
67-
such as:
68-
- An on-board debug probe using [DAPLink](https://os.mbed.com/handbook/DAPLink) firmware.
66+
- [CMSIS-DAP](http://www.keil.com/pack/doc/CMSIS/DAP/html/index.html) v1 (HID), such as:
67+
- An on-board or standalone debug probe using [DAPLink](https://os.mbed.com/handbook/DAPLink) firmware.
6968
- NXP LPC-LinkII
70-
- [CMSIS-DAP](http://www.keil.com/pack/doc/CMSIS/DAP/html/index.html) v2 (WinUSB),
71-
such as:
69+
- NXP MCU-Link
70+
- Atmel-ICE
71+
- [CMSIS-DAP](http://www.keil.com/pack/doc/CMSIS/DAP/html/index.html) v2 (WinUSB), such as:
7272
- [DAPLink](https://os.mbed.com/handbook/DAPLink) firmware version 0254 or newer.
73-
- Cypress KitProg3
73+
- Cypress KitProg3 or MiniProg4
7474
- Keil ULINKplus
7575
- SEGGER J-Link (experimental)
7676
- STLinkV2 or STLinkV3, either on-board or the standalone versions.

pyocd/probe/pydapaccess/interface/common.py

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pyOCD debugger
2-
# Copyright (c) 2019 Arm Limited
2+
# Copyright (c) 2019-2020 Arm Limited
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,16 +30,39 @@
3030

3131
CMSIS_DAP_HID_USAGE_PAGE = 0xff00
3232

33-
# Various known USB VID/PID values.
34-
ARM_DAPLINK_ID = (0x0d28, 0x0204)
35-
KEIL_ULINKPLUS_ID = (0xc251, 0x2750)
36-
NXP_LPCLINK2_ID = (0x1fc9, 0x0090)
33+
# Known USB VID/PID pairs.
34+
ARM_DAPLINK_ID = (0x0d28, 0x0204) # Arm DAPLink firmware
35+
ATMEL_ICE_ID = (0x03eb, 0x2141) # Atmel-ICE
36+
CYPRESS_KITPROG1_2_ID = (0x04b4, 0xf138) # Cypress KitProg1, KitProg2 in CMSIS-DAP mode
37+
CYPRESS_MINIPROG4_BULK_ID = (0x04b4, 0xf151) # Cypress MiniProg4 bulk
38+
CYPRESS_MINIPROG4_HID_ID = (0x04b4, 0xf152) # Cypress MiniProg4 HID
39+
CYPRESS_KITPROG3_HID_ID = (0x04b4, 0xf154) # Cypress KitProg3 HID
40+
CYPRESS_KITPROG3_BULKD_ID = (0x04b4, 0xf155) # Cypress KitProg3 bulk
41+
CYPRESS_KITPROG3_BULK_2_UART_ID = (0x04b4, 0xf166) # Cypress KitProg3 bulk with 2x UART
42+
KEIL_ULINKPLUS_ID = (0xc251, 0x2750) # Keil ULINKplus
43+
NXP_LPCLINK2_ID = (0x1fc9, 0x0090) # NXP LPC-LinkII
44+
NXP_MCULINK_ID = (0x1fc9, 0x0143) # NXP MCU-Link
3745

3846
## List of VID/PID pairs for known CMSIS-DAP USB devices.
3947
KNOWN_CMSIS_DAP_IDS = [
4048
ARM_DAPLINK_ID,
49+
ATMEL_ICE_ID,
50+
CYPRESS_KITPROG1_2_ID,
51+
CYPRESS_MINIPROG4_BULK_ID,
52+
CYPRESS_MINIPROG4_HID_ID,
53+
CYPRESS_KITPROG3_HID_ID,
54+
CYPRESS_KITPROG3_BULKD_ID,
55+
CYPRESS_KITPROG3_BULK_2_UART_ID,
4156
KEIL_ULINKPLUS_ID,
4257
NXP_LPCLINK2_ID,
58+
NXP_MCULINK_ID,
59+
]
60+
61+
## List of VID/PID pairs for CMSIS-DAP probes that have multiple HID interfaces that must be
62+
# filtered by usage page. Currently these are only NXP probes.
63+
CMSIS_DAP_IDS_TO_FILTER_BY_USAGE_PAGE = [
64+
NXP_LPCLINK2_ID,
65+
NXP_MCULINK_ID,
4366
]
4467

4568
def is_known_cmsis_dap_vid_pid(vid, pid):
@@ -75,7 +98,7 @@ def filter_device_by_usage_page(vid, pid, usage_page):
7598
@retval True Skip the device.
7699
@retval False The device is valid.
77100
"""
78-
return ((vid, pid) == NXP_LPCLINK2_ID) \
101+
return ((vid, pid) in CMSIS_DAP_IDS_TO_FILTER_BY_USAGE_PAGE) \
79102
and (usage_page != CMSIS_DAP_HID_USAGE_PAGE)
80103

81104
def check_ep(interface, ep_index, ep_dir, ep_type):

udev/50-cmsis-dap.rules

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# 04b4:f138 Cypress KitProg1/KitProg2 CMSIS-DAP mode
2+
SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="f138", MODE:="666"
3+
4+
# 04b4:f151 Cypress MiniProg4 CMSIS-DAPv2 Bulk + I2C/SPI/UART
5+
SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="f151", MODE:="666"
6+
7+
# 04b4:f152 Cypress MiniProg4 CMSIS-DAPv1 HID + I2C/SPI/UART
8+
SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="f152", MODE:="666"
9+
10+
# 04b4:f154 Cypress KitProg3 CMSIS-DAPv1 HID + I2C/SPI/UART
11+
SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="f154", MODE:="666"
12+
13+
# 04b4:f155 Cypress KitProg3 CMSIS-DAPv2 Bulk + I2C/SPI/UART
14+
SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="f155", MODE:="666"
15+
16+
# 04b4:f166 Cypress KitProg3 CMSIS-DAPv2 Bulk + 2xUART
17+
SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="f166", MODE:="666"
18+
119
# 0d28:0204 DAPLink
220
SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", ATTR{idProduct}=="0204", MODE:="666"
321

@@ -7,5 +25,13 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="c251", ATTR{idProduct}=="2750", MODE:="666"
725
# 1fc9:0090 NXP LPC-LinkII
826
SUBSYSTEM=="usb", ATTR{idVendor}=="1fc9", ATTR{idProduct}=="0090", MODE:="666"
927

28+
# 1fc9:0143 NXP MCU-Link
29+
SUBSYSTEM=="usb", ATTR{idVendor}=="1fc9", ATTR{idProduct}=="0143", MODE:="666"
30+
1031
# 03eb:2141 Atmel-ICE CMSIS-DAP
1132
SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="2141", MODE:="666"
33+
34+
# If you share your linux system with other users, or just don't like the
35+
# idea of write permission for everybody, you can replace MODE:="0666" with
36+
# OWNER:="yourusername" to create the device owned by you, or with
37+
# GROUP:="somegroupname" and mange access using standard unix groups.

udev/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ discouraged.
88

99
The following debug probes are supported:
1010

11+
- Cypress KitProg1/KitProg2 in CMSIS-DAP mode
12+
- Cypress KitProg3
13+
- Cypress MiniProg4
1114
- DAPLink
1215
- STLinkV2
1316
- STLinkV2-1
1417
- STLinkV3
1518
- Keil ULINKplus
1619
- NXP LPC-LinkII
20+
- NXP MCU-Link
1721

1822

1923
To install, copy the rules files in this directory to `/etc/udev/rules.d/` on Ubuntu:
@@ -38,9 +42,9 @@ $ sudo udevadm control --reload
3842
$ sudo udevadm trigger
3943
```
4044

41-
By default, the rules provide open access to the debug probes for all users. If you share your Linux
42-
system with other users, or just don't like the idea of write permission for everybody, you can
43-
replace `MODE:="0666"` with `OWNER:="yourusername"` to create the device owned by you, or with
44-
`GROUP:="somegroupname"` and mange access using standard Unix groups.
45+
By default, the rules provide open access to the debug probes for all users (0666 permissions).
46+
If you share your Linux system with other users, or just don't like the idea of write permission
47+
for everybody, you can replace `MODE:="0666"` with `OWNER:="yourusername"` to create the device
48+
owned by you, or with `GROUP:="somegroupname"` and mange access using standard Unix groups.
4549

4650
_Note: STLink rules provided courtesy of STMicroelectronics._

0 commit comments

Comments
 (0)