Commit Graph

1859 Commits

Author SHA1 Message Date
Erhan Kurubas
11e6799f80 Merge branch 'stub_bins_for_more_targets' into 'master'
Increase OCD stub memory reservation from 8K to 12K and extend this feature to more targets

See merge request espressif/esp-idf!51231
2026-07-28 16:58:05 +02:00
Alexey Lapshin
77420a6f78 Merge branch 'feature/use_zcmp_by_default' into 'master'
feat(build): add ZCMP workaround post-build check

See merge request espressif/esp-idf!49764
2026-07-28 14:00:37 +04:00
Jiang Jiang Jian
8e7e031230 Merge branch 'feat/support_active_tickless_idle' into 'master'
feat(esp_pm): support freertos tickless IDLE with auto lightsleep disabled

Closes PM-799

See merge request espressif/esp-idf!49817
2026-07-28 17:04:50 +08:00
Erhan Kurubas
e21ab7e724 feat(system): add OCD stub bin support for more targets
Add SOC_DEBUG_HAVE_OCD_STUB_BINS for esp32c5, esp32c61, esp32h4,
esp32h21, esp32p4, and esp32s31. Update TEE linker scripts with
correct esp_tee_app_config offsets for the 0x3000 stub reservation
2026-07-28 08:34:02 +03:00
Erhan Kurubas
6e5b4febf8 change(system): increase OCD stub memory reservation from 8K to 12K 2026-07-28 07:45:39 +03:00
Mahavir Jain
0996ffbb4e Merge branch 'fix/fix_esp32s31_xip_bss_psram_build_failure' into 'master'
fix(esp_system): fix backwards location-counter move in `.ext_ram.dummy` on same-region targets

Closes IDFGH-17897

See merge request espressif/esp-idf!50366
2026-07-26 17:24:08 +05:30
Mahavir Jain
c566ace1f6 fix(esp_system): fixes build failure with XIP PSRAM + BSS/NoInit in external memory
Declare ext_ram_xip_seg as a distinct region overlapping drom_seg at the
same origin (the esp32s3/c5/c61/h4 pattern) instead of aliasing drom_seg,
so .ext_ram.dummy has its own location counter and .ext_ram.bss reclaims
the VMA space of NOLOAD rodata (.rodata_wlog_*), saving up to one MMU
page of PSRAM on esp32s31. No layout change on esp32p4.

Closes https://github.com/espressif/esp-idf/issues/18791
Related https://github.com/espressif/esp-idf/issues/14992
2026-07-22 16:39:25 +05:30
wuzhenghui
a04dc898db feat(esp_security): support s31 security clock management 2026-07-22 16:32:45 +08:00
Alexey Lapshin
631ad9033c feat(build): add RISC-V ZCMP post-link workaround check
Validate linked RISC-V executables when
CONFIG_COMPILER_ENABLE_RISCV_ZCMP is enabled on affected chips.
Disassemble each function and reject mstatus.MIE clears that lack an
earlier mintthresh write of 0xff.

Handle csrrci, csrrw, and register-mask csrrc patterns while ignoring
csrrs. Add build-only coverage for valid and invalid sequences with
CMake v1 and v2.

Stop the hardware stack guard before switching stacks during restart,
and keep ZCMP disabled for TEE test apps that still require the
workaround.
2026-07-22 13:04:20 +07:00
wuzhenghui
0aa75e183b feat(esp_pm): add tickless idle support in WAITI mode to reduce power consumption 2026-07-22 12:55:53 +08:00
wuzhenghui
306d54b6d5 feat(int_wdt): add pause and resume functions for cpu1 interrupt watchdog 2026-07-22 12:55:52 +08:00
morris
26a22512eb refactor(hal): extract assist_debug, debug_probe and trace into esp_hal_debug_assist
Move the following modules from the hal component into a new dedicated
esp_hal_debug_assist component, following the esp_hal_timg pattern:

- assist_debug (hal + target-specific LL headers)
- debug_probe (types + target-specific LL headers)
- riscv_trace (hal + types + source + target-specific LL headers)
- trace_ll (esp32/esp32s2/esp32s3 target-specific LL headers)

Update the following components to depend on esp_hal_debug_assist:
esp_system, riscv, bootloader_support, esp_hw_support, esp_riscv_trace

Remove riscv_trace_hal.c from the hal component.
2026-07-21 11:28:11 +08:00
Erhan Kurubas
2c11810ad9 feat(esp_riscv_trace): add riscv trace encoder driver with hal/ll layer 2026-07-17 12:42:13 +02:00
Meet Patel
bb3406e092 Merge branch 'test/idf-additions-coverage' into 'master'
test(esp_system): relocate FreeRTOS tick hook test

See merge request espressif/esp-idf!50441
2026-07-16 10:00:05 +05:30
He Binglin
fcf2df659d Merge branch 'feat/esp_idf_h4_cut_m2a_analog_wait' into 'master'
Feat/esp idf h4 cut m2a analog wait

See merge request espressif/esp-idf!49061
2026-07-15 11:44:05 +08:00
He Binglin
a82577b080 Merge branch 'feat/esp_idf_h4_support_bus_lowpower' into 'master'
feat(esp_hw_support): support esp32h4 esp32s31 bus hw low power

Closes PM-812

See merge request espressif/esp-idf!50563
2026-07-15 11:31:26 +08:00
hebinglin
7d6c54996a feat(esp_hw_support): support esp32h4 esp32s31 bus hw low power 2026-07-14 18:14:07 +08:00
hebinglin
e71b30c279 feat(esp_hw_support): add analog_wait calibration in sleep flow for h4 2026-07-14 17:13:32 +08:00
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
Meet Patel
10c888c859 test(esp_system): relocate FreeRTOS tick hook test
Tick hook registration lives in esp_system, so its scheduler-suspension
coverage belongs in the esp_system unity test app rather than the
freertos IDF additions suite.
2026-07-07 10:11:18 +05:30
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