From 4ed3a1efa2e653836133cabddb0a7e50150b3bd4 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Thu, 9 Apr 2015 15:55:17 +0200 Subject: [PATCH] stlink_usb.c: Decode some more errors. Change-Id: I637cb63bd39120554aa184eaa48fd00a4852359f Signed-off-by: Uwe Bonnes Reviewed-on: http://openocd.zylin.com/2706 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/jtag/drivers/stlink_usb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c index 9818dda6..18498dd2 100644 --- a/src/jtag/drivers/stlink_usb.c +++ b/src/jtag/drivers/stlink_usb.c @@ -135,6 +135,8 @@ struct stlink_usb_handle_s { #define STLINK_DEBUG_ERR_OK 0x80 #define STLINK_DEBUG_ERR_FAULT 0x81 #define STLINK_SWD_AP_WAIT 0x10 +#define STLINK_JTAG_WRITE_ERROR 0x0c +#define STLINK_JTAG_WRITE_VERIF_ERROR 0x0d #define STLINK_SWD_DP_WAIT 0x14 #define STLINK_CORE_RUNNING 0x80 @@ -390,6 +392,12 @@ static int stlink_usb_error_check(void *handle) case STLINK_SWD_DP_WAIT: LOG_DEBUG("wait status SWD_DP_WAIT (0x%x)", STLINK_SWD_AP_WAIT); return ERROR_WAIT; + case STLINK_JTAG_WRITE_ERROR: + LOG_DEBUG("Write error"); + return ERROR_FAIL; + case STLINK_JTAG_WRITE_VERIF_ERROR: + LOG_DEBUG("Verify error"); + return ERROR_FAIL; default: LOG_DEBUG("unknown/unexpected STLINK status code 0x%x", h->databuf[0]); return ERROR_FAIL; -- 2.39.5