Commit Graph

1874 Commits

Author SHA1 Message Date
harshal.patil
73dd203204 fix(esp_system): report ESP32-S3 PMS violations as memory protection faults
On Xtensa the PMS violation shares ETS_MEMACCESS_ERR_INUM with the cache error
and arrives as PANIC_RSN_CACHEERR. ESP32-S2 tells the two apart, ESP32-S3 never
did (//MV note in dd938eb95), so PMS faults were reported as "Cache error".

panic_memprot_fill_info() now claims the panic only when
esp_mprot_get_active_intr() reports a pending violation, and the ESP32-S3 cache
error path consults it, falling back to the cache error report as before.
RISC-V has a dedicated interrupt, so its reporting stays unconditional.
ESP32-S2 and ESP32 are untouched.
2026-09-01 12:29:21 +05:30
harshal.patil
9a201cdd1e refactor(esp_system): factor the memprot panic report out of panic_arch.c
Move print_memprot_err_details() and its state out of the RISC-V panic_arch.c
into port/panic_memprot.c behind panic_memprot_fill_info(), so the report can
be shared with the Xtensa PMS targets. No functional change.
2026-09-01 12:29:21 +05:30
Chen Chen
0b4f787645 fix: changed the expected axi reset reason for S31 2026-08-26 17:19:20 +08:00
Michael (XIAO Xufeng)
4bf78f4fa6 Merge branch 'debug/idf-15875-fix' into 'master'
fix(psram): suspend external cache during CPU freq switch on esp32p4

Closes IDF-15875

See merge request espressif/esp-idf!50947
2026-08-25 18:01:02 +08:00
Marius Vikhammer
c931510149 Merge branch 'fix/psram_dependency' into 'master'
fix(build_system): cleaned up esp_psram dependencies

See merge request espressif/esp-idf!51934
2026-08-25 10:39:01 +08:00
Ashish Sharma
d631bca52f fix(spi_flash): disable branch prediction on the parked core during flash ops 2026-08-24 13:27:04 +08:00
Marius Vikhammer
532b433246 fix(build_system): cleaned up esp_psram dependencies
Also moved mspi_mb functionality to esp_hw_support together with
other mspi functionality
2026-08-24 11:12:17 +08:00
Michael.B
4f35071d50 fix(psram): suspend external cache during CPU freq switch on esp32p4
Suspend the external-memory cache around the boot CPU frequency switch so
PSRAM-XIP / write-back cache state cannot be corrupted mid-switch.
2026-08-21 23:03:18 +08:00
Stefan Stipanovic
d0ae774d59 fix(esp_system): enable linking with LLD on RISC-V targets 2026-08-13 21:23:36 +02:00
Erhan Kurubas
313ee9b5db fix(esp_system): break into the debugger only on the first panic entry 2026-08-12 09:26:49 +02:00
Wu Zheng Hui
234c68ba93 Merge branch 'feat/support_esp32s31_xtal_fosc_force_pu' into 'master'
feat: update XTAL sleep FPU parameters to save power

Closes PM-824 and IDF-15576

See merge request espressif/esp-idf!51100
2026-08-10 15:37:00 +08:00
Jiang Jiang Jian
3808652972 Merge branch 'fix/fix_esp32s31_secureboot_fastwake' into 'master'
fix(esp_system): support rom secure boot fast wake feature for esp32s31

Closes PM-832

See merge request espressif/esp-idf!51265
2026-07-31 14:12:25 +08:00
harshal.patil
e1d60fb89f refactor(esp_system): deduplicate ROM fast wake RTC digest reservation
The digest length and the condition that reserves it at the end of RTC RAM were
duplicated in seven places. Hold the reservation in a hidden Kconfig value that
is zero when the feature does not apply, so every consumer subtracts it
unconditionally, and derive ESP_SECURE_BOOT_DIGEST_LEN from it.
2026-07-30 12:20:22 +05:30
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
wuzhenghui
f2b2bac778 fix(esp_system): support rom secure boot fast wake feature for esp32s31 2026-07-28 21:32:45 +08:00
wuzhenghui
228970b0c2 feat(esp_system): support XTAL as RTC fast clock source 2026-07-28 19:57:57 +08: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