mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
sleep: keep RTC_SLOW_MEM powered on if RTC_NOINIT is used
Fixes a bug that if application uses RTC_NOINIT variables but doesn’t use RTC_DATA variables, then RTC_NOINIT variables loose their values after deep sleep. Reported in https://esp32.com/viewtopic.php?f=2&t=7045&p=30301#p30299
This commit is contained in:
parent
d6547595d7
commit
b7fde00aed
@ -607,10 +607,14 @@ static uint32_t get_power_down_flags()
|
||||
// RTC_SLOW_MEM is Auto, keep it powered up as well.
|
||||
|
||||
// These labels are defined in the linker script:
|
||||
extern int _rtc_data_start, _rtc_data_end, _rtc_bss_start, _rtc_bss_end;
|
||||
extern int _rtc_data_start, _rtc_data_end,
|
||||
_rtc_bss_start, _rtc_bss_end,
|
||||
_rtc_noinit_start, _rtc_noinit_end;
|
||||
|
||||
if ((s_config.pd_options[ESP_PD_DOMAIN_RTC_SLOW_MEM] == ESP_PD_OPTION_AUTO) &&
|
||||
(&_rtc_data_end > &_rtc_data_start || &_rtc_bss_end > &_rtc_bss_start ||
|
||||
(&_rtc_data_end > &_rtc_data_start ||
|
||||
&_rtc_bss_end > &_rtc_bss_start ||
|
||||
&_rtc_noinit_end > &_rtc_noinit_start ||
|
||||
(s_config.wakeup_triggers & RTC_ULP_TRIG_EN))) {
|
||||
s_config.pd_options[ESP_PD_DOMAIN_RTC_SLOW_MEM] = ESP_PD_OPTION_ON;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user