Commit Graph

93 Commits

Author SHA1 Message Date
harshal.patil
398d9ea9cd fix(esp_security): Add more validation checks 2026-03-20 11:15:23 +05:30
harshal.patil
0db717b9ec feat(esp_ds): Support using the AES key used by DS peripheral for encrypting params 2026-03-20 11:15:23 +05:30
Laukik Hase
250d757bb9 feat(esp_tee): Miscellaneous fixes and improvements
- Fix intermittent TEE stack underflow test failures
- Fix out-of-bounds access Coverity report from the attestation
  component
- Add appropriate checks and asserts for TEE flash memory regions'
  sizes
2026-03-16 10:46:11 +05:30
harshal.patil
8036017951 feat(mbedtls/esp_mac): Support Key Manager key using the ESP-HMAC PSA interface 2026-03-03 18:40:31 +05:30
harshal.patil
163e0974b3 change(mbedtls/psa_driver_esp_hmac): Use efuse key block instead of efuse block
- Maintains compatibility of the older esp_hmac_ APIs and the PSA driver
2026-03-03 18:36:18 +05:30
Laukik Hase
3593995a43 refactor(esp_tee): Remove leftover references to the secure storage AES-GCM IV 2026-02-14 16:19:57 +05:30
Laukik Hase
85e66d726d fix(esp_tee): Prevent IV reuse in the TEE secure storage AES-GCM service 2026-02-05 14:53:21 +05:30
harshal.patil
0c8fbdcc83 feat(esp_tee/tee_sec_storage): Use PSA interface internally 2026-01-31 13:30:58 +05:30
Mahavir Jain
14f0185000 Merge branch 'fix/tee_apm_hal_linker_placement' into 'master'
fix(esp_tee): Fix incorrect path of APM HAL in the TEE linker scripts

See merge request espressif/esp-idf!45459
2026-01-29 09:48:59 +05:30
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
Laukik Hase
b6c54be94f fix(esp_tee): Fix incorrect path of APM HAL in the TEE linker scripts 2026-01-28 10:12:48 +05:30
Mahavir Jain
e79f840bb7 Merge branch 'fix/tee_sb_attest_crash' into 'master'
fix(esp_tee): Fix TEE attestation stack protection fault with secure boot enabled

See merge request espressif/esp-idf!45272
2026-01-23 11:38:52 +05:30
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
Aditya Patwardhan
eb4a871eca refactor(esp_hal_security): Updated esp_hal_security build and includes 2026-01-21 10:02:44 +05:30
Laukik Hase
31b113b649 fix(esp_tee): Fix TEE attestation stack protection fault with secure boot enabled
- Increased the TEE stack when secure boot is enabled
- Also, generate a build error when the generated TEE binary image size is
  greater than the TEE partition size
2026-01-20 16:40:03 +05:30
harshal.patil
acb71bc858 feat(esp_tee): Support deterministic ECDSA signatures for ESP-TEE based keys 2026-01-19 09:14:37 +05:30
Mahavir Jain
2948a46371 Merge branch 'refactor/tee_sec_stg_remove_r192' into 'master'
refactor(esp_tee): Remove support for ECDSA `secp192r1` keys in TEE secure storage

See merge request espressif/esp-idf!45118
2026-01-18 18:24:04 +05:30
Laukik Hase
85681d7586 refactor(esp_tee): Remove support for ECDSA secp192r1 keys in TEE secure storage 2026-01-16 17:53:16 +05:30
Laukik Hase
89f555d698 feat(esp_tee): Migrate TEE attestation to the PSA interface 2026-01-16 12:28:57 +05:30
Laukik Hase
0964024484 refactor(esp_tee): Adopt Picolibc as the default LibC for ESP-TEE build
- Also fixed an issue where NewLib ROM APIs, when called from TEE, were
  using the syscall table located in the REE SRAM. This could be abused
  as an attack vector to invoke illegal functions from the TEE.
  To prevent this, the syscall table is now switched to the TEE-specific
  copy during every M-U mode transition.
2025-12-30 16:03:41 +05:30
Ashish Sharma
a9927b82b7 fix: fixes coverity reported warnings 2025-12-30 09:31:49 +05:30
Ashish Sharma
e7e31d5d39 feat: migrates esp_tee to PSA APIs 2025-12-30 09:31:49 +05:30
Laukik Hase
90d6394911 feat(esp_tee): Support ECDSA secp384r1 keys in TEE secure storage 2025-12-04 11:16:29 +05:30
Alexey Lapshin
676ae296ff fix(esp_tee): build esp_tee only with CONFIG_LIBC_NEWLIB to reduce size 2025-12-03 13:31:42 +07:00
Laukik Hase
7c24682643 feat(esp_tee): Add support for the RISC-V H/W stack guard mechanism 2025-11-24 18:49:06 +05:30
Laukik Hase
f533502324 feat(esp_tee): Add support for TEE secure storage encryption for ESP32-C61 2025-11-07 14:54:16 +05:30
Laukik Hase
bbdd1499f1 feat(esp_tee): Support for ESP32-C61 - the esp_tee component 2025-11-07 14:54:11 +05:30
Laukik Hase
e27e0eb6a7 ci(esp_tee): Remove incorrect error checks for TEE flash protection tests
- Also fixed coverity issue from TEE secure storage
2025-11-06 12:22:36 +05:30
Laukik Hase
eb74a5f9dd feat(esp_tee): Enable MSPI tuning for Flash and PSRAM 2025-10-22 11:44:34 +05:30
Laukik Hase
71aff04c0d fix(esp_tee): Use HAL APIs instead of ROM APIs for SPI flash service calls
Currently, REE SPI flash HAL operations are routed as service calls to TEE,
but the TEE implementation incorrectly uses ROM APIs instead of HAL APIs.
This leads to issues and is not the recommended approach.
2025-10-22 11:44:33 +05:30
Mahavir Jain
e351376dcf Merge branch 'fix/esp_tee_int_wdt' into 'master'
fix(esp_tee): Sync M-U interrupt thresholds during service calls from critical sections

See merge request espressif/esp-idf!42365
2025-10-17 17:40:53 +05:30
Marius Vikhammer
19e0997436 Merge branch 'feature/esp_stdio' into 'master'
feat(stdio): added new esp_stdio component

Closes IDF-13799

See merge request espressif/esp-idf!41625
2025-10-17 16:11:16 +08:00
Marius Vikhammer
a257812e14 feat(stdio): added esp_stdio component
esp_stdio contains everything the old esp_vfs_console contained (the vfs stdio glue layer)
as well as other functionality related to stdio (previously referred to as console)
2025-10-16 10:01:59 +08:00
Laukik Hase
9de1d631b4 feat(esp_tee): Reclaim unused TEE IRAM memory as heap
- Changed the default TEE code placement to use the flash
  text section instead of IRAM text, making it consistent
  with the default data placement.
2025-10-15 18:22:44 +05:30
Laukik Hase
20344640e3 fix(esp_tee): Split TEE SRAM as I/DRAM for ESP32-C5 with PMA 2025-10-15 18:22:43 +05:30
Laukik Hase
8770ae9db4 fix(esp_tee): Sync TEE-REE intr thresholds during service calls from critical sections
- Previously, only the U-mode interrupt threshold was raised in REE critical sections,
  leaving M-mode at the lowest level.
- As a result, when a service call transitioned to M-mode, all interrupts were still
  allowed to fire, including those that should have been masked.
2025-10-15 12:33:31 +05:30
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
Laukik Hase
6e51fac96e Merge branch 'fix/esp_tee_flash_op_bound_checks' into 'master'
fix(esp_tee): Correct flash operation bound checks to handle all overlap cases

Closes IDF-14129

See merge request espressif/esp-idf!41946
2025-10-13 13:31:03 +05:30
Peter Dragun
e3198fff3c feat: Update esptool to v5 2025-09-30 15:28:55 +02:00
Laukik Hase
466c1d66b6 refactor(esp_tee): Remove the spi_flash_erase_chip service call
- Also fix coverity bug from TEE HMAC-PBKDF2 routine
2025-09-30 12:22:26 +05:30
Laukik Hase
8b92f3603f fix(esp_tee): Correct flash operation bound checks to handle all overlap cases
- Ensure bound checks correctly handle all scenarios, including
  when a requested operation's (SPI0/1) range fully contains the
  TEE-protected region.
- Disable delegation of INTWDT timeout and Cache error interrupts as they reset
  the device after the panic handler
2025-09-30 12:22:25 +05:30
Laukik Hase
c152663408 feat(esp_tee): Added support for PBKDF2-based (HMAC) ECDSA signing 2025-09-19 12:06:02 +05:30
Laukik Hase
d8edbc8acf feat(esp_tee): ASM routine fixes and improvements
- Fix incorrect setting in the edge interrupt acknowledgement API
- Avoid executing the service call dispatcher in the U-mode ecall,
  rather execute `mret` to jump it
- Avoid `t1` register corruption when processing `ecall`
- Switch back to the bootloader stack from TEE stack after the
  execution of the entire TEE initialization routine
2025-09-16 14:57:10 +05:30
Laukik Hase
8b812d4192 feat(esp_tee): Miscellaneous fixes and updates
- Rename `tee_test_fw` app configs for better CI tracking
- Decrease the lower bound of TEE I/DRAM config options
- Trim the TEE test-apps build
- Improve the TEE/REE OTA pytest script with additional checks
- Fix build issues when `tee_sec_storage`/`tee_ota_ops` are a
  a part of the project build but ESP-TEE is disabled
2025-09-16 14:54:06 +05:30
Alexey Lapshin
9281e78381 change(esp_libc): rename newlib component to esp_libc 2025-09-09 22:00:44 +08:00
Marek Fiala
9d35d63651 feat(cmake): Update minimum cmake version to 3.22 (whole repository) 2025-08-19 14:44:32 +02:00
Laukik Hase
11d3a2480f feat(esp_tee): Support for ESP32-C5 - the esp_tee component 2025-08-13 14:08:58 +05:30
Sudeep Mohanty
7c75795a0b refactor(esptool_py): Move binary generation to project level and add utility functions
This commit refactors the esptool_py component to provide utility
functions for binary file generation targets instead of creating the
targets. Binary generation targets are now moved to the respective
projects.

The following changes were done in this commit:
- Added __idf_build_binary() function to esptool_py to create the binary
  file generation target.
- Added __idf_build_secure_binary() as the secure boot equivalent of the
  above function.
- Top level project build now creates its own binary targets in
  idf_build_executable() in build.cmake.
- Bootloader and esp_tee subprojects create their binary file generation
  targets in their respective CMakeLists.txt files.
- All post-build targets such as the app_size_check target are now
  created by the respective projects and not esptool_py.
- General clean-up of the esptool_py cmake files.
2025-07-10 11:26:28 +02:00
morris
c4d7b1cfce refactor(uart)!: deprcated esp_rom_uart.h 2025-07-08 18:56:17 +08:00
Laukik Hase
9b1aaa2778 fix(esp_tee): Fix coverity issues from the attestation component
- Also fix the incorrect marker set for TEE OTA tests
2025-06-23 11:45:12 +05:30