[update] factorize flash writing code. use core_id to identify.
[fw/stlink] / flash / main.c
index a443f95f6bb58b59460e3231a5a650d637763d6c..46a8ce1711e295651cf2c16e1bfae3c08bc6dd09 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;
   }