mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-04 11:55:21 +02:00
esp32: Allow fixed static RAM size and DRAM heap size
Merges https://github.com/espressif/esp-idf/pull/3222
This commit is contained in:
committed by
Angus Gratton
parent
5274739fff
commit
542e544faa
@@ -21,6 +21,17 @@
|
||||
#define CONFIG_BT_RESERVE_DRAM 0
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE)
|
||||
|
||||
ASSERT((CONFIG_ESP32_FIXED_STATIC_RAM_SIZE <= 0x2c200),
|
||||
"Fixed static ram data does not fit.")
|
||||
|
||||
#define DRAM0_0_SEG_LEN CONFIG_ESP32_FIXED_STATIC_RAM_SIZE
|
||||
|
||||
#else
|
||||
#define DRAM0_0_SEG_LEN 0x2c200
|
||||
#endif
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/* All these values assume the flash cache is on, and have the blocks this uses subtracted from the length
|
||||
@@ -51,7 +62,7 @@ MEMORY
|
||||
additional static memory temporarily cannot be used.
|
||||
*/
|
||||
dram0_0_seg (RW) : org = 0x3FFB0000 + CONFIG_BT_RESERVE_DRAM,
|
||||
len = 0x2c200 - CONFIG_BT_RESERVE_DRAM
|
||||
len = DRAM0_0_SEG_LEN - CONFIG_BT_RESERVE_DRAM
|
||||
|
||||
/* Flash mapped constant data */
|
||||
drom0_0_seg (R) : org = 0x3F400018, len = 0x400000-0x18
|
||||
@@ -61,7 +72,7 @@ MEMORY
|
||||
/* RTC fast memory (executable). Persists over deep sleep.
|
||||
*/
|
||||
rtc_iram_seg(RWX) : org = 0x400C0000, len = 0x2000
|
||||
|
||||
|
||||
/* RTC fast memory (same block as above), viewed from data bus */
|
||||
rtc_data_seg(RW) : org = 0x3ff80000, len = 0x2000
|
||||
|
||||
@@ -77,14 +88,21 @@ MEMORY
|
||||
len = 0x400000
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE)
|
||||
/* static data ends at defined address */
|
||||
_static_data_end = 0x3FFB0000 + DRAM0_0_SEG_LEN;
|
||||
#else
|
||||
_static_data_end = _bss_end;
|
||||
#endif
|
||||
|
||||
/* Heap ends at top of dram0_0_seg */
|
||||
_heap_end = 0x40000000 - CONFIG_ESP32_TRACEMEM_RESERVE_DRAM;
|
||||
|
||||
_data_seg_org = ORIGIN(rtc_data_seg);
|
||||
|
||||
/* The lines below define location alias for .rtc.data section based on Kconfig option.
|
||||
When the option is not defined then use slow memory segment
|
||||
else the data will be placed in fast memory segment */
|
||||
/* The lines below define location alias for .rtc.data section based on Kconfig option.
|
||||
When the option is not defined then use slow memory segment
|
||||
else the data will be placed in fast memory segment */
|
||||
#ifndef CONFIG_ESP32_RTCDATA_IN_FAST_MEM
|
||||
REGION_ALIAS("rtc_data_location", rtc_slow_seg );
|
||||
#else
|
||||
|
||||
@@ -239,8 +239,6 @@ SECTIONS
|
||||
|
||||
. = ALIGN (8);
|
||||
_bss_end = ABSOLUTE(.);
|
||||
/* The heap starts right after end of this section */
|
||||
_heap_start = ABSOLUTE(.);
|
||||
} > dram0_0_seg
|
||||
|
||||
ASSERT(((_bss_end - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)),
|
||||
|
||||
Reference in New Issue
Block a user