Просмотр исходного кода

change(bootloader): added address check in bootloader.ld

Armando 2 лет назад
Родитель
Сommit
aa245489fb

+ 9 - 1
components/bootloader/subproject/main/ld/esp32p4/bootloader.ld

@@ -25,7 +25,7 @@
 bootloader_usable_dram_end = 0x4ff3abd0;
 bootloader_stack_overhead = 0x2000; /* For safety margin between bootloader data section and startup stacks */
 bootloader_dram_seg_len = 0x4000;
-bootloader_iram_loader_seg_len = 0x4000;
+bootloader_iram_loader_seg_len = 0x7000;
 bootloader_iram_seg_len = 0x2000;
 
 /* Start of the lower region is determined by region size and the end of the higher region */
@@ -41,6 +41,14 @@ MEMORY
   dram_seg (RW) :                   org = bootloader_dram_seg_start, len = bootloader_dram_seg_len
 }
 
+/* The app may use RAM for static allocations up to the start of iram_loader_seg.
+ * If you have changed something above and this assert fails:
+ * 1. Check what the new value of bootloader_iram_loader_seg start is.
+ * 2. Update the value in this assert.
+ * 3. Update SRAM_DRAM_END in components/esp_system/ld/esp32p4/memory.ld.in to the same value.
+ */
+ASSERT(bootloader_iram_loader_seg_start == 0x4FF2DBD0, "bootloader_iram_loader_seg_start inconsistent with SRAM_DRAM_END");
+
 /* Default entry point: */
 ENTRY(call_start_cpu0);
 

+ 1 - 1
components/esp_system/ld/esp32p4/memory.ld.in

@@ -23,7 +23,7 @@
 #define SRAM_DRAM_START     0x4ff00000
 
 #define I_D_SRAM_OFFSET     (SRAM_IRAM_START - SRAM_DRAM_START)
-#define SRAM_DRAM_END       0x4ff30bd0 - I_D_SRAM_OFFSET  /* 2nd stage bootloader iram_loader_seg start address */
+#define SRAM_DRAM_END       0x4FF2DBD0 - I_D_SRAM_OFFSET  /* 2nd stage bootloader iram_loader_seg start address */
 
 #define SRAM_IRAM_ORG       (SRAM_IRAM_START)
 #define SRAM_DRAM_ORG       (SRAM_DRAM_START)