From 58e6abc3ad5f8a42e401fc9020d134463e182ffb Mon Sep 17 00:00:00 2001 From: Wu Jian Gang Date: Fri, 1 Jun 2018 15:29:10 +0800 Subject: [PATCH] feat(esp8266): Add rtc segment in ld file --- components/esp8266/ld/esp8266.common.ld | 9 +++++++++ components/esp8266/ld/esp8266.ld | 17 +++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/components/esp8266/ld/esp8266.common.ld b/components/esp8266/ld/esp8266.common.ld index 6435c2f0..36b382bd 100644 --- a/components/esp8266/ld/esp8266.common.ld +++ b/components/esp8266/ld/esp8266.common.ld @@ -62,6 +62,15 @@ SECTIONS _dport0_data_end = ABSOLUTE(.); } >dport0_0_seg :dport0_0_phdr + /* RTC memory holds user's data/rodata */ + .rtc.data : + { + _rtc_data_start = ABSOLUTE(.); + *(.rtc.data) + *(.rtc.rodata) + _rtc_data_end = ABSOLUTE(.); + } > rtc_seg + .text : ALIGN(4) { _stext = .; diff --git a/components/esp8266/ld/esp8266.ld b/components/esp8266/ld/esp8266.ld index 448cc181..763da540 100644 --- a/components/esp8266/ld/esp8266.ld +++ b/components/esp8266/ld/esp8266.ld @@ -18,8 +18,17 @@ MEMORY { - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x18000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40201010, len = 0xE0000 + dport0_0_seg : org = 0x3FF00000, len = 0x10 + + /* All .data/.bss/heap are in this segment. */ + dram0_0_seg : org = 0x3FFE8000, len = 0x18000 + + /* Functions which are critical should be put in this segment. */ + iram1_0_seg : org = 0x40100000, len = 0x8000 + + /* It is actually mapped to flash. */ + irom0_0_seg : org = 0x40201010, len = 0xFF000 - 0x10 + + /* RTC memory, persists over deep sleep. */ + rtc_seg : org = 0x60001200, len = 0x200 }