Commit Graph

155 Commits

Author SHA1 Message Date
Li Shuai
94ebda298a fix the issue of failure of receiving beacons in modem state caused by enabling light sleep in wifi min/max modem sleep mode 2023-04-07 05:57:15 +00:00
wuzhenghui
fcf0498da8 esp_pm: update doc for PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP 2023-03-30 10:33:47 +08:00
Marius Vikhammer
0be8e03907 ci: update test apps to use run_all_single_board_cases 2023-03-10 14:27:09 +08:00
Li Shuai
1a10eabe41 Power Management: refactor the configuration of each module in sleep mode 2023-03-04 00:17:40 +08:00
Li Shuai
200f69e6eb auto beacon: support esp32c6 autobeacon (advanced DTIM sleep feature)
modem retention: Support esp32c6 wifi MAC and baseband sleep retention

sleep_modem: wifi MAC modem wakeup protect in modem state before PMU trigger sleep enable request

sleep modem: provide a interface to get whether the Modem power domain is allowed to power off during sleep

add i2c_ana master header file to project

auto beacon: release PMU's lock on root clock source (it is locked in the PLL)

wifi receiving beacon frame in PMU modem state strongly depends on the BBPLL
clock, PMU will forcibly lock the root clock source as PLL, when the root
clock source of the software system is selected as PLL, we need to release
the root clock source locking.

When it is judged that the PLL is locked by PMU after wakeing up from the PMU
modem state, switch the root clock source to the PLL in the sleep process (a
critical section).

auto beacon: fix the failure to receive broadcast/multicast frames in modem state

When the multicast field in the beacon frame received in the PMU modem state is
True, the PMU switches to the PMU active state (the PMU waits for the HP LDO to
stabilize and then restores the MAC context) and starts to receive
broadcast/multicast frames (Broadcast/Multicast frames will be sent after a
minimum delay of 48 us after the beacon frame), because the PMU waits for the HP
LDO to stabilize too long (~154 us), which will cause broadcast/multicast frame
reception to be missed.

auto beacon: select the PLL clock source as the REGDMA backup clock source when the PMU switches to ACTIVE from MODEM state

update Digital Peripheral (M2A switch) REGDMA restore time parameter

auto beacon: fix the issue that only channel 1 can connect to AP in modem state
2023-03-04 00:17:40 +08:00
jingli
8f415a7f44 refactor: power management component use unified esp_pm_config_t 2023-02-23 11:36:07 +08:00
Wu Zheng Hui
113132e4f4 Merge branch 'feature/bringup_esp32c6_light_sleep_pd_top' into 'master'
esp32c6: support light_sleep (Stage 2: support Digital Peripheral power down)

See merge request espressif/esp-idf!22197
2023-02-15 16:17:53 +08:00
fuzhibo@espressif.com
e252748d92 periph retention: runtime critical digital peripherals sleep retention support 2023-02-15 11:46:40 +08:00
Cao Sen Miao
fd3e0b0b18 esp32h2(ci): enable target test 2023-02-15 10:20:43 +08:00
jingli
28c7620cba sleep: fix gpio wakeup not working properly in some cases
Before this fix, when we call esp_pm_configure after gpio_wakeup_enable,
the configuration of GPIO in sleep state in gpio_wakeup_enable will be
overwritten by esp_pm_configure.
2023-02-11 01:06:18 +00:00
jingli
557a1ed1a5 soc_caps: remove SOC_GPIO_SUPPORT_SLP_SWITCH
all esp chips support this feature
2023-02-11 01:06:18 +00:00
jingli
13b5e625a7 UT/esp32c2: reenable pm and sleep related UT 2023-02-02 20:26:08 +08:00
Li Shuai
68594abe05 sleep: light sleep supported for esp32c6 2023-01-31 22:12:58 +08:00
wuzhenghui
a5467f42a0 codeclean: only S series chip VDDSDIO is configurable 2023-01-31 22:12:58 +08:00
Li Shuai
1c39d64f95 cpu retention: refactor cpu retention and add cpu retention versions option in soc caps 2023-01-31 22:12:50 +08:00
Li Shuai
0f6cda1dd3 Power Management: support DFS 2023-01-31 22:12:27 +08:00
Cao Sen Miao
94120b82c2 esp32h2: add build test 2023-01-17 10:29:04 +08:00
Darian Leung
412b09abf4 esp_pm: Migrate unit tests to test app
This commit migrates the esp_pm unit tests from the legacy unit test to a
stand alone test app. The following CI configurations are provided

- Default: Automatic light sleep with mostly default configurations
- Options: Enables all of the optional esp_pm features
- Limits: Limit tests esp_pm
2023-01-10 15:43:33 +08:00
Cao Sen Miao
4713a9a7f2 ESP32H2: Introduce new chip target esp32h2, hello_world example supported 2022-12-29 12:29:14 +08:00
Darian Leung
2f504695e4 esp_pm: Fix string formatting type errors
This commit fixes a string formatting error in esp_pm with CONFIG_PM_PROFILING
is enabled.

Closes https://github.com/espressif/esp-idf/issues/10347
2022-12-21 15:50:12 +08:00
Darian Leung
13cec981df esp_pm: Fix build error when CONFIG_PM_PROFILING is enabled 2022-12-21 15:50:12 +08:00
laokaiyao
8677216576 esp32h2: renaming esp32h2 to esp32h4 2022-11-08 17:05:33 +08:00
Song Ruo Jing
2557e24a28 ci: Enable esp32c6 example, test_apps, and unit tests CI build stage 2022-11-01 11:23:21 +08:00
Omar Chebib
c8614a0dbf esp_timer: add a function to restart timer
Timers, periodic or not, can now be restarted thanks to esp_timer_restart function.
This is done atomically, which can be used to feed a periodic timer, or simply change the period.
2022-10-18 04:42:27 +00:00
wuzhenghui
a7b549acca esp32c6: add esp_pm support 2022-09-26 20:32:13 +08:00
Omar Chebib
30d12af191 TWDT: refactor the TWDT to be driver agnostic
This refactoring brings a private API for the TWDT implementation, which
can now use a hardware timer (Timer Group) or a software timer (esp_timer)
2022-09-15 14:37:59 +08:00
Omar Chebib
53c7dd4efc WDT: implement interrupt wdt and task wdt for ESP32-C2
ESP32-C2 has a single group timer, thus it will use it for the interrupt watchdog,
which is more critical than the task watchdog. The latter is implement in
software thanks to the `esp_timer`component.
2022-09-15 14:37:59 +08:00
Fu Hanxi
317f6bc024 esp_pm: fix esp32c2 no sleep_enable_memory_retention error 2022-08-29 16:57:31 +08:00
Michael (XIAO Xufeng)
746f4b814c uart: move frequency of clock sources out of HAL 2022-08-15 18:55:43 +00:00
songruojing
4983b2786a pm: update pm test cases to support esp32c2 2022-08-08 14:45:53 +08:00
Ivan Grokhotkov
401c10ecfb build system: re-add -Wno-format as private flag for some components 2022-08-03 16:42:47 +04:00
Guillaume Souchere
6005cc9163 hal: Deprecate interrupt_controller_hal.h, cpu_hal.h and cpu_ll.h interfaces
This commit marks all functions in interrupt_controller_hal.h, cpu_ll.h and cpu_hal.h as deprecated.
Users should use functions from esp_cpu.h instead.
2022-07-22 00:06:06 +08:00
Darian Leung
546a7fc495 esp_pm: Disable esp_pm when SMP FreeRTOS is enabled
SMP FreeRTOS currently does not support power management yet. This
commit makes SMP FreeRTOS and esp_pm mutually exclusive.
2022-06-15 16:17:59 +08:00
Michael (XIAO Xufeng)
6a8aed12ee ci: partially enable ut tests for esp32c2
Disabled test cases are tracked in:

 IDF-4465, IDF-5045, IDF-5057, IDF-5058, IDF-5059, IDF-5060, IDF-5061, IDF-5131

- test_fatfs: IDF-5136

- test_pm: IDF-5053

- test_cache_mmu: IDF-5138

- test_partitions: IDF-5137

- test_vfs: IDF-5139

- test_freertos: IDF-5140

- test_wpa_supplicant: IDF-5046

- test_mbedtls: IDF-5141

- test_pthread: IDF-5142

- test_protocomm: IDF-5143

- test_lightsleep: IDF-5053

- test_taskwdt: IDF-5055

- test_tcp_transport: IDF-5144

- test_app_update: IDF-5145

- test_timer: IDF-5052

- test_spi: IDF-5146

- test_rtc_clk: IDF-5060

- test_heap: IDF-5167

ci: fixed issues for tests of libgcc, ets_timer, newlib

test_pm: support on C2
2022-06-02 14:23:35 +08:00
Darian Leung
daa950d9ed freertos: Replace portSET_INTERRUPT_MASK_FROM_ISR() call for SMP
The behavior of portSET_INTERRUPT_MASK_FROM_ISR() has changed in SMP FreeRTOS. It's
previous behavior is now implemented in portDISABLE_INTERRUPTS() and portRESTORE_INTERRUPTS().

This commit replaces all portSET_INTERRUPT_MASK_FROM_ISR() and portCLEAR_INTERRUPT_MASK_FROM_ISR()
calls with portDISABLE_INTERRUPTS() and portRESTORE_INTERRUPTS() respectively
2022-05-30 06:11:24 +08:00
Darian Leung
5953bca376 esp_system: Add arbitrary user feature to TWDT
This commit moidifies the TWDT as follows:

- Adds a feature to allows subscribing arbitrary users to the TWDT
- Changes esp_task_wdt_init() API to accept configuration structure
- Changes esp_task_wdt_init() and esp_task_wdt_deinit() to subscribe/unsubscribe
  idle tasks of various cores.
- Adds support for SMP FreeRTOS idle tasks
- Updates startup code TWDT initialization
- Updates API documentation
2022-05-13 18:01:28 +08:00
morris
722fde218d uart: add default source clock for all targets 2022-05-09 11:26:30 +08:00
morris
e7295c3577 gptimer: added enable/disable functions 2022-05-06 18:18:39 +08:00
Jiang Jiang Jian
1b81efc320 Merge branch 'bugfix/idle_task_skipped_light_sleep' into 'master'
pm_impl: fix neither enter light sleep nor enter "waiti" state in idle task

Closes IDFGH-6294

See merge request espressif/esp-idf!17820
2022-04-28 16:11:29 +08:00
Ivan Grokhotkov
708e99497b
global: add dependency on esp_timer component and include esp_timer.h
Some components were including esp_timer.h without declaring a
dependency on esp_timer component. This used to work due to a
transitive public dependency on esp_timer from freertos component.
Add explicit dependencies where needed.
Also some source files were using esp_timer functions without
including the header file. This used to work because esp_timer.h was
included from freertos port header file. This commit adds esp_timer.h
includes where needed.
2022-04-25 18:39:23 +02:00
Marius Vikhammer
45c1d1cba2 Merge branch 'feature/move_target_kconfig_2' into 'master'
system: move kconfig options out of target component

See merge request espressif/esp-idf!17321
2022-04-24 13:29:43 +08:00
Marius Vikhammer
d2872095f9 soc: moved kconfig options out of the target component.
Moved the following kconfig options out of the target component:
 * CONFIG_ESP*_DEFAULT_CPU_FREQ* -> esp_system
 * ESP*_REV_MIN -> esp_hw_support
 * ESP*_TIME_SYSCALL -> newlib
 * ESP*_RTC_* -> esp_hw_support

Where applicable these target specific konfig names were merged into
a single common config, e.g;
CONFIG_ESP*_DEFAULT_CPU_FREQ -> CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ
2022-04-21 12:09:43 +08:00
gaoxiaojie
a64cd9c908 pm_impl: fix neither enter light sleep nor enter waiti state in idle task 2022-04-20 17:28:17 +08:00
morris
f32a89826c clk_tree: added default clock source for peripheral 2022-04-14 15:44:56 +08:00
songruo
60bb5c913d clk_tree: prework of introducing clk subsystem control
1. Clean up clk usage in IDF, replace rtc_clk_xtal/apb_freq_get with
   upper level API esp_clk_xtal/apb_freq
2. Fix small errors and wrong comments related to clock
3. Add clk_tree_defs.h to provide an unified clock id for each chip
   Modify the NGed drivers to adopt new clock ids
2022-04-11 12:09:06 +08:00
morris
bf677182a6 sigmadelta: change gpio number from u8 to int
Fix the issue that macro compares unsigned to 0
2022-03-29 11:53:31 +08:00
Omar Chebib
2571aaf3c9 G0: target component (components/esp32*) doesn't depend on driver anymore 2022-03-02 04:21:00 +00:00
Marius Vikhammer
edb76f14d6 esp_timer: remove legacy ESP32 FRC timer implementation. 2022-02-10 15:17:49 +08:00
Sudeep Mohanty
2fc9bd61bf ulp: refactor ulp component
This commit refactors the ulp component.
Files are now divided based on type of ulp, viz., fsm or risc-v.
Files common to both are maintained in the ulp_common folder.

This commit also adds menuconfig options for ULP within the ulp
component instead of presenting target specific configuations for ulp.
2022-01-27 11:54:42 +05:30
laokaiyao
cf049e15ed esp8684: rename target to esp32c2 2022-01-19 11:08:57 +08:00
morris
705788a13f unit_tests: replace legacy timer group with gptimer 2022-01-07 14:59:09 +08:00
morris
869bed1bb5 soc: don't expose unstable soc header files in public api 2022-01-06 23:10:22 +08:00
Cao Sen Miao
eddc196081 esp_clk: refactor target/clk.h to private/esp_clk.h 2021-11-26 14:56:30 +08:00
Roland Dobai
766aa57084 Build & config: Remove leftover files from the unsupported "make" build system 2021-11-11 15:32:36 +01:00
xiongweichao
422cf3cf37 Fix crash caused by bluetooth high level interrupt 2021-11-10 16:11:10 +08:00
Cao Sen Miao
a9f0a3531e ESP8684: add driver esp_pm heap support 2021-11-06 17:33:44 +08:00
Darian Leung
d6f2fa4bab freertos: Remove critical nested macros
This commit removes the following critical nested macros as follows:

- portENTER_CRITICAL_NESTED()
- portEXIT_CRITICAL_NESTED()

They are replaced with portSET_INTERRUPT_MASK_FROM_ISR() and
portCLEAR_INTERRUPT_MASK_FROM_ISR() which are the proper FreeRTOS interfaces.

Created a portmacro_deprecated.h for each port to contain deprecated API
that were originally from portmacro.h
2021-10-22 13:17:20 +08:00
Li Shuai
ccf1a9a1fc light sleep: add i/d-cache tagmem retention support for esp32s3 2021-08-27 11:11:09 +08:00
Li Shuai
03746de96f light sleep: add cpu power down support for esp32s3 2021-08-27 11:11:06 +08:00
Li Shuai
15fc449793 light sleep: separate sleep retention function 2021-08-24 11:54:47 +08:00
Li Shuai
b0757dfcfa light sleep: separate sleep gpio function 2021-08-23 10:22:12 +08:00
Li Shuai
d3b5f97573 system: fix pm lock issue in dual core mode 2021-08-11 16:00:07 +08:00
Konstantin Kondrashov
29f581fc70 freertos(esp32s3): SysTick uses systimer 2021-08-04 20:33:44 +08:00
Li Shuai
c460905fd9 fix RTOS SysTick cycle time error caused by DFS 2021-07-22 21:48:56 +08:00
Renz Bagaporo
7c22cccb9c esp32: cleanup build script 2021-07-16 20:14:27 +08:00
Shu Chen
6fce2930d0 esp32h2: enable more components to support esp32h2
Involved components:
 * app_trace
 * esp-tls
 * esp_adc_cal
 * esp_pm
 * esp_serial_slave_link
 * esp_timer
 * freertos
 * idf_test
 * log
 * mbedtls
 * newlib
 * perfmon
 * spi_flash
 * spiffs
 * ulp
 * unity
 * vfs
2021-07-01 19:53:11 +08:00
KonstantinKondrashov
f9ad16bb66 esp_timer: Timers with skip_unhandled_events option won't wake up system from light sleep 2021-06-19 12:45:17 +08:00
ninh
91dbae3eb5 esp_pm: allow dfs to swith down alltime if no lightsleep 2021-04-29 18:41:00 +08:00
Jiang Jiang Jian
d6a2a67006 Merge branch 'bugfix/fix_some_pm_issue' into 'master'
esp_pm: fix an issue and add an interface

Closes IDF-2984 and IDF-2944

See merge request espressif/esp-idf!12787
2021-04-13 03:42:46 +00:00
Renz Bagaporo
586023790e esp_system: move sleep modes to esp_hw_support, power down light sleep to esp_pm 2021-04-07 17:53:37 +08:00
Angus Gratton
6b57f33858 Merge branch 'refactor/movements_from_target_components' into 'master'
Movement from target components 1

See merge request espressif/esp-idf!12482
2021-04-05 02:37:21 +00:00
ninh
7395e075f8 esp_pm: fix an issue and add an interface 2021-04-01 02:23:42 +00:00
Renz Bagaporo
e6edf34e82 esp32: move esp_clk functions 2021-03-31 19:17:33 +08:00
Marius Vikhammer
b4d2fb56a0 ci: enable previously disabled unit tests 2021-03-29 18:36:41 +08:00
Li Shuai
b3bc27972e light sleep: add software workaround for esp32c3 gpio reset issue 2021-03-25 15:03:09 +08:00
Li Shuai
1595973fe8 light sleep: some default parameters optimization 2021-03-10 18:22:41 +00:00
Angus Gratton
d6f4d99d93 core system: Fix warnings in compilation when assertions are disabled
Adds a CI config for hello world that sets this, to catch future regressions
2021-03-03 10:26:57 +11:00
Renz Bagaporo
0e0914476c esp_common: move freertos hooks 2021-02-24 12:16:37 +08:00
Renz Bagaporo
deaad431f4 esp_common: move task, int wdt 2021-02-24 12:16:37 +08:00
Sachin Parekh
e6ccb812b2 esp_pm: Label each column of lock dump 2021-02-11 18:44:51 +05:30
Angus Gratton
3532f52f60 Merge branch 'bugfix/ldgen_ignore_nonexistent_archives_and_obj' into 'master'
ldgen: check mappings

Closes IDF-1624

See merge request espressif/esp-idf!8557
2021-01-21 15:59:35 +08:00
Li Shuai
f168ac3b39 light sleep: add cpu power down support for esp32c3 2021-01-19 14:51:50 +08:00
Li Shuai
ac7d1bec76 light sleep: overhead time accuracy optimization for esp32c3 2021-01-19 14:50:58 +08:00
Li Shuai
355dd10257 light sleep: dfs support for esp32c3 2021-01-19 14:50:58 +08:00
Renz Bagaporo
d1c800fbbb components: fix ldgen check errors 2021-01-19 11:17:18 +08:00
ninh
659d805411 esp_wifi: light sleep optimization 2021-01-18 15:31:03 +08:00
ninh
27aa6c289f components/pm: Add slp gpio configure workaround 2021-01-15 15:34:45 +08:00
KonstantinKondrashov
dada7cd035 global: Uses CCOUNT API instead of XTHAL macro 2021-01-12 16:24:23 +08:00
ninh
e908a32381 put pm_slp_iram_opt and pm_rtos_iram_opt related attributes in esp_pm/linker.lf 2021-01-06 03:40:28 +00:00
Marius Vikhammer
68608f804c esp32c3: Misc fixes needed to build & run 2020-12-31 15:20:05 +11:00
Liu Ning
57aa65eeed components/pm: Add sleep related code iram opt chioce 2020-12-23 14:45:36 +08:00
Armando
05a4a8d864 uart: seperate sclk and baudrate setting 2020-11-24 19:12:52 +08:00
Armando
fb8b905539 uart: add uart support on esp32s3 2020-11-24 19:12:51 +08:00
Angus Gratton
420aef1ffe Updates for riscv support
* Target components pull in xtensa component directly
* Use CPU HAL where applicable
* Remove unnecessary xtensa headers
* Compilation changes necessary to support non-xtensa gcc types (ie int32_t/uint32_t is no
  longer signed/unsigned int).

Changes come from internal branch commit a6723fc
2020-11-13 07:49:11 +11:00
Angus Gratton
66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00
Ivan Grokhotkov
b6b1d1b49a Merge branch 'bugfix/pm_dump_format' into 'master'
esp_pm: fix formatting issues in esp_pm_dump_locks

See merge request espressif/esp-idf!10842
2020-10-20 22:21:03 +08:00
Ivan Grokhotkov
b98032aae4 Merge branch 'bugfix/pm_uart_garbage' into 'master'
esp_pm: fix garbage on UART when CONFIG_PM_ENABLE=y

See merge request espressif/esp-idf!10843
2020-10-20 22:18:00 +08:00
Konstantin Kondrashov
9386cafbc3 time: Fix gettimeofday for ESP32-S3 2020-10-20 14:09:32 +08:00
Ivan Grokhotkov
30754918ee esp_pm: fix formatting issues in esp_pm_dump_locks
- line was truncated because 64 characters were not sufficient
- length passed to snprintf should be full buffer length, not -1
- make the width of lock name field fixed
- fix alignment of lock type column
2020-10-19 18:54:34 +02:00
Ivan Grokhotkov
50ef2f97d6 esp_pm: fix garbage on UART when CONFIG_PM_ENABLE=y
`uart_ll_get_txfifo_len` returns the number of bytes available in the
TX FIFO; The condition we need is "FIFO empty", not "FIFO has free
space". `uart_ll_is_tx_idle` does that, and also ensures that the last
character popped from the TX FIFO has been fully transmitted.
2020-10-14 19:43:53 +02:00