Add printing st-link version to st-info
@@ -35,11 +35,24 @@ static void stlink_print_serial(stlink_t *sl, bool openocd) {
printf("\n");
}
+static void stlink_print_version(stlink_t *sl) {
+ // Implementation of version printing is minimalistic
+ // but contains all available information from sl->version
+ printf("V%d", sl->version.stlink_v);
+ if (sl->version.jtag_v > 0)
+ printf("J%d", sl->version.jtag_v);
+ if (sl->version.swim_v > 0)
+ printf("S%d", sl->version.swim_v);
+ printf("\n");
+}
+
static void stlink_print_info(stlink_t *sl) {
const struct stlink_chipid_params *params = NULL;
if (!sl) { return; }
+ printf(" version: ");
+ stlink_print_version(sl);
printf(" serial: ");
stlink_print_serial(sl, false);
printf(" hla-serial: ");
@@ -62,7 +75,10 @@ static void stlink_probe(void) {
printf("Found %u stlink programmers\n", (unsigned int)size);
- for (size_t n = 0; n < size; n++) { stlink_print_info(stdevs[n]); }
+ for (size_t n = 0; n < size; n++) {
+ if (size>1) printf("%lu.\n", n+1);
+ stlink_print_info(stdevs[n]);
+ }
stlink_probe_usb_free(&stdevs, size);
}
