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

[feature] Added support for STLINK-V3PWR #1389

Merged
merged 1 commit into from
Apr 26, 2024
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
7 changes: 6 additions & 1 deletion config/udev/rules.d/49-stlinkv3.rules
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", \
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", \
MODE:="0666", \
SYMLINK+="stlinkv3_%n"


# STLink V3PWR
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3757", \
MODE:="0666", \
SYMLINK+="stlinkv3_%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
3 changes: 2 additions & 1 deletion src/stlink-lib/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,8 @@ stlink_t *stlink_open_usb(enum ugly_loglevel verbose, enum connect_type connect,
desc.idProduct == STLINK_USB_PID_STLINK_V3E_PID ||
desc.idProduct == STLINK_USB_PID_STLINK_V3S_PID ||
desc.idProduct == STLINK_USB_PID_STLINK_V3_2VCP_PID ||
desc.idProduct == STLINK_USB_PID_STLINK_V3_NO_MSD_PID) {
desc.idProduct == STLINK_USB_PID_STLINK_V3_NO_MSD_PID ||
desc.idProduct == STLINK_USB_PID_STLINK_V3P) {
slu->ep_req = 1 /* ep req */ | LIBUSB_ENDPOINT_OUT;
slu->ep_trace = 2 | LIBUSB_ENDPOINT_IN;
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/stlink-lib/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define STLINK_USB_PID_STLINK_V3S_PID 0x374f
#define STLINK_USB_PID_STLINK_V3_2VCP_PID 0x3753
#define STLINK_USB_PID_STLINK_V3_NO_MSD_PID 0x3754
#define STLINK_USB_PID_STLINK_V3P 0x3757

#define STLINK_V1_USB_PID(pid) ((pid) == STLINK_USB_PID_STLINK)

Expand All @@ -36,7 +37,8 @@
(pid) == STLINK_USB_PID_STLINK_V3E_PID || \
(pid) == STLINK_USB_PID_STLINK_V3S_PID || \
(pid) == STLINK_USB_PID_STLINK_V3_2VCP_PID || \
(pid) == STLINK_USB_PID_STLINK_V3_NO_MSD_PID)
(pid) == STLINK_USB_PID_STLINK_V3_NO_MSD_PID || \
(pid) == STLINK_USB_PID_STLINK_V3P)

#define STLINK_SUPPORTED_USB_PID(pid) (STLINK_V1_USB_PID(pid) || \
STLINK_V2_USB_PID(pid) || \
Expand Down
Loading