You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes an Arduino sketch needs to reset the MCU, but still wants to have some variables to be able to survive.
The bootloader itself uses very little RAM and excludes by default the last 4 bytes of RAM from use by the stack.
To allow sketches using a modified linker script to take the same approach, the changed bootloader linker script excludes the last 1 KByte of RAM from stack.
Copy file name to clipboardexpand all lines: bootloaders/zero/bootloader_samd21x18.ld
+1-1
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@
27
27
MEMORY
28
28
{
29
29
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x2000 /* First 8KB used by bootloader */
30
-
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000-0x0004 /* 4 bytes used by bootloader to keep data between resets */
30
+
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000-0x0400 /* last 4 bytes used by bootloader to keep data between resets, but reserves 1024 bytes for sketches to have same possibility */
31
31
}
32
32
33
33
/* Linker script to place sections and symbol values. Should be used together
0 commit comments