Skip to content

Commit

Permalink
Updated USB endpoints for Nucleo boards.
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoussin committed Jun 16, 2014
1 parent 5f519d8 commit 025da6b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion QStlink2.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ win32:CONFIG += winusb

TEMPLATE = app
TARGET = qstlink2
VERSION = 1.1.3
VERSION = 1.1.4

message(Version $$VERSION)

Expand Down
2 changes: 1 addition & 1 deletion QtUsb
Submodule QtUsb updated 4 files
+1 −1 qbaseusb.cpp
+7 −0 qbaseusb.h
+10 −3 qlibusb.cpp
+33 −13 qwinusb.cpp
1 change: 1 addition & 0 deletions inc/stlinkv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const quint16 USB_NUCLEO_PID = 0x374b;
const quint8 USB_CONFIGURATION = 1; /* The sole configuration. */
const quint8 USB_PIPE_IN = 0x81; /* Bulk output endpoint for responses */
const quint8 USB_PIPE_OUT = 0x02; /* Bulk input endpoint for commands */
const quint8 USB_PIPE_OUT_NUCLEO = 0x01; /* Bulk input endpoint for commands */
const quint8 USB_PIPE_ERR = 0x83; /* An apparently-unused bulk endpoint. */
const quint16 USB_TIMEOUT_MSEC = 300;
const QString USB_STLINK_GUID = "DBCE1CD9-A320-4b51-A365-A0C3F3C5FB29";
Expand Down
6 changes: 6 additions & 0 deletions src/stlinkv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ stlinkv2::~stlinkv2()

qint32 stlinkv2::connect()
{
if (mUsb->getPid() == USB_STLINKv2_PID)
mUsb->setEndPoints(USB_PIPE_IN, USB_PIPE_OUT);

else if (mUsb->getPid() == USB_NUCLEO_PID)
mUsb->setEndPoints(USB_PIPE_IN, USB_PIPE_OUT_NUCLEO);

qint32 open = mUsb->open();
if ((open >= 0)) {
mUsb->read(&mRecvBuf, 2048); // We clean the usb buffer
Expand Down

0 comments on commit 025da6b

Please sign in to comment.