Skip to content

Commit 8f0e22f

Browse files
committed
STLINK V3: Leave bootloader mode when crypto Bootloader is found.
1 parent 3ab0b14 commit 8f0e22f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define STLINK_PID 0x3748
3131
#define STLINK_PIDV21 0x374b
3232
#define STLINK_PIDV21_MSD 0x3752
33+
#define STLINK_V3EC 0x3754
3334
#define STLINK_PIDV3_MSD 0x374e
3435
#define STLINK_PIDV3 0x374f
3536
#define STLINK_PIDV3_BL 0x374d
@@ -135,6 +136,7 @@ int main(int argc, char *argv[]) {
135136
fprintf(stderr, "StlinkV3 Bootloader found\n");
136137
break;
137138
case STLINK_PIDV21:
139+
case STLINK_V3EC:
138140
case STLINK_PIDV21_MSD:
139141
case STLINK_PIDV3_MSD:
140142
case STLINK_PIDV3:
@@ -209,7 +211,8 @@ int main(int argc, char *argv[]) {
209211
printf("Current mode : %d\n", res);
210212

211213
if (res & 0xfffc) {
212-
printf("ST-Link dongle is not in the correct mode. Please unplug and plug the dongle again.\n");
214+
printf("ST-Link dongle has crypto bootloader. Restarting ST application.\n");
215+
stlink_exit_dfu(&info);
213216
libusb_release_interface(info.stinfo_dev_handle, 0);
214217
return EXIT_SUCCESS;
215218
}

0 commit comments

Comments
 (0)