st-util: Fix for connecting to running devices
authorGreg Meiste <w30289@motorola.com>
Mon, 1 Feb 2016 15:08:59 +0000 (09:08 -0600)
committerGreg Meiste <w30289@motorola.com>
Mon, 1 Feb 2016 15:08:59 +0000 (09:08 -0600)
Previously, even with the reset enabled, st-util would not connect
to a target if it was running. This change will reset the chip
when opening the connection, which allows st-util to connect
successfully.

Signed-off-by: Greg Meiste <w30289@motorola.com>
gdbserver/gdb-server.c

index 49c7e6dd4ca1f11cfb8b68a46eeb0d9f0b506676..1981fc5e2cfd41d0306203cc0f343dd9ad76151c 100644 (file)
@@ -174,11 +174,11 @@ int main(int argc, char** argv) {
     parse_options(argc, argv, &state);
     switch (state.stlink_version) {
         case 2:
-               sl = stlink_open_usb(state.logging_level, 0, NULL);
+            sl = stlink_open_usb(state.logging_level, state.reset, NULL);
             if(sl == NULL) return 1;
             break;
         case 1:
-            sl = stlink_v1_open(state.logging_level, 0);
+            sl = stlink_v1_open(state.logging_level, state.reset);
             if(sl == NULL) return 1;
             break;
     }