From: Greg Meiste Date: Wed, 27 May 2015 15:12:40 +0000 (-0500) Subject: Fix issue where "unknown chip id!" is seen every other time X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=ff40ab6681591efa23d1068faae3417ff75d2393;p=fw%2Fstlink Fix issue where "unknown chip id!" is seen every other time 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 --- diff --git a/src/stlink-usb.c b/src/stlink-usb.c index 546f722..0911ff7 100644 --- a/src/stlink-usb.c +++ b/src/stlink-usb.c @@ -6,6 +6,7 @@ #include #include #include +#include #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);