]> patrickod personal git archive - keywing-rs.git/blobdiff - keywing/memory.x
Initial port to Feather M4
[keywing-rs.git] / keywing / memory.x
index 46f1278ab358d182831714b7a96c1bbe0a11d32a..bbbe065c20707311b34cf9d9b3510736f67be204 100644 (file)
@@ -1,10 +1,13 @@
 MEMORY
 {
-  /* NOTE K = KiBi = 1024 bytes */
-  FLASH : ORIGIN  = 0x00000000, LENGTH = 1M
-  RAM : ORIGIN    = 0x20000000, LENGTH = 255K
-  PANDUMP: ORIGIN = 0x2003FC00, LENGTH = 1K
+  /* Leave 16k for the default bootloader on the Feather M4 */
+  FLASH (rx)   : ORIGIN = 0x00000000 + 16K, LENGTH = 512K - 16K
+  /* Usually 192K RAM. Reserve 1K at the end for storing panic dumps */
+  RAM (xrw)    : ORIGIN = 0x20000000, LENGTH = 191K
+  PANDUMP (rw) : ORIGIN = 0x20000000 + 191K, LENGTH = 1K
 }
 
+_stack_start = ORIGIN(RAM) + LENGTH(RAM);
 _panic_dump_start = ORIGIN(PANDUMP);
-_panic_dump_end = ORIGIN(PANDUMP) + LENGTH(PANDUMP);
+_panic_dump_end   = ORIGIN(PANDUMP) + LENGTH(PANDUMP);
+