From ff40ab6681591efa23d1068faae3417ff75d2393 Mon Sep 17 00:00:00 2001 From: Greg Meiste Date: Wed, 27 May 2015 10:12:40 -0500 Subject: [PATCH] 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 --- src/stlink-usb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stlink-usb.c b/src/stlink-usb.c index 546f722ea..0911ff7b9 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);