kopia lustrzana https://github.com/espressif/esp-idf
22dd3103bd
Tickless idle/light sleep procedure had a bug in single core mode. Consider the flow of events: 1. Idle task runs and calls vApplicationIdleHook 2. This calls esp_vApplicationIdleHook, which calls esp_pm_impl_idle_hook, and pm lock for RTOS on the current core is released. 3. Then esp_vApplicationIdleHook calls esp_pm_impl_waiti, which checks that s_entered_light_sleep[core_id]==false and goes into waiti state. 4. Some interrupt happens, calls esp_pm_impl_isr_hook, which takes pm lock for RTOS. PM state goes back to CPU_FREQ_MAX. 5. Once the interrupt is over, vApplicationIdleHook returns, and Idle task continues to run, finally reaching the call to vApplicationSleep. 6. vApplicationSleep does not enter light sleep, because esp_pm_impl_isr_hook has already changed PM state from IDLE to CPU_FREQ_MAX. This didn’t happen in dual core mode, because waiti state of one CPU was interrupted by CCOMPARE update interrupt from the other CPU, in which case PM lock for FreeRTOS was not taken. Fix by inverting the meaning of the flag (for convenience) and only setting it to true when vApplicationSleep actually fails to enter light sleep. |
||
---|---|---|
.. | ||
hwcrypto | ||
include | ||
ld | ||
lib@ee0d0b152f | ||
test | ||
CMakeLists.txt | ||
Kconfig | ||
Makefile.projbuild | ||
brownout.c | ||
cache_err_int.c | ||
cache_sram_mmu.c | ||
clk.c | ||
coexist.c | ||
coexist_internal.h | ||
component.mk | ||
core_dump.c | ||
cpu_start.c | ||
crosscore_int.c | ||
dbg_stubs.c | ||
dport_access.c | ||
dport_panic_highint_hdl.S | ||
esp_clk_internal.h | ||
esp_err_to_name.c | ||
esp_err_to_name.c.in | ||
esp_himem.c | ||
esp_system_internal.h | ||
esp_timer.c | ||
esp_timer_esp32.c | ||
esp_timer_impl.h | ||
ets_timer_legacy.c | ||
event_default_handlers.c | ||
event_loop.c | ||
fast_crypto_ops.c | ||
freertos_hooks.c | ||
gdbstub.c | ||
hw_random.c | ||
int_wdt.c | ||
intr_alloc.c | ||
ipc.c | ||
lib_printf.c | ||
libhal.a | ||
panic.c | ||
phy.h | ||
phy_init.c | ||
phy_init_data.h | ||
pm_esp32.c | ||
pm_impl.h | ||
pm_locks.c | ||
pm_trace.c | ||
pm_trace.h | ||
reset_reason.c | ||
restore.c | ||
sleep_modes.c | ||
spiram.c | ||
spiram_psram.c | ||
spiram_psram.h | ||
stack_check.c | ||
system_api.c | ||
task_wdt.c | ||
wifi_init.c | ||
wifi_os_adapter.c |