Commit Graph
155 Commits
Author SHA1 Message Date
Xiao Xufeng 3d76ced5bb fix(mmap): fixed some API read wrong data via mmap when flash being erased/written while XIP on PSRAM
Before:

The cache won't be disabled when XIP on psram. But during flash
erasing/programming, read data will be courrupt.

When XIP in psram is enabled, the image is not mapped to the cache so
usually there will be no flash access. The only way to read from flash
is via the driver or use mmap. The driver has protection during erasing,
while th mmap region not.

Now:

Mmap APIs provide a flag to make mmap->unmap region mutually exclusive
to flash erase/programming when XIP from psram. SPI Flash write APIs
will benefit from this. When the flag is used, no concurrent access to
mapped region will happen while writing; otherwise the cache will be
disable to avoid data corruption.

Most ESP-IDF APIs calls mmap with this flag. As for users calling
mmap-like APIs directly, they can choose whether to enable this by a
flag.

Closes https://github.com/espressif/esp-idf/issues/14897
2026-08-31 01:37:44 +08:00
harshal.patil a847bb8439 fix(panic): handle absent IROM/DROM alignment gap in spiram-xip memprot tests
The spiram-xip IROM/DROM alignment tests assumed the XIP region always
leaves an alignment gap before the next MMU page: they executed into the
gap and expected an instruction access fault followed by a register dump.
When the section ends exactly on an MMU page boundary there is no gap - the
device prints "<IROM/DROM> alignment gap not added into heap" and returns,
the framework restarts cleanly (esp_restart_noos, no panic), and the test
timed out waiting for a register dump.
2026-07-01 11:00:16 +05:30
nilesh.kale e3a8feedcc fix(cpu_region_protect): set DROM mask PMP entry to read-only
PMP entry 3 (SOC_DROM_MASK_HIGH, TOR mode) in the memprot path
was incorrectly granted RW permission on esp32h21 and esp32c61.
The mask ROM data region is inherently read-only; remove the W bit.

Also added necessary tests to check voilations and re-enabled
tests for ESP32P4
2026-05-21 11:33:09 +05:30
Erhan Kurubas 11ec258dcc feat(coredump): add coredump_noinit attribute 2026-05-12 21:30:12 +08:00
harshal.patil 8121f66ec3 feat(cpu_region_protect): Extend PMP memprot for ESP32-P4 V3 2026-05-08 12:43:26 +05:30
Alexey Lapshin 2ff7df235a fix(panic_test): avoid linker check on dangerous relocations
xtensa linker throws warning
dangerous relocation: windowed longcall crosses 1GB boundary; return may fail

create separate function to call function by pointer to avoid warnings
2026-05-08 12:43:26 +05:30
Marius Vikhammer 160151e8be test(system): enable panic tests for P4 2026-04-16 09:54:16 +08:00
Alexey Gerenkov 752c01ece0 Merge branch 'feature/refactor_linker_scripts_v5.5' into 'release/v5.5'
feat(esp_system): refactor linker scripts to reduce duplicated code (v5.5)

See merge request espressif/esp-idf!45729
2026-03-30 21:19:53 +08:00
Alexey Lapshin 3c237fcd86 fix(test): fix xfail panic test for esp32s2 2026-03-16 18:12:07 +07:00
Evgeny Torbin d412f4b858 ci: remove unused test cases 2026-03-13 16:06:08 +08:00
Erhan Kurubas 8dbf56e077 test(espcoredump): fix test for corrupted TCB handling in coredump 2026-01-21 18:44:44 +03:00
Erhan Kurubas 88efba061e test(panic): improve stack dump capture to return full hex content 2026-01-21 18:37:52 +03:00
Alexey Gerenkov 69550e12e2 Merge branch 'fix/int_wdt_double_exception_v5.5' into 'release/v5.5'
fix(espcoredump): prevent double exception during int_wdt panic with custom stack (v5.5)

See merge request espressif/esp-idf!44174
2026-01-21 23:03:41 +08:00
Erhan Kurubas b38c003cb1 test(panic): add retry logic to espcoredump subprocess call 2026-01-21 00:24:38 +03:00
Erhan Kurubas 1991aa6da0 fix(espcoredump): prevent double exception during int_wdt panic with custom stack 2025-12-17 21:36:19 +01:00
armando 4ef2005b80 change(ci): use p4 rev3 by default only when ci build 2025-11-20 11:33:36 +08:00
armando 304ba1655b fix check test scripts build issue 2025-11-20 11:33:36 +08:00
armando cdff2570c7 ci(p4): disable p4 rev3 invalid tests temporarily 2025-11-20 11:33:36 +08:00
Sudeep Mohanty 83ea01f61b test(panic_handler): Added unit test to verify panic handler can halt
This test verifies that the panic handler can indeed halt when
configured to print and halt instead of rebboting.
2025-08-14 14:05:51 +02:00
harshal.patil ab229a34b3 feat(cpu_region_protect): Enable basic memory protection for SPIRAM 2025-04-29 11:48:27 +05:30
Chen Jichang c34b4eb882 feat(esp32h4): enable ESP32H4 ci build 2025-03-28 14:41:28 +08:00
Erhan Kurubas d2c882502d test(coredump): add test to dump dram from uart 2025-03-26 10:00:24 +01:00
Erhan Kurubas 11e6aa8f1a test(panic): refactor test parameters with itertools 2025-03-05 14:01:25 +01:00
igor.udot daf2d31008 test: format all test scripts 2025-03-05 12:08:48 +08:00
Marius Vikhammer a5fe1e2a46 Merge branch 'feature/h21_panic' into 'master'
feat(esph21): bringup and test panic handler

Closes IDF-11546

See merge request espressif/esp-idf!37007
2025-02-21 10:25:03 +08:00
Sudeep Mohanty b562afa08e fix(panic_handler): Updated panic handler to use RTC WDT
This commit updates the following:
- Updates the panic handler to use only the RTC WDT to reset the system.
- Refactors some of the panic handler code.
- Updates Bluetooth files where in they now feed the WDTs instead of
  reconfiguring them.
- Removes some unnecessary configuration of WDTs from various files.
- Added a unit test to verify that the system does not lock up when the
  panic handler is stuck.
- Updates the memprot unit tests to work with the refactored panic
  handler.

Closes https://github.com/espressif/esp-idf/issues/15166
Closes https://github.com/espressif/esp-idf/issues/15018
Closes https://github.com/espressif/esp-idf/issues/10110
2025-02-18 15:40:54 +01:00
Marius Vikhammer 91bff05d9f feat(esph21): bringup and test panic handler 2025-02-17 11:58:55 +08:00
Erhan Kurubas f6b407d6b9 test(coredump): collect all expected uart data first, then process lazily 2025-02-01 06:12:11 +08:00
Omar Chebib 16b8a2ea3b feat(esp_hw_support): two interrupts sources can now be mapped to the same interrupt line 2025-01-15 13:13:24 +08:00
Omar Chebib 980cf269c7 feat(riscv): implement frame pointer option for backtracing 2025-01-09 11:57:02 +08:00
Marius Vikhammer b07761825e Merge branch 'feature/dcache_write_flash_panic' into 'master'
feat(panic): panic immediately on an attempt to write to flash via dcache

See merge request espressif/esp-idf!34190
2025-01-03 10:12:30 +08:00
Marius Vikhammer 096cb409d9 feat(panic): panic immediatly if trying to write to flash through cache on ESP32-S3
Updated S3 to use PMS protection for writing to flash through cache. This means we get
a panic quicker for this illegal behavior than we did before, making the source of the error
easier to track down.
2024-12-27 17:58:33 +08:00
Alexey Lapshin b58c9a4219 feat(panic): support HWSG for esp32c5, esp32c61 and enable testing 2024-12-26 12:45:17 +07:00
Erhan Kurubas 62d59751c0 change(tools): enhance expect_reg_dump to support any or specific core values 2024-12-04 18:43:30 +08:00
Alexey Lapshin 244c369cd8 fix(xtensa): fix confusing backtrace when PC is invalid
Before this change _invalid_pc_placeholder pointed to address of _init
function from crti.o
This made GDB input a bit confusing:

  0x40080400 in _init ()
  (gdb) bt
  #0  0x40080400 in _init ()
  #1  0x400e519a in test_instr_fetch_prohibited () at /home/alex/git/esp-idf/tools/test_apps/system/panic/main/test_panic.c:271
  #2  0x400d89a7 in app_main () at /home/alex/git/esp-idf/tools/test_apps/system/panic/main/test_app_main.c:116
  #3  0x400e5f22 in main_task (args=0x0) at /home/alex/git/esp-idf/components/freertos/app_startup.c:208
  #4  0x400895a8 in vPortTaskWrapper (pxCode=0x400e5eb0 <main_task>, pvParameters=0x0) at /home/alex/git/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139

After the change GDB prints output that contains a hint:

  _invalid_pc_placeholder () at /home/alex/git/esp-idf/components/xtensa/xtensa_vectors.S:2235
  2235	    UNREACHABLE_INSTRUCTION_CHECK_PREVIOUS_FRAMES
  (gdb) bt
  #0  _invalid_pc_placeholder () at /home/alex/git/esp-idf/components/xtensa/xtensa_vectors.S:2235
  #1  0x400e519e in test_instr_fetch_prohibited () at /home/alex/git/esp-idf/tools/test_apps/system/panic/main/test_panic.c:271
  #2  0x400d89ab in app_main () at /home/alex/git/esp-idf/tools/test_apps/system/panic/main/test_app_main.c:116
  #3  0x400e5f26 in main_task (args=0x0) at /home/alex/git/esp-idf/components/freertos/app_startup.c:208
  #4  0x400895a8 in vPortTaskWrapper (pxCode=0x400e5eb4 <main_task>, pvParameters=0x0) at /home/alex/git/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139
2024-12-02 21:36:00 +07:00
Alexey Lapshin bfe3511493 fix(panic): fix HWSG testcase to avoid freertos watchpoint trap 2024-12-02 20:26:26 +07:00
Marius Vikhammer f8ddcee8cd Merge branch 'refactor/cache_err_panic' into 'master'
refactor(panic): refactor and unify cache panic errors

See merge request espressif/esp-idf!34382
2024-11-13 10:19:38 +08:00
Fu Hanxi 5a3f53a2b5 ci: print esp-coredump output when failed in panic tests 2024-11-08 11:13:43 +01:00
Marius Vikhammer 9c5dde5536 refactor(panic): refactor and unify cache panic errors 2024-11-07 11:39:40 +08:00
Armando (Dou Yiwen) 93de26537c Merge branch 'fix/sanitizer_issue' into 'master'
flash: flash ops sanitizer

Closes IDF-9954

See merge request espressif/esp-idf!33859
2024-10-14 10:36:43 +08:00
Armando e9bd3c01f0 change(flash): flash ops sanitizer 2024-10-09 15:37:50 +08:00
morris aebf700919 refactor(freertos): rename SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY and move to freertos 2024-10-09 13:32:03 +08:00
Erhan Kurubas 6d9905a90c feat(esp-coredump): enable esp32c61 tests 2024-10-04 06:58:03 +02:00
Erhan Kurubas 13c8c2f121 test(esp-coredump): add test for the soft sha config 2024-09-26 13:04:39 +02:00
harshal.patil fcd751e79c ci(memprot): enable memory protection tests for ESP32-C61 2024-09-18 10:25:18 +05:30
Omar Chebib bc0b04d779 Merge branch 'staging/enabling_panic_test_esp32c61' into 'master'
test(panic): enable tests for esp32c61

Closes IDF-10994

See merge request espressif/esp-idf!33277
2024-09-10 11:37:38 +08:00
Alexey Lapshin 47212eaa3a feat(tools): update toolchain version to esp-14.2.0_20240903
Closes https://github.com/espressif/esp-idf/issues/13979
Closes https://github.com/espressif/esp-idf/issues/14273
Closes https://github.com/espressif/esp-idf/issues/14267
2024-09-08 13:52:22 +07:00
Omar Chebib d025ff4073 test(panic): enable tests for esp32c61 2024-09-05 14:50:58 +08:00
Erhan Kurubas 1e3c3b8738 Merge branch 'feature/esp32c5_coredump' into 'master'
ESP32-C5 enable core dump tests

Closes IDF-8661

See merge request espressif/esp-idf!30151
2024-09-04 20:08:48 +08:00
wanckl 4e095f4b9f ci(esp32c61): enable c61 generic target test 2024-09-02 19:26:12 +08:00