Commit Graph

1840 Commits

Author SHA1 Message Date
Armando (Dou Yiwen)
29a0803fa5 fix: fixed image header segment count check
Signed-off-by: Armando (Dou Yiwen) <douyiwen@espressif.com>
2026-07-13 11:29:35 +08:00
morris
368900cedd refactor(mwdt): move sleep retention config into system layer
Move MWDT retention descriptors out of esp_hal_wdt and into esp_system
so the backup policy lives with the watchdog users, while keeping the
per-chip retention sources under the existing port/soc target
directories.
2026-07-09 10:37:59 +08:00
Song Ruo Jing
4a94a5a396 fix(stdio): add console input ability when selects ESP_CONSOLE_UART_CUSTOM_NUM_1 2026-07-08 12:08:46 +08:00
morris
651d6a283f refactor(esp_common): centralize ALIGN_UP/ALIGN_DOWN into esp_macros.h
Remove ~50 duplicate local definitions of ALIGN_UP/ALIGN_DOWN/ALIGN_UP_BY/
ALIGN_DOWN_BY across the codebase and replace them with canonical
ESP_ALIGN_UP/ESP_ALIGN_DOWN from esp_macros.h.
2026-07-06 13:36:06 +08:00
Meet Patel
d51e467e7c Merge branch 'feature/add_kasan_support' into 'master'
feat(kasan): add Kernel Address Sanitizer (KASAN) support for ESP-IDF

Closes IDF-13467

See merge request espressif/esp-idf!48106
2026-06-25 11:30:48 +05:30
Meet Patel
383e9adb82 feat(kasan): add Kernel Address Sanitizer (KASAN) support for ESP-IDF
Add KASAN support for detecting heap memory safety bugs (buffer
overflows, underflows, use-after-free) at runtime using compiler
instrumentation and shadow memory. Gated behind
CONFIG_IDF_EXPERIMENTAL_FEATURES, with touch points kept to esp_system
and heap so other components stay untouched.

- Core runtime (esp_system/kasan.c, esp_kasan.h): nibble-based shadow
  memory in DRAM, poison/unpoison, per-access validation, and __asan_*
  stubs; hot-path stubs in IRAM so they stay valid with the flash cache
  off. Shadow init runs before heap bring-up.
- Heap integration (heap/heap_kasan*.c): alloc/free hooks add redzones,
  a quarantine FIFO, and shadow updates.
- Panic handling: disable checks once at the panic handler entry so
  backtrace and stack dumps can read redzones without nested reports.
- Build system: -fsanitize=kernel-address for app code, with HAL, SoC,
  esp_rom, SPI flash, esp_hw_support, bootloader_support, FreeRTOS, and
  heap internals excluded from instrumentation.
- Test app (tools/test_apps/system/kasan_test): Unity tests for
  overflow, underflow, use-after-free, and all sized __asan_* stubs,
  with halt and no-halt configurations.
- Docs: document KASAN in the heap memory debugging guide (EN and CN).
2026-06-24 11:27:00 +05:30
Laukik Hase
c7a73cb8d3 fix(esp_tee): Avoid crypto peripherals reset with esp_restart() from REE
- Reset the crypto peripherals during TEE initialization
2026-06-22 11:18:32 +05:30
Mahavir Jain
2d95d621b7 Merge branch 'fix/fault-assert-volatile-survive' into 'master'
Make ESP_FAULT_ASSERT survive optimization

Closes IDF-15794

See merge request espressif/esp-idf!49644
2026-06-18 16:27:53 +05:30
Alexey Lapshin
e389f3e4df Merge branch 'feature/upgrade_toolchain_to_16.1.0_20260609' into 'master'
Upgrade GNU toolchain to 16.1.0_20260609

See merge request espressif/esp-idf!49523
2026-06-18 00:55:07 +04:00
harshal.patil
6b417e9d47 fix(esp_common/esp_fault): make ESP_FAULT_ASSERT survive optimization
ESP_FAULT_ASSERT(C) was silently deleted by the optimizer when C is a cached
flag/status already proven by a preceding `if (!C) return/goto`: the compiler
folds C to a constant and drops all three checks, removing the fault-injection
protection with no warning.
2026-06-17 16:45:29 +05:30
Alexey Lapshin
406bd2393e fix(ci): suppress GNU static analyzer warnings 2026-06-15 18:53:21 +07:00
Marius Vikhammer
e78da74582 Merge branch 'feature/esp_sys_event_restart_panic' into 'master'
refactor(esp_system): route panic through esp_sys_event

See merge request espressif/esp-idf!48407
2026-06-12 11:53:47 +08:00
Wu Zheng Hui
a82f41e369 Merge branch 'feat/optimize_esp32s31_active_power' into 'master'
feat: optimize esp32s31 active power

Closes IDF-15502

See merge request espressif/esp-idf!48833
2026-06-12 11:16:47 +08:00
C.S.M
471be9b684 Merge branch 'contrib/github_pr_18705' into 'master'
esp_psram: Set missing PSRAM errors to warnings if "ignore not found" is configured. (GitHub PR)

Closes IDFGH-17789

See merge request espressif/esp-idf!49503
2026-06-11 10:23:29 +08:00
wuzhenghui
322e4c265a feat(soc): disable esp32s31 WFE feature at startup 2026-06-10 21:20:04 +08:00
wuzhenghui
9d824a9c33 feat(esp_system): support esp32s31 esp_perip_clk_init 2026-06-10 21:20:03 +08:00
Angus Gratton
443f1bb791 esp_psram: Downgrade "not found" to a warning if "ignore not found" set.
This avoids ~5 errors being logged during boot if the board
has no PSRAM but is configured to boot anyway.

Closes https://github.com/espressif/esp-idf/pull/18705

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2026-06-10 15:15:47 +08:00
Marius Vikhammer
f7344e0a46 refactor(panic): route panic handlers through esp_sys_event
Let panic-related components register their hooks through
esp_sys_event so panic sequencing stays extensible without
hardcoded esp_system dependencies.
2026-06-10 11:21:47 +08:00
Marius Vikhammer
ecb4123afd Merge branch 'bugfix/int_wdt_default_psram' into 'master'
fix(iwdt): increased default timeout if using PSRAM

Closes IDFGH-17392

See merge request espressif/esp-idf!49425
2026-06-10 10:20:20 +08:00
Harshal Patil
a5591852c5 Merge branch 'fix/remove_nonexistent_crypto_registers_c61' into 'master'
Remove non-existent crypto registers (ESP32-C61)

See merge request espressif/esp-idf!49241
2026-06-09 18:16:01 +05:30
Marius Vikhammer
e3570108ac fix(iwdt): increased default timeout if using PSRAM
Default timeout for interrupt WDT was increased by default
on ESP32, due to some heap integrity check APIs taking a long
time on large PSRAMs and causing timeouts.

But this adjustment was only done for ESP32, not later chips,
even though they may experience the same issue.

Adjusted to have the same behavior on all chips with PSRAM
enabled, making it consistant with the docs.

Closes https://github.com/espressif/esp-idf/issues/18360
2026-06-09 17:18:58 +08:00
Mahavir Jain
05c70c1fd4 Merge branch 'fix/ecdsa_ecc_hw_input_validation' into 'master'
Validate ECDSA signature range and harden ECC memory power-down

See merge request espressif/esp-idf!48958
2026-06-09 14:40:24 +05:30
harshal.patil
81ffe04323 fix(soc): Remove non-existent crypto registers (ESP32-C61) 2026-06-09 13:33:25 +05:30
Marius Vikhammer
c67b1d0e43 Merge branch 'bugfix/esp_sys_remove_vsf_dep' into 'master'
fix(esp_system): remove unnecessary VFS dependency

See merge request espressif/esp-idf!49412
2026-06-09 15:38:02 +08:00
harshal.patil
554cce6937 fix(mbedtls): validate ECDSA signature range and harden ECC memory power-down 2026-06-09 10:59:11 +05:30
Marius Vikhammer
34fe9dff31 fix(system): removed uncessary vfs component dependency from esp_system 2026-06-09 11:58:33 +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
Marius Vikhammer
4135057bee Merge branch 'feature/esp_sys_event_framework' into 'master'
feat(esp_system): add esp_sys_event framework

Closes IDF-13472

See merge request espressif/esp-idf!48406
2026-06-08 10:58:28 +08:00
Guillaume Souchere
a010738ec2 Merge branch 'feat/new-freertos-linux-simulator' into 'master'
feat(freertos): Refactor linux simulator

Closes IDF-8339

See merge request espressif/esp-idf!43564
2026-06-05 12:18:44 +02:00
Guillaume Souchere
9835daba70 feat(freertos/vfs): add Linux cooperative syscall dispatch with VFS FD registration
Rework the syscall interposition architecture so FreeRTOS works
standalone (without VFS) and VFS optionally overrides with strong
symbols.  All kernel FDs are registered with VFS via
esp_vfs_register_fd_with_local_fd, so the application only sees
VFS-allocated FD numbers, preventing numerical collisions between
kernel FDs and VFS-internal FD slots.

FreeRTOS side:
- Create linux_port_coop_internal.h with LINUX_COOP_IO_LOOP,
  LINUX_COOP_RESOLVE, linux_coop_yield and FD state table functions
- Export cooperative I/O primitives (freertos_linux_coop_read/write/
  open/close/fcntl/select/pread/pwrite/readv/writev/recv/send/
  recvfrom/sendto/recvmsg/sendmsg/connect/accept/pselect/poll/
  socket/socketpair/pipe/pipe2/dup/dup2/syscalls_init)
- Define weak POSIX symbols calling through to the cooperative
  primitives; keep nanosleep/sleep/usleep as strong (not FD-related)
- Refactor freertos_linux_coop_syscalls.h into a pure public API header

VFS side:
- Register the Linux host FS with esp_vfs_register_fs_with_id() as a
  proper VFS driver; register stdin/stdout/stderr at init (priority 99)
- Rewrite vfs_linux.c with strong POSIX symbols dispatching through
  esp_vfs_*
- Add strong overrides for FD-creating syscalls (open, pipe, pipe2,
  socket, socketpair, dup, dup2, accept) that register returned FDs
  with VFS
- Add strong overrides for FD-translating syscalls (readv, writev,
  recv, send, recvfrom, sendto, recvmsg, sendmsg, connect, pselect,
  poll) that translate VFS FD to kernel FD
- Delete vfs_coop_syscalls.c (absorbed into FreeRTOS weak + VFS strong)
- Update CMakeLists.txt: remove vfs_coop_syscalls.c, add linker hook
2026-06-04 11:36:34 +02:00
Konstantin Kondrashov
ce76bb9a4d Merge branch 'feature/adds_ipc_isr_safe_api' into 'master'
feat(ipc_isr): Adds IPC ISR safe API to stall other CPU

See merge request espressif/esp-idf!41005
2026-06-03 13:06:22 +03:00
Marius Vikhammer
be36c20503 feat(esp_system): add esp_sys_event framework
Introduce a shared esp system event framework and use it
for system init and shutdown.
2026-06-03 15:02:43 +08:00
Meet Patel
bd4ab32f73 Merge branch 'feat/backtrace-print-all-tasks-riscv' into 'master'
feat(esp_system): add esp_backtrace_print_all_tasks support for RISC-V

See merge request espressif/esp-idf!49012
2026-06-03 11:57:42 +05:30
Konstantin Kondrashov
672736304c feat(ipc_isr): adds IPC ISR safe API for other CPU stall API 2026-06-02 13:57:47 +03:00
Meet Patel
dd57685c42 feat(esp_system): add esp_backtrace_print_all_tasks support for RISC-V
Extends esp_backtrace_print_all_tasks() to RISC-V targets. For running
tasks, registers are captured using UNW_GET_CONTEXT(); for suspended
tasks, the saved RvExcFrame on the task stack is used. Dual-core support
follows the same IPC pattern as the Xtensa implementation.

Backtrace output adapts to the configured backtrace method:
EH-frame, frame-pointer, or register dump (with a hint to enable
frame-pointer mode).
2026-06-01 19:18:16 +05:30
wuzhenghui
b88a809b8c fix(esp_system): update cache livelock workaround bind to interrupt WDT configuration 2026-05-28 12:10:59 +08:00
Renz Christian Bagaporo
17a9a5cf21 Merge branch 'ci/reenable_unicore_bl_test_h4' into 'master'
test(ci): re-enable skipped ESP32-H4 unicore bootloader tests

Closes IDF-15620

See merge request espressif/esp-idf!48556
2026-05-26 10:45:46 +08:00
Peter Dragun
05faa941c2 fix(esp32c5): Do not disable UART0 sclk when USB Serial/JTAG is primary console
This is a workaround for rom code issue, which can cause the chip to end in infinite loop
when reset is triggered from esptool/idf-monitor. This is only applicable to ESP32-C5 rev <= 1.0.

Closes https://github.com/espressif/esp-idf/issues/18089
2026-05-25 08:35:15 +02: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
Renz Bagaporo
335fd1c24f fix(esp_system): configure ESP32-H4 ICACHE1_USAGE in app startup
Configure the ESP32-H4 ICACHE1_USAGE SRAM ownership bit during app startup
instead of relying on the value left by the bootloader.

Clear ICACHE1_USAGE before external memory/cache setup so single-core apps can
reclaim the ICACHE1 SRAM region as RAM. For multicore apps, set the bit again
when applying multicore cache settings so the region is assigned back to
ICACHE1.

This keeps the app behavior aligned with its own single-core or multicore
configuration even when bootloader and app configs differ.
2026-05-22 12:57:33 +09:00
hebinglin
5710783a89 feat(esp_hw_support): support entry 2 xtalx2 power pu in esp32h4 2026-05-21 19:55:37 +08:00
Li Shuai
ec1705c362 change(esp_system): support system minimum digital peripherals retention runtime attach and detach 2026-05-21 11:46:16 +08:00
wuzhenghui
858ecf6f70 feat(esp_hw_support): check psram data is not corrupted after lightsleep 2026-05-19 21:01:21 +08:00
wuzhenghui
4876a7ad94 fix(esp_system): fix build err if int_wdt is not enabled on esp32 2026-05-19 11:32:42 +08:00
wuzhenghui
11a8a16639 fix(esp_system): remove intwdt config critical area for chips except esp32 2026-05-19 11:28:48 +08:00
Gao Xu
b66f6bcc86 Merge branch 'feat/cam_support_s31' into 'master'
Support dvp cam on ESP32-S31

Closes IDF-14722

See merge request espressif/esp-idf!47850
2026-05-15 10:03:53 +08:00
gaoxu
4e3751b32e feat(cam): support dvp cam on ESP32-S31 2026-05-14 17:09:49 +08:00
Alexey Gerenkov
edb75262a1 Merge branch 'feature/update-esp-clang-to-esp-21.1.3_20260304' into 'master'
feat(tools): update esp-clang version to esp-21.1.3_20260408

Closes IDF-14965, LLVM-501, and LLVM-531

See merge request espressif/esp-idf!46361
2026-05-13 22:54:10 +08:00
Marius Vikhammer
8f6ea2a1ba test(ci): re-enable ESP32-H4 in core system test apps
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 09:00:12 +08:00
Chen Jichang
3c3b9a6a4e ci(esp32h4): disable tests which cannot pass 2026-05-11 16:48:58 +08:00