We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be280ec commit 7ddb266Copy full SHA for 7ddb266
cores/arduino/Reset.cpp
@@ -43,6 +43,13 @@ static void banzai() {
43
// Disable all interrupts
44
__disable_irq();
45
46
+ // Avoid erasing the application if APP_START is < than the minimum bootloader size
47
+ // This could happen if without_bootloader linker script was chosen
48
+ // Minimum bootloader size in SAMD21 family is 512bytes (RM section 22.6.5)
49
+ if (APP_START < (0x200 + 4)) {
50
+ goto reset;
51
+ }
52
+
53
// Erase application
54
while (!nvmReady())
55
;
@@ -52,6 +59,7 @@ static void banzai() {
59
60
61
62
+reset:
63
// Reset the device
56
64
NVIC_SystemReset() ;
57
65
0 commit comments