mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
system: fixed USE_FIXED_STATIC_RAM_SIZE option
The USE_FIXED_STATIC_RAM_SIZE was not actually causing the heap to start at a fixed address. Closes https://github.com/espressif/esp-idf/issues/10270 Closes https://github.com/espressif/esp-idf/issues/10271
This commit is contained in:
parent
7398a9b273
commit
f1070229f8
@ -114,9 +114,9 @@ MEMORY
|
||||
|
||||
#if defined(CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE)
|
||||
/* static data ends at defined address */
|
||||
_static_data_end = 0x3FFB0000 + DRAM0_0_SEG_LEN;
|
||||
_heap_start = 0x3FFB0000 + DRAM0_0_SEG_LEN;
|
||||
#else
|
||||
_static_data_end = _bss_end;
|
||||
_heap_start = _heap_low_start;
|
||||
#endif
|
||||
|
||||
/* Heap ends at top of dram0_0_seg */
|
||||
|
@ -396,7 +396,8 @@ SECTIONS
|
||||
.dram0.heap_start (NOLOAD) :
|
||||
{
|
||||
. = ALIGN (8);
|
||||
_heap_start = ABSOLUTE(.);
|
||||
/* Lowest possible start address for the heap */
|
||||
_heap_low_start = ABSOLUTE(.);
|
||||
} > dram0_0_seg
|
||||
|
||||
/** This section will be used by the debugger and disassembler to get more information
|
||||
@ -422,5 +423,5 @@ SECTIONS
|
||||
ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),
|
||||
"IRAM0 segment data does not fit.")
|
||||
|
||||
ASSERT(((_heap_start - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)),
|
||||
ASSERT(((_heap_low_start - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)),
|
||||
"DRAM segment data does not fit.")
|
||||
|
@ -20,12 +20,8 @@
|
||||
|
||||
#define I_D_SRAM_SIZE SRAM_DRAM_END - SRAM_DRAM_ORG
|
||||
|
||||
#if CONFIG_ESP32C2_USE_FIXED_STATIC_RAM_SIZE
|
||||
ASSERT((CONFIG_ESP32C2_FIXED_STATIC_RAM_SIZE <= I_D_SRAM_SIZE), "Fixed static ram data does not fit.")
|
||||
#define DRAM0_0_SEG_LEN CONFIG_ESP32C2_FIXED_STATIC_RAM_SIZE
|
||||
#else
|
||||
#define DRAM0_0_SEG_LEN I_D_SRAM_SIZE
|
||||
#endif // CONFIG_ESP32C2_USE_FIXED_STATIC_RAM_SIZE
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/**
|
||||
@ -65,13 +61,6 @@ MEMORY
|
||||
|
||||
}
|
||||
|
||||
#if CONFIG_ESP32C2_USE_FIXED_STATIC_RAM_SIZE
|
||||
/* static data ends at defined address */
|
||||
_static_data_end = 0x3FCA0000 + DRAM0_0_SEG_LEN;
|
||||
#else
|
||||
_static_data_end = _bss_end;
|
||||
#endif // CONFIG_ESP32C2_USE_FIXED_STATIC_RAM_SIZE
|
||||
|
||||
/* Heap ends at top of dram0_0_seg */
|
||||
_heap_end = 0x40000000;
|
||||
|
||||
|
@ -38,12 +38,8 @@
|
||||
|
||||
#define I_D_SRAM_SIZE SRAM_DRAM_END - SRAM_DRAM_ORG
|
||||
|
||||
#if CONFIG_ESP32C3_USE_FIXED_STATIC_RAM_SIZE
|
||||
ASSERT((CONFIG_ESP32C3_FIXED_STATIC_RAM_SIZE <= I_D_SRAM_SIZE), "Fixed static ram data does not fit.")
|
||||
#define DRAM0_0_SEG_LEN CONFIG_ESP3C3_FIXED_STATIC_RAM_SIZE
|
||||
#else
|
||||
#define DRAM0_0_SEG_LEN I_D_SRAM_SIZE
|
||||
#endif // CONFIG_ESP32C3_USE_FIXED_STATIC_RAM_SIZE
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/**
|
||||
@ -87,13 +83,6 @@ MEMORY
|
||||
rtc_iram_seg(RWX) : org = 0x50000000, len = 0x2000 - ESP_BOOTLOADER_RESERVE_RTC
|
||||
}
|
||||
|
||||
#if CONFIG_ESP32C3_USE_FIXED_STATIC_RAM_SIZE
|
||||
/* static data ends at defined address */
|
||||
_static_data_end = 0x3FCA0000 + DRAM0_0_SEG_LEN;
|
||||
#else
|
||||
_static_data_end = _bss_end;
|
||||
#endif // CONFIG_ESP32C3_USE_FIXED_STATIC_RAM_SIZE
|
||||
|
||||
/* Heap ends at top of dram0_0_seg */
|
||||
_heap_end = 0x40000000;
|
||||
|
||||
|
@ -50,17 +50,12 @@
|
||||
|
||||
#define I_D_RAM_SIZE DATA_RAM_END - DRAM_ORG
|
||||
|
||||
#if defined(CONFIG_ESP32S2_USE_FIXED_STATIC_RAM_SIZE)
|
||||
|
||||
ASSERT((CONFIG_ESP32S2_FIXED_STATIC_RAM_SIZE <= I_D_RAM_SIZE),
|
||||
"Fixed static ram data does not fit.")
|
||||
|
||||
#define STATIC_RAM_SIZE CONFIG_ESP32S2_FIXED_STATIC_RAM_SIZE
|
||||
|
||||
#if CONFIG_ESP32S2_USE_FIXED_STATIC_RAM_SIZE
|
||||
ASSERT((CONFIG_ESP32S2_FIXED_STATIC_RAM_SIZE <= I_D_RAM_SIZE), "Fixed static ram data does not fit.")
|
||||
#define DRAM0_0_SEG_LEN CONFIG_ESP32S2_FIXED_STATIC_RAM_SIZE
|
||||
#else
|
||||
#define STATIC_RAM_SIZE 0
|
||||
#endif
|
||||
|
||||
#define DRAM0_0_SEG_LEN I_D_RAM_SIZE
|
||||
#endif // CONFIG_ESP32S2_USE_FIXED_STATIC_RAM_SIZE
|
||||
MEMORY
|
||||
{
|
||||
/* All these values assume the flash cache is on, and have the blocks this uses subtracted from the length
|
||||
@ -86,7 +81,7 @@ MEMORY
|
||||
|
||||
|
||||
/* Shared data RAM, excluding memory reserved for bootloader and ROM bss/data/stack. */
|
||||
dram0_0_seg (RW) : org = DRAM_ORG, len = I_D_RAM_SIZE - STATIC_RAM_SIZE
|
||||
dram0_0_seg (RW) : org = DRAM_ORG, len = DRAM0_0_SEG_LEN
|
||||
|
||||
#ifdef CONFIG_APP_BUILD_USE_FLASH_SECTIONS
|
||||
/* Flash mapped constant data */
|
||||
@ -120,9 +115,9 @@ MEMORY
|
||||
|
||||
#if defined(CONFIG_ESP32S2_USE_FIXED_STATIC_RAM_SIZE)
|
||||
/* static data ends at defined address */
|
||||
_static_data_end = DRAM_ORG + STATIC_RAM_SIZE;
|
||||
_heap_start = DRAM_ORG + DRAM0_0_SEG_LEN;
|
||||
#else
|
||||
_static_data_end = _bss_end;
|
||||
_heap_start = _heap_low_start;
|
||||
#endif
|
||||
|
||||
_heap_end = 0x40000000;
|
||||
|
@ -390,7 +390,8 @@ SECTIONS
|
||||
.dram0.heap_start (NOLOAD) :
|
||||
{
|
||||
. = ALIGN (8);
|
||||
_heap_start = ABSOLUTE(.);
|
||||
/* Lowest possible start address for the heap */
|
||||
_heap_low_start = ABSOLUTE(.);
|
||||
} > dram0_0_seg
|
||||
|
||||
/** This section will be used by the debugger and disassembler to get more information
|
||||
@ -416,5 +417,5 @@ SECTIONS
|
||||
ASSERT(((_iram_text_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),
|
||||
"IRAM0 segment data does not fit.")
|
||||
|
||||
ASSERT(((_heap_start - _data_start) <= LENGTH(dram0_0_seg)),
|
||||
ASSERT(((_heap_low_start - _data_start) <= LENGTH(dram0_0_seg)),
|
||||
"DRAM segment data does not fit.")
|
||||
|
@ -119,9 +119,9 @@ MEMORY
|
||||
|
||||
#if CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE
|
||||
/* static data ends at defined address */
|
||||
_static_data_end = 0x3FCA0000 + DRAM0_0_SEG_LEN;
|
||||
_heap_start = SRAM_DRAM_ORG + DRAM0_0_SEG_LEN;
|
||||
#else
|
||||
_static_data_end = _bss_end;
|
||||
_heap_start = _heap_low_start;
|
||||
#endif // CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE
|
||||
|
||||
/* Heap ends at top of dram0_0_seg */
|
||||
|
@ -429,7 +429,8 @@ SECTIONS
|
||||
.dram0.heap_start (NOLOAD) :
|
||||
{
|
||||
. = ALIGN (8);
|
||||
_heap_start = ABSOLUTE(.);
|
||||
/* Lowest possible start address for the heap */
|
||||
_heap_low_start = ABSOLUTE(.);
|
||||
} > dram0_0_seg
|
||||
|
||||
/** This section will be used by the debugger and disassembler to get more information
|
||||
@ -455,5 +456,5 @@ SECTIONS
|
||||
ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),
|
||||
"IRAM0 segment data does not fit.")
|
||||
|
||||
ASSERT(((_heap_start - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)),
|
||||
ASSERT(((_heap_low_start - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)),
|
||||
"DRAM segment data does not fit.")
|
||||
|
@ -21,9 +21,12 @@ menu "Memory"
|
||||
config ESP32S2_FIXED_STATIC_RAM_SIZE
|
||||
hex "Fixed Static RAM size"
|
||||
default 0x10000
|
||||
range 0 0x34000
|
||||
range 0 0x34000 # Equal to I_D_SRAM_SIZE in linkerscript
|
||||
depends on ESP32S2_USE_FIXED_STATIC_RAM_SIZE
|
||||
help
|
||||
RAM size dedicated for static variables (.data & .bss sections).
|
||||
This value is less than the chips total memory, as not all of it can be used for this purpose.
|
||||
E.g. parts are used by the software bootloader, and will only be available
|
||||
as heap memory after app startup.
|
||||
|
||||
endmenu # Memory
|
||||
|
@ -21,9 +21,12 @@ menu "Memory"
|
||||
config ESP32S3_FIXED_STATIC_RAM_SIZE
|
||||
hex "Fixed Static RAM size"
|
||||
default 0x10000
|
||||
range 0 0x34000
|
||||
range 0 0x54700 # Equal to I_D_SRAM_SIZE in linkerscript
|
||||
depends on ESP32S3_USE_FIXED_STATIC_RAM_SIZE
|
||||
help
|
||||
RAM size dedicated for static variables (.data & .bss sections).
|
||||
This value is less than the chips total memory, as not all of it can be used for this purpose.
|
||||
E.g. parts are used by the software bootloader, and will only be available
|
||||
as heap memory after app startup.
|
||||
|
||||
endmenu # Memory
|
||||
|
Loading…
x
Reference in New Issue
Block a user