]> git.gag.com Git - fw/stlink/commitdiff
Fix issue where "unknown chip id!" is seen every other time
authorGreg Meiste <w30289@motorola.com>
Wed, 27 May 2015 15:12:40 +0000 (10:12 -0500)
committerGreg Meiste <w30289@motorola.com>
Mon, 1 Feb 2016 14:44:45 +0000 (08:44 -0600)
Previously when running the program, reading the chip version
would fail. Running the program a second time worked. This
sequence is repeated the next time st-flash/st-util is run.

Giving reset 10ms to complete before trying to read the chip
version resolves the issue.

Signed-off-by: Greg Meiste <w30289@motorola.com>
src/stlink-usb.c

index 546f722ea45c89d079086be140567dd78543e622..0911ff7b939b05bf47a9340763c0b377c31a32e0 100644 (file)
@@ -6,6 +6,7 @@
 #include <sys/types.h>
 #include <libusb.h>
 #include <errno.h>
+#include <unistd.h>
 
 #include "stlink-common.h"
 #include "stlink-usb.h"
@@ -879,6 +880,7 @@ stlink_t* stlink_open_usb(const int verbose, int reset, char *p_usb_iserial) {
 
     if (reset) {
         stlink_reset(sl);
+        usleep(10000);
     }
     stlink_version(sl);
     error = stlink_load_device_params(sl);