Commit Graph

74 Commits

Author SHA1 Message Date
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
Aditya Patwardhan 8d0527d7bf Merge branch 'feat/support_sha512_for_esp32c5' into 'master'
Support SHA 512 for ESP32-C5

See merge request espressif/esp-idf!39421
2025-06-09 09:42:37 +05:30
Laukik Hase 0d8a1f5427 refactor(hal): Refactor the APM LL/HAL APIs 2025-06-06 18:28:47 +05:30
harshal.patil fe78370ec9 feat(mbedtls/sha): New API for setting SHA mode 2025-06-06 14:51:44 +05:30
Laukik Hase a1c6d2a458 fix(esp_tee): Fix failing SPI1 flash protection test-cases 2025-05-22 17:35:09 +08:00
Laukik Hase 958f4b8900 feat(esp_tee): Support for ESP32-H2 - the esp_tee component 2025-05-20 16:31:22 +05:30
Laukik Hase 033397b877 fix(esp_tee): Add standard newlib function stubs to resolve build warnings
- Disable C++ exceptions for TEE build to reduce flash footprint
2025-05-04 18:03:30 +05:30
Laukik Hase 41bf07e6ce refactor(esp_tee): Remove the deprecated TEE secure storage partition subtype 2025-05-04 18:03:30 +05:30
Laukik Hase d116567a66 refactor(esp_tee): Update TEE secure storage interface APIs 2025-05-04 18:03:29 +05:30
Laukik Hase c9f7bcd452 feat(esp_tee): Support the nvs_flash for the ESP-TEE build 2025-05-04 18:03:28 +05:30
Laukik Hase a0031cff9f refactor(esp_tee): Remove the redudant eFuse-related service calls 2025-04-17 11:04:29 +05:30
Laukik Hase 832124f198 fix(esp_tee): Place APM HAL in TEE IRAM when SPI1 protection is enabled
- Place the APM HAL into TEE IRAM when `CONFIG_SECURE_TEE_EXT_FLASH_MEMPROT_SPI1`
  is enabled, as APM violations related to SPI1 can occur with the flash cache disabled.
- Also fix an issue where flash protection tests were passing due to incorrect checks
2025-04-17 11:03:50 +05:30
Laukik Hase a845be0149 refactor(esp_tee): Reduce the default TEE DRAM size
- Decreased from 32KB to 24KB, keeping in mind the current maximum TEE heap
  usage and some overhead
- Make the TEE panic handler logs concise, saving some DRAM
2025-04-17 11:03:17 +05:30
Laukik Hase 8e27be344b refactor(esp_tee): Place the secure services _ss_ layer in the flash by default 2025-04-17 11:03:16 +05:30
Laukik Hase 4a4d63d36e feat(esp_tee): Protect the ECC peripheral from REE access 2025-04-16 19:19:04 +05:30
Laukik Hase fc4802c0d6 feat(esp_tee): Protect the HMAC and DS peripherals from REE access 2025-04-16 19:19:04 +05:30
Laukik Hase d7d78f6238 fix(esp_tee): Correct the input validation checks for secure services 2025-04-16 19:19:04 +05:30
Laukik Hase 13aff0b216 fix(security): Fixed coverity warnings related to the esp_tee component
- Also, disable the SECP192R1 curve (Mbed TLS config) when TEE Secure Storage
  does not require it
2025-04-14 10:12:51 +05:30
Laukik Hase 223c0d5f9d feat(esp_tee): Use the ROM TLSF implementation for the TEE build 2025-04-08 19:50:27 +05:30
Laukik Hase d442886918 refactor(esp_tee): Refactor the TEE heap-related APIs 2025-04-08 19:50:26 +05:30