65 Commits

Author SHA1 Message Date
Laukik Hase
11fe9fdad6 feat(hal): Add support for flash/PSRAM protection through MSPI PMS 2026-07-10 13:13:09 +05:30
C.S.M
08b5996134 Merge branch 'fix/flash_32bit_addr' into 'master'
fix(spi_flash): fix flash 32bit address operation on esp32s31

See merge request espressif/esp-idf!50248
2026-07-02 16:50:22 +08:00
C.S.M
cfb2e81cd4 fix(spi_flash): fix flash 32bit address operation on esp32s31 2026-07-01 16:39:25 +08:00
wuzhenghui
ba1df35672 fix(esp_hw_support): fix esp32s31 mpll initialization 2026-06-25 12:20:57 +08:00
Song Ruo Jing
f6449f926b fix(spi_flash): gpspi flash clock could reach higher frequency 2026-06-08 17:56:17 +08:00
Song Ruo Jing
545b31e6b9 feat(spi_flash): Add exclusive support for ESP32H4
Add 32bit addr support for esp32s31 as well
2026-06-08 17:56:09 +08:00
C.S.M
2acd9b9a7c fix(spi_flash): Fix suspend issue on esp32s31, and add trs timing on other target 2026-06-08 11:15:13 +08:00
C.S.M
101e693078 Merge branch 'feat/h21_gpspi_flash' into 'master'
feat(spi_flash): cleanup and add  entire support on esp32h21

Closes IDF-11610

See merge request espressif/esp-idf!48433
2026-06-02 14:09:09 +08:00
C.S.M
e36b9436b9 feat(spi_flash): Add entire support for h21 external flash 2026-06-02 10:41:02 +08:00
morris
87b93ee9ab refactor(flash): move flash error code to the driver layer 2026-06-02 10:38:33 +08:00
Guillaume Souchere
33e774397c Merge branch 'feat/error-code-registration' into 'master'
feat(esp_common): implement composable error code registration via link-time arrays

Closes IDF-15105 and IDF-15486

See merge request espressif/esp-idf!46125
2026-06-01 09:40:37 +02:00
morris
ef4a30d879 Merge branch 'feat/blink_example_esp32s31' into 'master'
feat(example): set default GPIO for esp32-s31 blink example

See merge request espressif/esp-idf!49024
2026-05-29 16:08:22 +08:00
morris
5a1e63f071 feat(example): set default GPIO for esp32-s31 blink example
for both Function-Core Board and Korvo Board
2026-05-29 10:53:17 +08:00
Guillaume Souchere
d670774f5c feat(esp_common): implement composable error code registration via link-time arrays
Refactor the esp_err_to_name() system to decouple esp_common from
higher-level components. Instead of a monolithic generated table,
each component registers its error codes into a dedicated linker
section (.esp_err_msg_table) via idf_define_esp_err_codes() in its
CMakeLists.txt.

New files:
- tools/err_codes_extract.py: extract ESP_ERR_* defines from headers to CSV
- tools/err_codes_to_c.py: generate C source placing entries into linker section
- tools/err_codes_to_rst.py: generate RST documentation from error codes
- tools/cmake/err_codes.cmake: CMake module providing idf_define_esp_err_codes()
- components/esp_common/include/esp_err_codes.h: esp_err_msg_t typedef
- components/esp_common/src/esp_err_to_name_new.c: new lookup using link-time array
- tools/test_apps/build_system/err_codes_check/: CI test app

Changes:
- Remove all optional component dependencies from esp_common/CMakeLists.txt
- Add .esp_err_msg_table section to all 5 linker scripts
- Register error codes in 18 components via idf_define_esp_err_codes()
- Add new scripts to .gitlab/ci/rules.yml build_check patterns
- use new scripts to generate doc and add CI validation
- Update esp_err.rst to add description of composable code registration
2026-05-28 09:53:32 +02:00
nilesh.kale
fe257f699e feat: enable Secure Boot, Flash Encryption and Key Manager support for S31 2026-05-26 12:57:34 +08:00
Wu Zheng Hui
2fcaddb700 Merge branch 'fix/fix_psram_data_corrupt_after_lightsleep' into 'master'
fix(esp_hw_support):fix psram data corrupt after lightsleep

Closes PM-941

See merge request espressif/esp-idf!48322
2026-05-22 15:11:41 +08:00
wuzhenghui
ecfdeef9d7 feat(esp_psram): wakeup PSRAM by CE# force control instead of dummy write 2026-05-22 14:30:46 +08:00
nilesh.kale
36fdf38ad4 fix: cleanup xts_aes_reg.h dependency for H21, C61 and H4 2026-05-20 09:29:20 +05:30
nilesh.kale
cae147af08 feat: enable flash encryption for ESP32-H4 2026-05-20 09:29:20 +05:30
armando
669be4a664 fix(psram): enable psram power xpd 2026-05-14 08:59:54 +00:00
wuzhenghui
3f6957450f feat(esp_hw_support): support psram PD_TOP retention 2026-05-07 12:02:01 +08:00
Chen Jichang
8b50305650 fix(esp32s31): fix stuck when PSRAM XIP with O0 optimization 2026-04-21 14:18:45 +08:00
C.S.M
92646c2851 fix(flash): fix mspi ci build for missing initialier 2026-04-20 14:15:15 +08:00
Xorlent
51d059232b Fix output bit range in bitscrambler documentation
Destination bit range incorrect in `Sub-instructions` example
2026-04-17 17:20:28 +08:00
wanckl
64704886b7 refactor(driver_spi): remove some SPI_LL_xxx SOC_xxx macros 2026-04-10 13:59:20 +08:00
Song Ruo Jing
50051b74a5 feat(clk): support for esp32s31 clock tree 2026-04-02 20:39:59 +08:00
C.S.M
62d5f34b53 feat(ldo): Add ldo support for psram on esp32s31 2026-04-01 16:31:35 +08:00
armando
ebbd9cdb59 feat(psram): support psram device driver 2026-03-31 13:56:43 +08:00
hebinglin
474d89b4c2 fix(clk): update H21 ECO1 to use 64MHz clock for mspi 2026-03-25 15:38:49 +08:00
Erhan Kurubas
8a536eeda0 fix(mspi): enable PSRAM core clock in module clock init
psram_ctrlr_ll_enable_module_clock() was missing
reg_psram_core_clk_en, causing SPIMEM2 access faults
after system reset.
2026-03-19 15:24:27 +01:00
morris
05a49f8be0 fix(mspi): constant overflow issue reported by coverity 2026-03-17 11:09:03 +08:00
Song Ruo Jing
c1695b4533 fix(flash): flash erase operation may fail to raise PMS exception 2026-03-03 17:41:07 +08:00
Song Ruo Jing
69def0c3ea feat(psram): allow PSRAM to enter halfsleep mode during light sleep 2026-02-28 22:33:34 +08:00
Song Ruo Jing
29d62fa6ae feat(mspi): add clear log in psram mspi intr isr for addr misaligned error 2026-02-26 16:38:06 +08:00
C.S.M
879d74e298 fix(spi_flash): Fix esp32p4 120m flash suspend failed 2026-02-04 11:42:35 +08:00
wuzhenghui
aaeec3228d fix(bootloader): fix bootloader bad spi pin drv config and clear all wpu/wpd by default 2026-01-28 19:49:46 +08:00
Michael (XIAO Xufeng)
5984b29af5 Merge branch 'refactor/spi_flash_private' into 'master'
refactor(spi_flash): reorganize header files, improve encapsulation and simplify ROM implementation

See merge request espressif/esp-idf!44347
2026-01-28 17:39:51 +08:00
C.S.M
25ff3e2327 fix(spi_flash): Fix esp32p4 120m flash suspend failed 2026-01-23 14:24:51 +08:00
Xiao Xufeng
8dbf23630a 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-23 03:38:54 +08:00
Xiao Xufeng
758cf6e1a3 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-23 03:38:54 +08:00
Song Ruo Jing
fc4f07abd6 feat(mspi): support 120MHz flash and psram for esp32c61 2026-01-21 14:38:04 +08:00
Song Ruo Jing
62511d61e9 refactor(clk): split clock HAL into separate component 2026-01-13 15:50:20 +08:00
Mahavir Jain
7675ce81df Merge branch 'feat/enable_pseudo_round_support_for_xts_aes_esp32p4_eco5' into 'master'
feat: added support for pseudo round xts aes in esp32p4 eco5

Closes IDF-13525

See merge request espressif/esp-idf!44376
2026-01-07 20:07:45 +05:30
nilesh.kale
f42e35bb68 feat: added support for pseudo round xts aes in esp32p4 eco5 2026-01-07 13:20:55 +08:00
Song Ruo Jing
215c9993bf fix(clk): update H4 to use 64MHz clock for mspi
And add pll clock ref count
2026-01-04 14:07:01 +08:00
Armando (Dou Yiwen)
1db608e658 Merge branch 'feat/mspi_isr' into 'master'
mspi: supported mspi flash and psram isr

Closes IDF-14224

See merge request espressif/esp-idf!43643
2025-12-29 03:29:56 +00:00
C.S.M
4034446cc7 refactor(hal): Cleanup some missing hal files 2025-12-26 10:33:32 +08:00
armando
7fe40f12ba feat(mspi): supported mspi flash and psram isr 2025-12-26 01:04:45 +00:00
Wan Lei
a633083633 Merge branch 'fix/spi_clean_soc_caps' into 'master'
refactor(driver_spi): clean spi soc caps

See merge request espressif/esp-idf!44083
2025-12-15 20:48:21 +08:00
C.S.M
07519fac25 fix(spi_flash): Cleanup jira tickets 2025-12-12 17:53:01 +08:00