From 18c183858751d03984f247065a2f71d25df687ae Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Sun, 19 Apr 2020 11:49:44 +0530 Subject: [PATCH] esp32s2: add config option to place RTC data in fast RAM --- components/esp32s2/Kconfig | 7 +++++++ components/esp32s2/ld/esp32s2.ld | 2 +- components/esp32s2/ld/esp32s2.project.ld.in | 4 ++-- tools/unit-test-app/configs/single_core_2_s2 | 2 +- tools/unit-test-app/configs/single_core_s2 | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/components/esp32s2/Kconfig b/components/esp32s2/Kconfig index a4b5392cf..c9e4b6017 100644 --- a/components/esp32s2/Kconfig +++ b/components/esp32s2/Kconfig @@ -498,6 +498,13 @@ menu "ESP32S2-specific" If enabled, this disables the linking of binary libraries in the application build. Note that after enabling this Wi-Fi/Bluetooth will not work. + config ESP32S2_RTCDATA_IN_FAST_MEM + bool "Place RTC_DATA_ATTR and RTC_RODATA_ATTR variables into RTC fast memory segment" + default n + help + This option allows to place .rtc_data and .rtc_rodata sections into + RTC fast memory segment to free the slow memory region for ULP programs. + config ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP bool "Enable RTC fast memory for dynamic allocations" depends on !ESP32S2_MEMPROT_FEATURE diff --git a/components/esp32s2/ld/esp32s2.ld b/components/esp32s2/ld/esp32s2.ld index b742f3336..9d3abd3ea 100644 --- a/components/esp32s2/ld/esp32s2.ld +++ b/components/esp32s2/ld/esp32s2.ld @@ -96,7 +96,7 @@ _data_seg_org = ORIGIN(rtc_data_seg); When the option is not defined then use slow memory segment else the data will be placed in fast memory segment TODO: check whether the rtc_data_location is correct for esp32s2 - IDF-761 */ -#ifndef CONFIG_ESP32_RTCDATA_IN_FAST_MEM +#ifndef CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM REGION_ALIAS("rtc_data_location", rtc_slow_seg ); #else REGION_ALIAS("rtc_data_location", rtc_data_seg ); diff --git a/components/esp32s2/ld/esp32s2.project.ld.in b/components/esp32s2/ld/esp32s2.project.ld.in index a619b1add..b7df21c44 100644 --- a/components/esp32s2/ld/esp32s2.project.ld.in +++ b/components/esp32s2/ld/esp32s2.project.ld.in @@ -46,7 +46,7 @@ SECTIONS named rtc_wake_stub*.c and the data marked with RTC_DATA_ATTR, RTC_RODATA_ATTR attributes. The memory location of the data is dependent on - CONFIG_ESP32_RTCDATA_IN_FAST_MEM option. + CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM option. */ .rtc.data : { @@ -75,7 +75,7 @@ SECTIONS User data marked with RTC_NOINIT_ATTR will be placed into this section. See the file "esp_attr.h" for more information. The memory location of the data is dependent on - CONFIG_ESP32_RTCDATA_IN_FAST_MEM option. + CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM option. */ .rtc_noinit (NOLOAD): { diff --git a/tools/unit-test-app/configs/single_core_2_s2 b/tools/unit-test-app/configs/single_core_2_s2 index bb52032af..ca0a8ee64 100644 --- a/tools/unit-test-app/configs/single_core_2_s2 +++ b/tools/unit-test-app/configs/single_core_2_s2 @@ -3,4 +3,4 @@ CONFIG_IDF_TARGET="esp32s2" TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32s2 esp_timer driver heap pthread soc spi_flash vfs CONFIG_MEMMAP_SMP=n CONFIG_FREERTOS_UNICORE=y -CONFIG_ESP32_RTCDATA_IN_FAST_MEM=y +CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM=y diff --git a/tools/unit-test-app/configs/single_core_s2 b/tools/unit-test-app/configs/single_core_s2 index 9348707f1..8607b815b 100644 --- a/tools/unit-test-app/configs/single_core_s2 +++ b/tools/unit-test-app/configs/single_core_s2 @@ -3,4 +3,4 @@ CONFIG_IDF_TARGET="esp32s2" TEST_COMPONENTS=freertos esp32s2 esp_timer driver heap pthread soc spi_flash vfs test_utils CONFIG_MEMMAP_SMP=n CONFIG_FREERTOS_UNICORE=y -CONFIG_ESP32_RTCDATA_IN_FAST_MEM=y +CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM=y