mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
6e0e7e34ea
- Add support for esp32s2, esp32c3 and esp32c2 for the `memprot`-related tests - Preliminary support for esp32s3 has also been added, the test app will be enabled for esp32s3 later when the memprot-related issues are fixed. - Override panic handler to dump the violation intr status - Dump the `memprot` violation registers before calling the real panic handler - Handle `Illegal Instruction` exception in case of memprot permission violation * In esp32c3 with `memprot` enabled, if we try to execute arbitrary code from RTC_FAST_MEM we get an `Illegal Instruction` exception from the panic handler rather than a `Memory Protection Fault`. * This is because the Illegal Instruction interrupt occurs earlier than the memory protection interrupt due to a higher interrupt latency.
17 lines
577 B
CMake
17 lines
577 B
CMake
set(srcs "test_app_main.c" "test_panic.c")
|
|
|
|
if(CONFIG_TEST_MEMPROT)
|
|
list(APPEND srcs "test_memprot.c")
|
|
if(CONFIG_SOC_MEMPROT_SUPPORTED)
|
|
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
|
|
list(APPEND srcs "panic_utils/memprot_panic_utils_xtensa.c")
|
|
elseif(CONFIG_IDF_TARGET_ARCH_RISCV)
|
|
list(APPEND srcs "panic_utils/memprot_panic_utils_riscv.c")
|
|
endif()
|
|
endif()
|
|
endif()
|
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
INCLUDE_DIRS "include"
|
|
REQUIRES spi_flash esp_psram esp_system esp_partition)
|