Fixed flash utility for STM32F4
[fw/stlink] / flash / main.c
index a443f95f6bb58b59460e3231a5a650d637763d6c..278d63d1878b5100985300867967f9a082d67c80 100644 (file)
@@ -86,13 +86,18 @@ int main(int ac, char** av)
 
   if (o.devname != NULL) /* stlinkv1 */
   {
+#if CONFIG_USE_LIBSG
     static const int scsi_verbose = 2;
     sl = stlink_quirk_open(o.devname, scsi_verbose);
     if (sl == NULL) goto on_error;
+#else
+    printf("not compiled for use with STLink/V1");
+    goto on_error;
+#endif
   }
   else /* stlinkv2 */
   {
-    sl = stlink_open_usb(10);
+    sl = stlink_open_usb(1);
     if (sl == NULL) goto on_error;
   }
 
@@ -106,6 +111,7 @@ int main(int ac, char** av)
 
   if (o.do_read == 0) /* write */
   {
+
     err = stlink_fwrite_flash(sl, o.filename, o.addr);
     if (err == -1)
     {