OVMS3-idf/components
Ivan Grokhotkov 22dd3103bd pm: fix entering light sleep in single core mode
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.
2018-11-05 12:18:29 +08:00
..
app_trace cmake: Add support for test build 2018-10-20 12:07:24 +08:00
app_update cmake: Add support for test build 2018-10-20 12:07:24 +08:00
asio cmake: make main a component again 2018-09-11 09:44:12 +08:00
aws_iot cmake: make main a component again 2018-09-11 09:44:12 +08:00
bootloader bootloader: verify that loaded image does not overlap bootloader code 2018-10-26 12:44:10 +08:00
bootloader_support bootloader: verify that loaded image does not overlap bootloader code 2018-10-26 12:44:10 +08:00
bt components/bt: Point ACL RX buffer ptr to ACL RX buffer if ACL RX buffer ptr is null 2018-11-01 17:33:44 +08:00
coap cmake: silence some warnings in coap, bt, expat, libsodium, lwip and examples/bluetooth 2018-09-20 18:53:15 +08:00
console cmake: fix source list issues 2018-09-13 08:56:59 +08:00
cxx cmake: Add support for test build 2018-10-20 12:07:24 +08:00
driver spi_master: speed up polling performance by putting into IRAM 2018-10-25 12:31:45 +08:00
esp-tls mqtt: ssl mutual authentication example added per PR from github, corrected cmake build, updated per idf style 2018-10-30 08:04:09 +01:00
esp32 pm: fix entering light sleep in single core mode 2018-11-05 12:18:29 +08:00
esp_adc_cal cmake: make main a component again 2018-09-11 09:44:12 +08:00
esp_event esp_event: lower test performance threshold for PSRAM config 2018-11-01 13:50:08 +08:00
esp_http_client tcp_transport: renamed possibly generic function names to be esp_ prefixed and not to colide with user namespace 2018-10-02 14:16:48 +02:00
esp_http_server HTTP Server : Added esp_ prefix to http_server component files 2018-10-24 17:32:20 +05:30
esp_https_ota cmake: make main a component again 2018-09-11 09:44:12 +08:00
esp_ringbuf cmake: Add support for test build 2018-10-20 12:07:24 +08:00
espcoredump cmake: Add support for test build 2018-10-20 12:07:24 +08:00
esptool_py Merge branch 'bugfix/run_esptool_espport' into 'master' 2018-10-17 08:14:20 +08:00
ethernet Fix some typos related to ethernet documentation and Kconfig. Closes https://github.com/espressif/esp-idf/pull/2642 2018-10-28 21:12:09 +01:00
expat cmake: Add support for test build 2018-10-20 12:07:24 +08:00
fatfs cmake: Add support for test build 2018-10-20 12:07:24 +08:00
freemodbus examples: freemodbus port slave basic implementation 2018-10-17 12:47:12 +02:00
freertos freertos: fix compilation warning in single core mode 2018-11-05 12:18:29 +08:00
heap cmake: Add support for test build 2018-10-20 12:07:24 +08:00
idf_test Merge branch 'test/fix_bug_of_scan_interval_and_windows' into 'master' 2018-11-05 11:00:58 +08:00
jsmn cmake: make main a component again 2018-09-11 09:44:12 +08:00
json cmake: make main a component again 2018-09-11 09:44:12 +08:00
libsodium cmake: Add support for test build 2018-10-20 12:07:24 +08:00
log cmake: make main a component again 2018-09-11 09:44:12 +08:00
lwip Fix some typos related to ethernet documentation and Kconfig. Closes https://github.com/espressif/esp-idf/pull/2642 2018-10-28 21:12:09 +01:00
mbedtls Fix some typos related to ethernet documentation and Kconfig. Closes https://github.com/espressif/esp-idf/pull/2642 2018-10-28 21:12:09 +01:00
mdns mdns: fixed crashes on network changes 2018-10-24 12:03:41 +02:00
micro-ecc cmake: make main a component again 2018-09-11 09:44:12 +08:00
mqtt mqtt: ssl mutual authentication example added per PR from github, corrected cmake build, updated per idf style 2018-10-30 08:04:09 +01:00
newlib cmake: Add support for test build 2018-10-20 12:07:24 +08:00
nghttp cmake: make main a component again 2018-09-11 09:44:12 +08:00
nvs_flash cmake: Add support for test build 2018-10-20 12:07:24 +08:00
openssl cmake: make main a component again 2018-09-11 09:44:12 +08:00
partition_table cmake: Add support for test build 2018-10-20 12:07:24 +08:00
protobuf-c protobuf-c : Added Google's protocol buffer C library as sub-module 2018-10-02 19:07:28 +05:30
protocomm Protocomm : Use esp_http_server instead of http_server 2018-10-24 17:32:43 +05:30
pthread Merge branch 'feature/cmake-unit-test' into 'master' 2018-10-22 16:29:15 +08:00
sdmmc cmake: Add support for test build 2018-10-20 12:07:24 +08:00
smartconfig_ack cmake: make main a component again 2018-09-11 09:44:12 +08:00
soc test: fix the unit test fail issue under single_core config 2018-10-31 17:04:32 +08:00
spi_flash cmake: Add support for test build 2018-10-20 12:07:24 +08:00
spiffs cmake: Add support for test build 2018-10-20 12:07:24 +08:00
tcp_transport mqtt: ssl mutual authentication example added per PR from github, corrected cmake build, updated per idf style 2018-10-30 08:04:09 +01:00
tcpip_adapter mdns: fixed crashes on network changes 2018-10-24 12:03:41 +02:00
ulp cmake: Add support for test build 2018-10-20 12:07:24 +08:00
vfs cmake: Add support for test build 2018-10-20 12:07:24 +08:00
wear_levelling Version update from V1 to V2 now done in correct way. 2018-10-26 09:21:30 +03:00
wifi_provisioning Examples : Added provisioning examples, tests and client tool. 2018-10-02 19:07:28 +05:30
wpa_supplicant cmake: Add support for test build 2018-10-20 12:07:24 +08:00
xtensa-debug-module cmake: make main a component again 2018-09-11 09:44:12 +08:00