From aa245489fb8a9b7470cf00d4cc637425d72c43e5 Mon Sep 17 00:00:00 2001 From: Armando Date: Fri, 28 Jul 2023 13:53:13 +0800 Subject: [PATCH] change(bootloader): added address check in bootloader.ld --- .../subproject/main/ld/esp32p4/bootloader.ld | 10 +++++++++- components/esp_system/ld/esp32p4/memory.ld.in | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/components/bootloader/subproject/main/ld/esp32p4/bootloader.ld b/components/bootloader/subproject/main/ld/esp32p4/bootloader.ld index 250f563ee4..14d68cf777 100644 --- a/components/bootloader/subproject/main/ld/esp32p4/bootloader.ld +++ b/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); diff --git a/components/esp_system/ld/esp32p4/memory.ld.in b/components/esp_system/ld/esp32p4/memory.ld.in index 40fed30cf1..29a68247e7 100644 --- a/components/esp_system/ld/esp32p4/memory.ld.in +++ b/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)