From 9856198112d801e889c93f8ced202ed700655621 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 17 Jun 2020 16:25:15 +1000 Subject: [PATCH] bootloader esp32s2: Increase bootloader DRAM & IRAM allowance Bootloader DRAM now ends at 0x3FFEAB00 which is the start of ROM static RAM (reclaimable after app is running). IRAM loader segment increased by 8KB. Available total static RAM for the app is now reduced by 16KB. --- .../bootloader/subproject/main/ld/esp32s2/bootloader.ld | 6 +++--- components/esp32s2/ld/esp32s2.ld | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld b/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld index 79b2568816..a50842890b 100644 --- a/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld +++ b/components/bootloader/subproject/main/ld/esp32s2/bootloader.ld @@ -5,9 +5,9 @@ MEMORY { - iram_seg (RWX) : org = 0x40050000, len = 0x4000 /* 16KB, SRAM Block_14 */ - iram_loader_seg (RWX) : org = 0x40054000, len = 0x4000 /* 16KB, SRAM Block_15 */ - dram_seg (RW) : org = 0x3FFE8000, len = 0x2800 /* 10KB, Top of SRAM Block_16, and before ROM data and stack */ + iram_seg (RWX) : org = 0x4004c000, len = 0x4000 /* SRAM Block 13 */ + iram_loader_seg (RWX) : org = 0x40050000, len = 0x6000 /* SRAM Block 14 & part of 15 */ + dram_seg (RW) : org = 0x3FFE6000, len = 0x4B00 /* Part SRAM Blocks 15 & 16, ROM static buffer starts at end of this region (reclaimed after app runs) */ } /* Default entry point: */ diff --git a/components/esp32s2/ld/esp32s2.ld b/components/esp32s2/ld/esp32s2.ld index 9d3abd3eac..7c9555e433 100644 --- a/components/esp32s2/ld/esp32s2.ld +++ b/components/esp32s2/ld/esp32s2.ld @@ -27,7 +27,7 @@ #define RAM_IRAM_START 0x40020000 #define RAM_DRAM_START 0x3FFB0000 -#define DATA_RAM_END 0x3FFE4000 /* 2nd stage bootloader iram_loader_seg starts at block 15 */ +#define DATA_RAM_END 0x3FFE0000 /* 2nd stage bootloader iram_loader_seg starts at SRAM block 14 (reclaimed after app boots) */ #define IRAM_ORG (RAM_IRAM_START + CONFIG_ESP32S2_INSTRUCTION_CACHE_SIZE \ + CONFIG_ESP32S2_DATA_CACHE_SIZE)