stlink_usb.c: Decode some more errors. 06/2706/2
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Thu, 9 Apr 2015 13:55:17 +0000 (15:55 +0200)
committerPaul Fertser <fercerpav@gmail.com>
Thu, 16 Apr 2015 19:30:16 +0000 (20:30 +0100)
Change-Id: I637cb63bd39120554aa184eaa48fd00a4852359f
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/2706
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/jtag/drivers/stlink_usb.c

index 9818dda..18498dd 100644 (file)
@@ -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;