Browse Source

match memory layout to volcano remote project

Thomas Buck 1 year ago
parent
commit
9e9371e28b
2 changed files with 35 additions and 4 deletions
  1. 15
    3
      bootloader_shell.ld
  2. 20
    1
      standalone.ld

+ 15
- 3
bootloader_shell.ld View File

22
 */
22
 */
23
 
23
 
24
 /*
24
 /*
25
+ * TODO hard-coded.
26
+ * Should take into account PICO_FLASH_BANK_STORAGE_OFFSET
27
+ * and DISK_BLOCK_SIZE and DISK_BLOCK_COUNT from config.h
28
+ */
29
+__PERSISTENT_STORAGE_LEN = (3 * 4k);
30
+__FLASH_CACHE_LEN = (48 * 4k);
31
+__ADDITIONAL_LEN = (__PERSISTENT_STORAGE_LEN + __FLASH_CACHE_LEN);
32
+
33
+/*
25
  * TODO: Hard-code 360k, which is the max size I see on my machine with
34
  * TODO: Hard-code 360k, which is the max size I see on my machine with
26
  * 'sta' mode and debug printf.
35
  * 'sta' mode and debug printf.
27
  * There must be a better way to determine the size dynamically somehow.
36
  * There must be a better way to determine the size dynamically somehow.
28
  */
37
  */
38
+__BOOTLOADER_LEN = 360k;
39
+__IMG_HDR_LEN = 4k;
40
+__BOOTLOADER_IMG_LEN = (__BOOTLOADER_LEN + __IMG_HDR_LEN);
29
 MEMORY
41
 MEMORY
30
 {
42
 {
31
-    FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 360k
32
-    FLASH_IMGHDR(rx) : ORIGIN = 0x10000000 + 360k, LENGTH = 4k
33
-    FLASH_APP(rx) : ORIGIN = 0x10000000 + 364k, LENGTH = 2048k - 364k
43
+    FLASH(rx) : ORIGIN = 0x10000000, LENGTH = __BOOTLOADER_LEN
44
+    FLASH_IMGHDR(rx) : ORIGIN = 0x10000000 + __BOOTLOADER_LEN, LENGTH = __IMG_HDR_LEN
45
+    FLASH_APP(rx) : ORIGIN = 0x10000000 + __BOOTLOADER_IMG_LEN, LENGTH = 2048k - __ADDITIONAL_LEN - __BOOTLOADER_IMG_LEN
34
     RAM(rwx) : ORIGIN =  0x20000000, LENGTH = 256k
46
     RAM(rwx) : ORIGIN =  0x20000000, LENGTH = 256k
35
     SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
47
     SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
36
     SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k
48
     SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k

+ 20
- 1
standalone.ld View File

21
     __stack (== StackTop)
21
     __stack (== StackTop)
22
 */
22
 */
23
 
23
 
24
+INPUT (./fat_fs.o)
25
+
26
+/*
27
+ * TODO hard-coded.
28
+ * Should take into account PICO_FLASH_BANK_STORAGE_OFFSET
29
+ * and DISK_BLOCK_SIZE and DISK_BLOCK_COUNT from config.h
30
+ */
31
+__PERSISTENT_STORAGE_LEN = (3 * 4k);
32
+__FLASH_CACHE_LEN = (48 * 4k);
33
+__ADDITIONAL_LEN = (__PERSISTENT_STORAGE_LEN + __FLASH_CACHE_LEN);
34
+
24
 /* Skip 364kB at the start of flash, that's where the bootloader is */
35
 /* Skip 364kB at the start of flash, that's where the bootloader is */
36
+__BOOTLOADER_LEN = 360k;
37
+__IMG_HDR_LEN = 4k;
38
+__BOOTLOADER_IMG_LEN = (__BOOTLOADER_LEN + __IMG_HDR_LEN);
25
 MEMORY
39
 MEMORY
26
 {
40
 {
27
-    FLASH(rx) : ORIGIN = 0x10000000 + 364k, LENGTH = 2048k - 364k
41
+    FLASH(rx) : ORIGIN = 0x10000000 + __BOOTLOADER_IMG_LEN, LENGTH = 2048k - __ADDITIONAL_LEN - __BOOTLOADER_IMG_LEN
42
+    FLASH_CACHE(r) : ORIGIN = 0x10000000 + __BOOTLOADER_IMG_LEN + (2048k - __ADDITIONAL_LEN - __BOOTLOADER_IMG_LEN) , LENGTH = __FLASH_CACHE_LEN
28
     RAM(rwx) : ORIGIN =  0x20000000, LENGTH = 256k
43
     RAM(rwx) : ORIGIN =  0x20000000, LENGTH = 256k
29
     SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
44
     SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
30
     SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k
45
     SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k
213
         *(.stack*)
228
         *(.stack*)
214
     } > SCRATCH_Y
229
     } > SCRATCH_Y
215
 
230
 
231
+    .fat_fs_bin : {
232
+        KEEP(./fat_fs.o (.fat_fs_bin))
233
+    } > FLASH_CACHE
234
+
216
     .flash_end : {
235
     .flash_end : {
217
         __flash_binary_end = .;
236
         __flash_binary_end = .;
218
     } > FLASH
237
     } > FLASH

Loading…
Cancel
Save