Entering SWIM mode on ST-LINK does not update swim status word.

As a consequence of a previous failed SWIM command any
subsequent attempts to enter SWIM mode fails. Change
stlink_usb_mode_enter to use stlink_usb_xfer_noerrcheck
instead.

Change-Id: I5c6a1a8e68d3dc77ec37264880383366fa6a75d9
Signed-off-by: Ake Rehnman <ake.rehnman@gmail.com>
Reviewed-on: http://openocd.zylin.com/5547
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Ake Rehnman 2020-03-29 12:13:18 +02:00 committed by Antonio Borneo
parent 68e200c660
commit b9a30e0892
1 changed files with 2 additions and 3 deletions

View File

@ -1230,9 +1230,8 @@ static int stlink_usb_mode_enter(void *handle, enum stlink_mode type)
case STLINK_MODE_DEBUG_SWIM:
h->cmdbuf[h->cmdidx++] = STLINK_SWIM_COMMAND;
h->cmdbuf[h->cmdidx++] = STLINK_SWIM_ENTER;
/* no answer for this function... */
rx_size = 0;
break;
/* swim enter does not return any response or status */
return stlink_usb_xfer_noerrcheck(handle, h->databuf, 0);
case STLINK_MODE_DFU:
case STLINK_MODE_MASS:
default: