From 88f62fd3222ea733b956e2d1e8bdb84530d6df38 Mon Sep 17 00:00:00 2001 From: Laczen JMS Date: Mon, 19 Jan 2026 17:16:33 +0100 Subject: [PATCH] boards/xtensa/esp32: add rtc_reserved_seg to legacy_sections Enable building the legacy idf format of nuttx when rtc is enabled. Without this addition the build fails because the rtc data is placed in rom. Signed-off-by: Laczen JMS --- .../esp32/common/scripts/legacy_sections.ld | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/boards/xtensa/esp32/common/scripts/legacy_sections.ld b/boards/xtensa/esp32/common/scripts/legacy_sections.ld index 4c960f3be64..1442432f664 100644 --- a/boards/xtensa/esp32/common/scripts/legacy_sections.ld +++ b/boards/xtensa/esp32/common/scripts/legacy_sections.ld @@ -384,4 +384,21 @@ SECTIONS . = ALIGN (4); _srtcheap = ABSOLUTE(.); } > rtc_slow_seg + + /* + * This section holds RTC data that should have fixed addresses. + * The data are not initialized at power-up and are retained during deep sleep. + */ + .rtc_reserved (NOLOAD): + { + . = ALIGN(4); + _rtc_reserved_start = ABSOLUTE(.); + /* New data can only be added here to ensure existing data are not moved. + Because data have adhered to the end of the segment and code is relied on it. + >> put new data here << */ + + *(.rtc_timer_data_in_rtc_mem .rtc_timer_data_in_rtc_mem.*) + KEEP(*(.bootloader_data_rtc_mem .bootloader_data_rtc_mem.*)) + _rtc_reserved_end = ABSOLUTE(.); + } > rtc_reserved_seg }