From 1c137bf07fb0e4e17acf73bb0229979971af7389 Mon Sep 17 00:00:00 2001 From: Timothy Lee Date: Wed, 14 Oct 2020 15:28:22 +1100 Subject: [PATCH] st-flash: respect --connect-under-reset option when opening USB connection --- src/st-flash/flash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/st-flash/flash.c b/src/st-flash/flash.c index 9116f9c80..d8bd8772c 100644 --- a/src/st-flash/flash.c +++ b/src/st-flash/flash.c @@ -61,7 +61,9 @@ int main(int ac, char** av) { printf("st-flash %s\n", STLINK_VERSION); - sl = stlink_open_usb(o.log_level, 1, (char *)o.serial, o.freq); + sl = stlink_open_usb(o.log_level, + o.connect_under_reset ? 2 : 1, + (char *)o.serial, o.freq); if (sl == NULL) { return(-1); }