浏览代码

match memory layout to volcano remote project

Thomas Buck 1年前
父节点
当前提交
9e9371e28b
共有 2 个文件被更改,包括 35 次插入4 次删除
  1. 15
    3
      bootloader_shell.ld
  2. 20
    1
      standalone.ld

+ 15
- 3
bootloader_shell.ld 查看文件

@@ -22,15 +22,27 @@
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 34
  * TODO: Hard-code 360k, which is the max size I see on my machine with
26 35
  * 'sta' mode and debug printf.
27 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 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 46
     RAM(rwx) : ORIGIN =  0x20000000, LENGTH = 256k
35 47
     SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
36 48
     SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k

+ 20
- 1
standalone.ld 查看文件

@@ -21,10 +21,25 @@
21 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 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 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 43
     RAM(rwx) : ORIGIN =  0x20000000, LENGTH = 256k
29 44
     SCRATCH_X(rwx) : ORIGIN = 0x20040000, LENGTH = 4k
30 45
     SCRATCH_Y(rwx) : ORIGIN = 0x20041000, LENGTH = 4k
@@ -213,6 +228,10 @@ SECTIONS
213 228
         *(.stack*)
214 229
     } > SCRATCH_Y
215 230
 
231
+    .fat_fs_bin : {
232
+        KEEP(./fat_fs.o (.fat_fs_bin))
233
+    } > FLASH_CACHE
234
+
216 235
     .flash_end : {
217 236
         __flash_binary_end = .;
218 237
     } > FLASH

正在加载...
取消
保存