Commit Graph
959 Commits
Author SHA1 Message Date
Chen Jichang d1a64bffc0 refactor(clk_tree): use general api to enable the clk 2026-05-15 13:55:37 +08:00
Konstantin Kondrashov 2fcf83e2f3 fix(test_apps): Increase CONFIG_PARTITION_TABLE_OFFSET to 0x9000
Fix some test apps that have a partition table offset of 0x8000,
which left no room for the bootloader for some chips.
2026-05-13 10:18:40 +03:00
C.S.M 9025fffe44 fix(spi_flash): Fix flash hpm build failure,
Closes https://github.com/espressif/esp-idf/issues/18535
2026-05-11 16:13:45 +08:00
morris ed6a7e267e Merge branch 'fix/32mb_120m_v6.0' into 'release/v6.0'
fix(spi_flash): 1. Fix flash 120m in qio mode failed on esp32p4 (with 32M map enabled) 2. Add C61 32M flash support (backport v6.0)

See merge request espressif/esp-idf!46042
2026-03-23 16:14:19 +08:00
morris 01c8f89bf8 Merge branch 'bugfix/flash_user_command_with_pms_v6.0' into 'release/v6.0'
fix(flash): flash erase operation may fail to raise PMS exception (v6.0)

See merge request espressif/esp-idf!46845
2026-03-23 11:52:49 +08:00
Song Ruo Jing 7d0ddf3010 fix(flash): flash erase operation may fail to raise PMS exception 2026-03-20 22:44:09 +08:00
igor.udot e2a8bbe639 ci: update build-test-rules to use common_components 2026-03-20 15:53:26 +08:00
C.S.M 52d5b1a173 fix(spi_flash): Fix esp32p4 120m flash suspend failed 2026-03-20 15:21:22 +08:00
morris 23e199d646 Merge branch 'feature/esp32c61_flash_psram_timing_tuning_v6.0' into 'release/v6.0'
feat(mspi): support 120MHz flash and psram for esp32c61 (v6.0)

See merge request espressif/esp-idf!45886
2026-03-20 13:55:06 +08:00
Jiang Jiang Jian 59a686ffac Merge branch 'fix/fix_sleep_exception_in_spi_flash_rom_impl_v6.0' into 'release/v6.0'
fix(esp_hw_support): fix sleep exception in spi flash rom impl (v6.0)

See merge request espressif/esp-idf!46445
2026-03-20 10:16:57 +08:00
Marius Vikhammer a138e4e516 Merge branch 'change/added_mutex_for_get_apis_v6.0' into 'release/v6.0'
mmu: add mutex for get_max_consecutive_free_block_size and paddr_find_caps (v6.0)

See merge request espressif/esp-idf!46432
2026-03-20 10:04:27 +08:00
Song Ruo Jing c7ae253b89 feat(mspi): support 120MHz flash and psram for esp32c61 2026-03-19 14:30:46 +00:00
wuzhenghui 9ed0d4bc4e fix(esp_rom): sync spi_flash_disable/enable_cache patches to rom implementation 2026-03-10 14:14:01 +08:00
armando 15cbf78a64 fix(mmap): added 24bit addr check 2026-03-10 11:34:48 +08:00
Chen Jichang 04df934c05 refactor(flash_enc): move esp_flash_encryption_enabled() to efuse component 2026-03-06 18:14:22 +08:00
Xiao Xufeng 34035b0e7c fix(spi_flash): add suspend related code back 2026-02-02 03:44:59 +08:00
Xiao Xufeng 6539624176 fix(spi_flash): fixed overboundary check skipping of erase and write_encrypted 2026-01-29 03:28:30 +08:00
Xiao Xufeng d8030432ec refactor(spi_flash): not patching api_funcs on C3 and S3 2026-01-29 03:28:30 +08:00
Xiao Xufeng 3411286544 refactor(spi_flash): reorganize header files and improve API encapsulation
This commit reorganizes SPI flash header files to better reflect their
visibility and intended usage:

1. Rename `esp_flash_port/` to `esp_flash_chips/`:
   - Better reflects that these headers are for chip driver implementations
   - All chip driver headers moved to `esp_flash_chips/` directory
   - Added README.md explaining semi-public nature of these headers

2. Move internal headers to `esp_private/`:
   - `esp_flash_internal.h` -> `esp_private/esp_flash_internal.h`
   - `memspi_host_driver.h` -> `esp_private/memspi_host_driver.h`

3. Move chip driver related headers to `esp_flash_chips/`:
   - `esp_private/esp_flash_types.h` -> `esp_flash_chips/esp_flash_types.h`
   - `spi_flash/spi_flash_defs.h` -> `esp_flash_chips/spi_flash_defs.h`
   - `spi_flash_override.h` -> `esp_flash_chips/spi_flash_override.h`
   - All `spi_flash_chip_*.h` headers moved to `esp_flash_chips/`

4. Code improvements:
   - Remove unused includes (e.g., `spi_flash_override.h` from `cache_utils.c`)
   - Use public API `esp_flash_get_size()` instead of direct member access
   - Add `esp_flash_is_quad_mode` to linker.lf for IRAM placement

5. Documentation updates:
   - Add README.md in `esp_flash_chips/` explaining semi-public headers
   - Update programming guide with warnings about internal headers
   - Update both English and Chinese documentation

6. Update all references across the codebase:
   - Update includes in `spi_flash` component
   - Update `bootloader_support`, `app_update`, `esp_tee`, `espcoredump`
   - Update example projects

Breaking changes:
- Headers moved to new locations require include path updates
- `custom_flash_driver` example temporarily disabled until external
  components are updated
2026-01-29 03:28:30 +08:00
Xiao Xufeng 170061e971 refactor(spi_flash): move internal types to private headers and refactor initialization
This commit refactors the SPI flash component to improve encapsulation and
modularity by moving internal types and functions to private headers, and
reorganizing initialization code.

Key changes:

1. Move PSRAM frequency constraint macro from soc_caps.h to mspi_ll.h
   - Rename SOC_SPI_MEM_PSRAM_FREQ_AXI_CONSTRAINED to
     MSPI_TIMING_LL_PSRAM_FREQ_AXI_CONSTRAINED
   - Move macro definition to chip-specific mspi_ll.h files (C5, C61, H4, P4, S31)
   - Update usage in clk_utils.c and esp_flash_spi_init.c
   - Remove old macro from all soc_caps.h files

2. Move internal types to private headers
   - Move esp_flash_t structure to esp_private/esp_flash_types.h
   - Move esp_flash_os_functions_t to esp_private/spi_flash_os.h
   - Update all internal files to include private headers
   - Keep forward declarations in public esp_flash.h

3. Move chip driver header to internal directory
   - Move spi_flash_chip_driver.h to esp_flash_port/spi_flash_chip_driver.h
   - Update all references to use new path
   - Add esp_private/esp_flash_types.h include to the moved header

4. Refactor initialization functions
   - Move init_flash from esp_system/startup_funcs.c to
     spi_flash/esp_flash_spi_init.c
   - Create new init_pm_flash_freq_limit function in startup_funcs.c
     to call esp_pm_flash_freq_limit_init() conditionally
   - Update system_init_fn.txt with new function locations

5. Improve API encapsulation
   - Replace direct access to esp_flash_t->size in
     esp_partition_register_external() with esp_flash_get_size() API
   - Move esp_flash_is_quad_mode from inline function to regular function
     in esp_flash_api.c

6. Update component dependencies
   - Add esp_driver_gpio to spi_flash component PRIV_REQUIRES
   - Remove unused includes and clean up header dependencies

These changes improve code organization by clearly separating public APIs
from internal implementation details, making the codebase more maintainable
and reducing the risk of breaking changes to internal structures.
2026-01-29 03:28:30 +08:00
morris 40fe34e4ab refactor(tests): add missing sdkconfig files in the driver test 2026-01-07 10:16:23 +08:00
morris 16781cd4b4 Merge branch 'refactor/gdma_link_skip_null_buffer_v6.0' into 'release/v6.0'
skip the NULL buffer in DMA mount pre-check (v6.0)

See merge request espressif/esp-idf!44458
2025-12-29 10:27:36 +08:00
armando 245cd9cda8 fix(cache): fixed cache sync ops concurrent call issue
Closes https://github.com/espressif/esp-idf/issues/18023
2025-12-25 09:55:27 +08:00
morris e5d0955864 refactor(gdma): skip the null buffer in mount pre-check 2025-12-23 10:15:37 +08:00
Jiang Jiang Jian f409428bf3 Merge branch 'bugfix/esp32c5_encrypted_flash_write_v6.0' into 'release/v6.0'
fix(spi_flash): Add CPU frequency switching during flash encrypted write (v6.0)

See merge request espressif/esp-idf!44304
2025-12-21 15:28:33 +08:00
Xiao Xufeng ae7124abe3 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-17 01:21:45 +08:00
Mahavir Jain 86f159ec06 fix(spi_flash): limit CPU clock to 160MHz for encrypted flash writes 2025-12-17 01:21:45 +08:00
wanckl d12f941787 feat(driver_spi): split spi hal component 2025-12-16 20:38:09 +08:00
Martin Vychodil 7c4eac9e22 Merge branch 'feat/spi_flash_bdl_support_v6.0' into 'release/v6.0'
feat(bdl): Add support for spi_flash (v6.0)

See merge request espressif/esp-idf!43812
2025-12-11 21:28:52 +08:00
Adam Múdry 064630c582 feat(bdl): Add support for spi_flash 2025-12-10 22:39:03 +08:00
C.S.M ed64e7bf78 ci(header_check): Add check for public header should not include freertos 2025-12-10 15:10:43 +08:00
Song Ruo Jing 62899cbba6 refactor(gpio): split GPIO HAL into separate component
cleaned up some includes in GPIO peripheral files
2025-12-08 14:33:26 +08:00
morris f050c1deb1 Merge branch 'fix/no_function_call_in_min_max_v6.0' into 'release/v6.0'
refactor: avoid function calls inside MIN/MAX macros (v6.0)

See merge request espressif/esp-idf!43476
2025-11-21 12:03:09 +08:00
C.S.M e0a6261993 fix(spi_flash): Fix software resume wrong config name in flash init 2025-11-18 17:50:24 +08:00
morris e9539d4560 refactor: avoid function calls inside MIN/MAX macros 2025-11-18 15:18:14 +08:00
armando 1f7b1f3615 feat(mspi): supported psram & flash 120MHz timing tuning 2025-11-06 02:20:48 +00:00
C.S.M c81cf3bdf6 refactor(spi_flash): Remove spi_flash rom driver patch config option 2025-10-22 10:37:19 +08:00
morris e8de5b5a95 refactor(gptimer): clean up SOC capabilities for GPTIMER and Timer Group
- Remove GPTIMER and TIMG related definitions from soc_caps_full.h files
- Move timer peripheral definitions to appropriate HAL layer files
- Update references across components to use proper HAL abstractions
- Consolidate timer group and GPTIMER capabilities organization
- Ensure consistent timer configuration across all ESP32 variants

This refactoring improves the separation of concerns between SOC
capabilities and HAL implementations for timer-related functionality.
2025-10-14 11:44:38 +08:00
morris cd41b6a640 refactor: remove unnecessary driver dependencies from build rules 2025-10-11 14:02:29 +08:00
Peter Dragun 800f141f94 Merge branch 'feat/esptool_v5' into 'master'
Update esptool to v5: replace deprecated commands, documentation updates and cleanup

Closes IDF-12564

See merge request espressif/esp-idf!41176
2025-10-01 14:36:26 +08:00
Peter Dragun e3198fff3c feat: Update esptool to v5 2025-09-30 15:28:55 +02:00
Chen Chen a4710cc206 refactor(driver): remove redundant driver dependencies
now the driver component only contains legacy code for i2c, twai and
touch sensor
2025-09-30 15:47:45 +08:00
C.S.M a417158514 Merge branch 'feat/mspi_suspend_p4_eco5' into 'master'
feat(spi_flash): Support flash suspend on esp32p4 resivion 3

Closes IDF-13511

See merge request espressif/esp-idf!42104
2025-09-30 15:14:09 +08:00
C.S.M f022b67486 feat(spi_flash): Support flash suspend on esp32p4 resivion 3 2025-09-28 16:25:28 +08:00
C.S.M b145ede835 refactor(mspi): Make mspi hal layer independent 2025-09-26 14:57:54 +08:00
Konstantin Kondrashov b7da740f12 Merge branch 'feature/log_v2_optimization' into 'master'
feat(log): Optimize idf components for binary logging

Closes IDF-12775

See merge request espressif/esp-idf!40289
2025-09-19 14:45:43 +08:00
Konstantin Kondrashov 16d73cdab3 feat(log): Adds ESP_LOG_ATTR macro to control section placement 2025-09-15 15:59:52 +03:00
Konstantin Kondrashov dcf486359e feat(log): Optimize log tag init for bin logging 2025-09-15 15:59:52 +03:00
armando 00022a379a change: remove deprecated items 2025-09-15 10:52:28 +08:00
gaoxu 41f954facf feat(h21_mp): update H21_MP soc headers 2025-08-21 14:19:41 +08:00