Add option to not reset board on connect
[fw/stlink] / src / stlink-usb.c
index 9895da85573c166209767513ae97ae8d300cfb7a..858361c6695a2d65affe60f8aa32f163e1c5ba5d 100644 (file)
@@ -704,7 +704,7 @@ stlink_backend_t _stlink_usb_backend = {
 };
 
 
-stlink_t* stlink_open_usb(const int verbose) {
+stlink_t* stlink_open_usb(const int verbose, int reset) {
     stlink_t* sl = NULL;
     struct stlink_libusb* slu = NULL;
     int error = -1;
@@ -833,7 +833,9 @@ stlink_t* stlink_open_usb(const int verbose) {
       stlink_enter_swd_mode(sl);
     }
 
-    stlink_reset(sl);
+    if (reset) {
+        stlink_reset(sl);
+    }
     stlink_load_device_params(sl);
     stlink_version(sl);