stlink: handle error GET_IDCODE

When the connection with target is lost on the physical JTAG/SWD
link (either wire disconnected or DAP/TAP in reset), STLINK fail
to connect and returns error STLINK_JTAG_GET_IDCODE_ERROR.

Add it in the list of known errors.

Change-Id: Iabd6e6892111726f614345497d9286554bfe4ac0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4982
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
reverse-resume-order
Antonio Borneo 2019-02-05 11:25:19 +01:00 committed by Tomas Vanek
parent 5c55fbb065
commit 720380f9e3
1 changed files with 4 additions and 0 deletions

View File

@ -156,6 +156,7 @@ struct stlink_usb_handle_s {
#define STLINK_SWD_AP_FAULT 0x11 #define STLINK_SWD_AP_FAULT 0x11
#define STLINK_SWD_AP_ERROR 0x12 #define STLINK_SWD_AP_ERROR 0x12
#define STLINK_SWD_AP_PARITY_ERROR 0x13 #define STLINK_SWD_AP_PARITY_ERROR 0x13
#define STLINK_JTAG_GET_IDCODE_ERROR 0x09
#define STLINK_JTAG_WRITE_ERROR 0x0c #define STLINK_JTAG_WRITE_ERROR 0x0c
#define STLINK_JTAG_WRITE_VERIF_ERROR 0x0d #define STLINK_JTAG_WRITE_VERIF_ERROR 0x0d
#define STLINK_SWD_DP_WAIT 0x14 #define STLINK_SWD_DP_WAIT 0x14
@ -715,6 +716,9 @@ static int stlink_usb_error_check(void *handle)
case STLINK_SWD_DP_WAIT: case STLINK_SWD_DP_WAIT:
LOG_DEBUG("wait status SWD_DP_WAIT (0x%x)", STLINK_SWD_DP_WAIT); LOG_DEBUG("wait status SWD_DP_WAIT (0x%x)", STLINK_SWD_DP_WAIT);
return ERROR_WAIT; return ERROR_WAIT;
case STLINK_JTAG_GET_IDCODE_ERROR:
LOG_DEBUG("STLINK_JTAG_GET_IDCODE_ERROR");
return ERROR_FAIL;
case STLINK_JTAG_WRITE_ERROR: case STLINK_JTAG_WRITE_ERROR:
LOG_DEBUG("Write error"); LOG_DEBUG("Write error");
return ERROR_FAIL; return ERROR_FAIL;