Skip to content
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

add usb pid for st-link v2.1, found on nucleo l432kc #900

Merged
merged 2 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions etc/udev/rules.d/49-stlinkv2-1.rules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \
MODE:="0666", \
SYMLINK+="stlinkv2-1_%n"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3752", \
MODE:="0666", \
SYMLINK+="stlinkv2-1_%n"

# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
Expand Down
1 change: 1 addition & 0 deletions include/stlink/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extern "C" {
#define STLINK_USB_PID_STLINK_32L 0x3748
#define STLINK_USB_PID_STLINK_32L_AUDIO 0x374a
#define STLINK_USB_PID_STLINK_NUCLEO 0x374b
#define STLINK_USB_PID_STLINK_V2_1 0x3752
#define STLINK_USB_PID_STLINK_V3_USBLOADER 0x374d
#define STLINK_USB_PID_STLINK_V3E_PID 0x374e
#define STLINK_USB_PID_STLINK_V3S_PID 0x374f
Expand Down
6 changes: 5 additions & 1 deletion src/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@ stlink_t *stlink_open_usb(enum ugly_loglevel verbose, bool reset, char serial[ST
if ((desc.idProduct == STLINK_USB_PID_STLINK_32L) ||
(desc.idProduct == STLINK_USB_PID_STLINK_NUCLEO) ||
(desc.idProduct == STLINK_USB_PID_STLINK_32L_AUDIO) ||
(desc.idProduct == STLINK_USB_PID_STLINK_V2_1) ||
(desc.idProduct == STLINK_USB_PID_STLINK_V3_USBLOADER) ||
(desc.idProduct == STLINK_USB_PID_STLINK_V3E_PID) ||
(desc.idProduct == STLINK_USB_PID_STLINK_V3S_PID) ||
Expand All @@ -957,7 +958,8 @@ stlink_t *stlink_open_usb(enum ugly_loglevel verbose, bool reset, char serial[ST

if ((desc.idProduct == STLINK_USB_PID_STLINK_32L)
|| (desc.idProduct == STLINK_USB_PID_STLINK_NUCLEO)
|| (desc.idProduct == STLINK_USB_PID_STLINK_32L_AUDIO)) {
|| (desc.idProduct == STLINK_USB_PID_STLINK_32L_AUDIO)
|| (desc.idProduct == STLINK_USB_PID_STLINK_V2_1)) {
sl->version.stlink_v = 2;
} else if ((desc.idProduct == STLINK_USB_PID_STLINK_V3_USBLOADER)
|| (desc.idProduct == STLINK_USB_PID_STLINK_V3E_PID)
Expand Down Expand Up @@ -1032,6 +1034,7 @@ stlink_t *stlink_open_usb(enum ugly_loglevel verbose, bool reset, char serial[ST
slu->ep_rep = 1 /* ep rep */ | LIBUSB_ENDPOINT_IN;
if (desc.idProduct == STLINK_USB_PID_STLINK_NUCLEO ||
desc.idProduct == STLINK_USB_PID_STLINK_32L_AUDIO ||
desc.idProduct == STLINK_USB_PID_STLINK_V2_1 ||
desc.idProduct == STLINK_USB_PID_STLINK_V3_USBLOADER ||
desc.idProduct == STLINK_USB_PID_STLINK_V3E_PID ||
desc.idProduct == STLINK_USB_PID_STLINK_V3S_PID ||
Expand Down Expand Up @@ -1115,6 +1118,7 @@ static size_t stlink_probe_usb_devs(libusb_device **devs, stlink_t **sldevs[]) {
if (desc.idProduct != STLINK_USB_PID_STLINK_32L &&
desc.idProduct != STLINK_USB_PID_STLINK_32L_AUDIO &&
desc.idProduct != STLINK_USB_PID_STLINK_NUCLEO &&
desc.idProduct != STLINK_USB_PID_STLINK_V2_1 &&
desc.idProduct != STLINK_USB_PID_STLINK_V3_USBLOADER &&
desc.idProduct != STLINK_USB_PID_STLINK_V3E_PID &&
desc.idProduct != STLINK_USB_PID_STLINK_V3S_PID &&
Expand Down