diff --git a/src/platforms/f4discovery/platform.c b/src/platforms/f4discovery/platform.c index 5b073e9..efe8050 100644 --- a/src/platforms/f4discovery/platform.c +++ b/src/platforms/f4discovery/platform.c @@ -92,6 +92,11 @@ int platform_init(void) cdcacm_init(); + // Set recovery point + if (setjmp(fatal_error_jmpbuf)) { + return 0; // Do nothing on failure + } + jtag_scan(NULL); return 0; diff --git a/src/platforms/native/platform.c b/src/platforms/native/platform.c index cb9e69e..81a54d8 100644 --- a/src/platforms/native/platform.c +++ b/src/platforms/native/platform.c @@ -140,6 +140,11 @@ int platform_init(void) cdcacm_init(); usbuart_init(); + // Set recovery point + if (setjmp(fatal_error_jmpbuf)) { + return 0; // Do nothing on failure + } + jtag_scan(NULL); return 0; diff --git a/src/platforms/stlink/platform.c b/src/platforms/stlink/platform.c index 1369c37..cf2d954 100644 --- a/src/platforms/stlink/platform.c +++ b/src/platforms/stlink/platform.c @@ -121,6 +121,11 @@ int platform_init(void) cdcacm_init(); + // Set recovery point + if (setjmp(fatal_error_jmpbuf)) { + return 0; // Do nothing on failure + } + jtag_scan(NULL); return 0; diff --git a/src/platforms/swlink/platform.c b/src/platforms/swlink/platform.c index 0f5695d..74f8691 100644 --- a/src/platforms/swlink/platform.c +++ b/src/platforms/swlink/platform.c @@ -99,6 +99,11 @@ int platform_init(void) cdcacm_init(); + // Set recovery point + if (setjmp(fatal_error_jmpbuf)) { + return 0; // Do nothing on failure + } + jtag_scan(NULL); return 0;