ignore elf files in example
[fw/stlink] / src / stlink-sg.c
index 991bc878b5bb77ccb82ec8fd28bcb6ee73ed4fb6..4cae3ee119316a27bc61139df10179193ef0924d 100644 (file)
@@ -85,7 +85,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/mman.h>
+#include "mmap.h"
 
 #include "stlink-common.h"
 #include "stlink-sg.h"
@@ -1014,6 +1014,7 @@ stlink_t* stlink_v1_open_inner(const int verbose) {
             "WTF? successfully opened, but unable to read version details. BROKEN!\n");
         return NULL;
     }
+
     return sl;
 }
 
@@ -1025,6 +1026,9 @@ stlink_t* stlink_v1_open(const int verbose) {
     }
     // by now, it _must_ be fully open and in a useful mode....
        stlink_enter_swd_mode(sl);
+    /* Now we are ready to read the parameters  */
+    stlink_reset(sl);
+    stlink_load_device_params(sl);
     ILOG("Successfully opened a stlink v1 debugger\n");
     return sl;
 }