113 Commits

Author SHA1 Message Date
cjin 2e23886193 fix(pm): expand the number of skip light sleep number 2026-03-13 17:18:38 +08:00
wuzhenghui cf94981732 feat(pm): add light sleep tick overflow protection configuration 2026-01-29 12:02:50 +08:00
morris 0469db2f83 refactor(rcc): unify the usage of clock control macros for peripherals
- Removed conditional definitions for various RCC_ATOMIC macros across
multiple files, replacing them with a unified PERIPH_RCC_ATOMIC() macro.
- Updated instances where specific RCC_ATOMIC macros were used to ensure
consistent usage of PERIPH_RCC_ATOMIC().
- Deleted unused uart_share_hw_ctrl.h file as its functionality is now
integrated into the new structure.
2026-01-23 18:28:13 +08:00
Song Ruo Jing 62511d61e9 refactor(clk): split clock HAL into separate component 2026-01-13 15:50:20 +08:00
wuzhenghui 47651df567 change(esp_pm): skip vTaskStepTick if lightsleep request is rejected 2025-12-19 17:25:47 +08:00
Xiao Xufeng 230ee88d99 feat(spi_flash): implement dynamic CPU frequency switching workaround for encrypted writes
This commit implements a workaround that allows ESP32-C5 to run at 240MHz CPU frequency
normally, while automatically reducing CPU frequency during encrypted flash writes to
ensure correct operation. The frequency limit is chip revision dependent:
- v1.2 and above: limited to 160MHz during encrypted writes
- v1.0 and below: limited to 80MHz during encrypted writes

Key implementation details:
- Frequency limiting is triggered automatically when esp_flash_write_encrypted() is called
- Uses start() flags (ESP_FLASH_START_FLAG_LIMIT_CPU_FREQ) to integrate with OS layer
- Works with both PM enabled and disabled configurations
- Frequency is automatically restored after encrypted write completes
- For ESP32-C5 with 120MHz flash, Flash clock and timing registers are adjusted when
  CPU frequency is reduced to 80MHz
- SPI1 timing registers are configured during frequency switching since encrypted writes
  use SPI1 and must work correctly at reduced CPU frequencies

Code improvements:
- Use SOC_MSPI_FREQ_AXI_CONSTRAINED capability macro instead of hardcoded chip checks
- Control workaround via Kconfig (CONFIG_PM_WORKAROUND_FREQ_LIMIT_ENABLED) instead of
  hardcoded macros
- Add comprehensive test cases covering various PM configurations and edge cases

This workaround enables ESP32-C5 applications to benefit from 240MHz CPU performance
while maintaining reliable encrypted flash write functionality.
2025-12-16 17:42:44 +08:00
wuzhenghui 065dd70056 change(esp_hw_support): move ESP_SLEEP_POWER_DOWN_CPU to Kconfig 2025-10-14 16:33:30 +08:00
C.S.M b145ede835 refactor(mspi): Make mspi hal layer independent 2025-09-26 14:57:54 +08:00
wuzhenghui f861b7dd65 fix(esp_hw_support): config lact in critical 2025-06-13 20:38:46 +08:00
wuzhenghui 65b7e70564 feat(driver): support acquire/release clock source dependency for all drivers 2025-05-27 21:21:38 +08:00
wuzhenghui 022614b1d3 fix(esp_hw_support): update systimer step immediately when XTAL changes on esp32s2 2025-05-22 13:58:54 +08:00
wuzhenghui 2931aa23b6 fix(esp_hw_support): update LACT clock prescale immediately when APB changes on esp32 2025-05-22 13:58:50 +08:00
Wu Zheng Hui fe3da7167e Merge branch 'fix/fix_esp32p4_retention_cost' into 'master'
fix(esp_hw_support): optimize retention cost and update sleep time compensation

See merge request espressif/esp-idf!37920
2025-04-23 13:20:49 +08:00
wuzhenghui a1471f4f78 feat(esp_hw_support): remeasure sleep_time_overhead_out if min_freq_mhz changed 2025-04-22 22:02:34 +08:00
Li Shuai 954270dda3 change(esp_hw_support): optimize sleep memory (iram or flash) usage control by PM_SLP_IRAM_OPT 2025-04-17 22:01:10 +08:00
Chen Jichang 45ba78940f feat(esp32h4): finnal introduce hello world 2025-03-19 18:48:41 +08:00
Li Shuai 82ab6b8cf9 fix(power_management): fix ci warning due to unused variable config 2025-03-17 11:24:39 +08:00
Li Shuai e351f17790 change(esp_hw_support): support power management dfs flow 2025-03-17 11:24:39 +08:00
Armando d64ca3a5d1 fix(mspi): fixed cpu and mspi freq mismatch issue when in dfs/sleep on p4 2025-03-07 12:27:16 +08:00
Armando 14b5db0e87 refactor(mspi): rename to mspi_ll.h 2025-01-07 16:16:06 +08:00
gaoxu 25731d0c1e feat(esp32h21): finnal introduce hello world support 2024-12-30 20:14:40 +08:00
wuzhenghui a48dfae871 fix(esp_pm): enable RTC_PERIPH domain once in esp_pm_trace_init 2024-12-26 10:41:49 +08:00
wuzhenghui 7d0d95b7d8 fix(esp_hw_support): fix mspi clock freq changed after lightsleep 2024-12-13 15:47:49 +08:00
Alexey Lapshin 888b5f7e8d feat(newlib): add picolibc support 2024-12-02 21:35:56 +07:00
wuzhenghui df52e1aa71 fix(esp_pm): fix deadlock in pm_mode switching 2024-11-13 12:12:23 +08:00
wuzhenghui b4bd3d98bd fix(esp_pm): fix missed ccompare update when another core is already in do_switch 2024-11-13 12:11:47 +08:00
wuzhenghui 13e42707a0 feat(esp_hw_support): add clk tree source gate management api 2024-09-11 10:53:01 +08:00
Marius Vikhammer 0d140f38ea fix(system): fixed warnings related to ununsed var if asserts disabled 2024-08-26 10:25:04 +08:00
wuzhenghui dee3e19599 fix(esp_pm): configure timer wakeup source with auto light-sleep congiguration 2024-07-30 21:28:07 +08:00
Alexey Gerenkov 8b93323da6 Merge branch 'upgrade_clang_toolchain' into 'master'
Upgrade clang toolchain version to 'esp-17.0.1_20240419'

See merge request espressif/esp-idf!29811
2024-05-14 21:47:06 +08:00
Alexey Gerenkov e86f1e8a7f fix(esp_pm): Fix APB clock calculation for chips w/o modem 2024-05-03 16:55:18 +03:00
wuzhenghui 01dce77fa7 feat(esp_pm): fix esp32p4 cpu powerdown kconfig dependency error 2024-04-23 11:54:45 +08:00
Wu Zheng Hui a759bc0f52 Merge branch 'feat/set_cpu_freq_after_pm_config_changed' into 'master'
fix(esp_pm): update CPU frequency immediately after updating pm_config

Closes IDFGH-12481

See merge request espressif/esp-idf!29963
2024-04-07 13:47:20 +08:00
wanlei 20c18ac52b feat(esp32c61): final introduce helloworld support 2024-04-02 10:50:52 +08:00
wuzhenghui 1a676d1e77 fix(esp_pm): update CPU frequency immediately after updating pm_config
Closes https://github.com/espressif/esp-idf/issues/13492
2024-04-01 19:15:28 +08:00
Ivan Grokhotkov 15e63f4222 fix(esp_pm): applied spelling fixes by codespell 2024-03-28 13:00:55 +01:00
wuzhenghui bbc8fd5c9c feat(esp_hw_support): support esp32p4 sleep cpu retention 2024-03-15 18:13:25 +08:00
fl0wl0w 90d1dcfd76 feat(freertos): Introduced new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES
This commit replaces the use of portNUM_PROCESSORS and configNUM_CORES
macros in all of ESP-IDF. These macros are needed to realize an SMP
scenario by fetching the number of active cores FreeRTOS is running on.
Instead, a new Kconfig option, CONFIG_FREERTOS_NUMBER_OF_CORES, has been
added as a proxy for the FreeRTOS config option, configNUMBER_OF_CORES.
This new commit is now used to realize an SMP scenario in various places
in ESP-IDF.

[Sudeep Mohanty: Added new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES]

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2024-02-09 09:11:28 +01:00
Song Ruo Jing 95133c179f feat(clk): preliminary clock tree support for ESP32C5 2024-02-07 14:38:15 +08:00
wuzhenghui 0dc7cad586 fix(esp_pm): safely check ccompare validity in DFS update_ccompare 2024-01-18 10:34:47 +08:00
laokaiyao 11e19f40b9 feat(esp32c5): support to build hello world on esp32c5 beta3 2024-01-09 13:11:11 +08:00
Lou Tianhao e28606aed2 feat(pm): add test_io_wakeup 2024-01-08 11:12:25 +08:00
Darian Leung 8c2949a97e change(xtensa): Deprecate ".../xtensa_timer.h" include path
This commit deprecates the "freertos/xtensa_timer.h" and "xtensa/xtensa_timer.h"
include paths. Users should use "xtensa_timer.h" instead.

- Replace legacy include paths
- Removed some unnecessary includes of "xtensa_timer.h"
- Add warning to compatibility header
2023-11-30 21:58:52 +08:00
Wu Zheng Hui bb95f9bcc6 Merge branch 'bugfix/fix_psram_access_faild_after_pd_cpu_wakeup' into 'master'
fix(esp_pm): fix psram access failed after pd_cpu wakeup if uart driver driven console is used

Closes WIFIBUG-238

See merge request espressif/esp-idf!27020
2023-11-14 11:50:50 +08:00
wuzhenghui 59ad88d9f7 fix(esp_pm): fix psram access faild after pd_cpu wakeup 2023-11-13 16:32:30 +08:00
Marius Vikhammer d293ad94bd feat(pm): removed dependency on driver component 2023-11-13 15:49:12 +08:00
Lou Tianhao 13a405a32b change(pm): Change sleep callback implement 2023-10-23 08:13:47 +00:00
Gao Xu d52040a86d Merge branch 'esp32p4/add_uart_support' into 'master'
UART: Add uart support for ESP32P4

Closes IDF-6511 and IDF-7506

See merge request espressif/esp-idf!25388
2023-10-09 18:11:10 +08:00
gaoxu bc2a6bd730 feat(uart): spilt LP and HP uart set_baudrate function 2023-10-08 10:10:02 +08:00
gaoxu 4f24f805cc feat(uart): add LP-UART GPIO support 2023-10-08 10:10:02 +08:00