From 601d4d332967608ff49742942946ccb09e81a42a Mon Sep 17 00:00:00 2001 From: mlundinse Date: Sat, 15 Aug 2015 19:42:52 +0200 Subject: [PATCH] Make _stlink_usb_reset use hardreset --- src/stlink-common.h | 1 + src/stlink-usb.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stlink-common.h b/src/stlink-common.h index 76f977e..9268da2 100644 --- a/src/stlink-common.h +++ b/src/stlink-common.h @@ -68,6 +68,7 @@ extern "C" { #define STLINK_DEBUG_WRITEDEBUGREG 0x0f #define STLINK_DEBUG_ENTER_SWD 0xa3 #define STLINK_DEBUG_ENTER_JTAG 0x00 +#define STLINK_DEBUG_HARDRESET 0x3c // TODO - possible poor names... #define STLINK_SWD_ENTER 0x30 diff --git a/src/stlink-usb.c b/src/stlink-usb.c index d8b6c46..47924c7 100644 --- a/src/stlink-usb.c +++ b/src/stlink-usb.c @@ -413,7 +413,8 @@ void _stlink_usb_reset(stlink_t * sl) { int i = fill_command(sl, SG_DXFER_FROM_DEV, rep_len); cmd[i++] = STLINK_DEBUG_COMMAND; - cmd[i++] = STLINK_DEBUG_RESETSYS; + cmd[i++] = STLINK_DEBUG_HARDRESET; + cmd[i++] = 0x2; size = send_recv(slu, 1, cmd, slu->cmd_len, data, rep_len); if (size == -1) {