]> git.gag.com Git - fw/stlink/commitdiff
moved the device parameter loading at the end of initialization for V1 devices- fixed...
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Tue, 3 Jan 2012 22:52:44 +0000 (23:52 +0100)
committerFriedrich Beckmann <friedrich.beckmann@gmx.de>
Tue, 3 Jan 2012 22:52:44 +0000 (23:52 +0100)
src/stlink-sg.c

index e45fe48ed04e1258ab3cc8521e61fd2ecf517ce6..3d4a9b79882a9d3959732253b8d4dede9a82da27 100644 (file)
@@ -985,8 +985,6 @@ stlink_t* stlink_v1_open_inner(const int verbose) {
         return NULL;
     }
 
         return NULL;
     }
 
-    stlink_reset(sl);
-    stlink_load_device_params(sl);
     stlink_version(sl);
     if ((sl->version.st_vid != USB_ST_VID) || (sl->version.stlink_pid != USB_STLINK_PID)) {
         ugly_log(UERROR, LOG_TAG, 
     stlink_version(sl);
     if ((sl->version.st_vid != USB_ST_VID) || (sl->version.stlink_pid != USB_STLINK_PID)) {
         ugly_log(UERROR, LOG_TAG, 
@@ -1016,6 +1014,7 @@ stlink_t* stlink_v1_open_inner(const int verbose) {
             "WTF? successfully opened, but unable to read version details. BROKEN!\n");
         return NULL;
     }
             "WTF? successfully opened, but unable to read version details. BROKEN!\n");
         return NULL;
     }
+
     return sl;
 }
 
     return sl;
 }
 
@@ -1027,6 +1026,9 @@ stlink_t* stlink_v1_open(const int verbose) {
     }
     // by now, it _must_ be fully open and in a useful mode....
        stlink_enter_swd_mode(sl);
     }
     // by now, it _must_ be fully open and in a useful mode....
        stlink_enter_swd_mode(sl);
+    /* Now we are ready to read the parameters  */
+    stlink_reset(sl);
+    stlink_load_device_params(sl);
     ILOG("Successfully opened a stlink v1 debugger\n");
     return sl;
 }
     ILOG("Successfully opened a stlink v1 debugger\n");
     return sl;
 }