If there's an unattended boot loop or a crash that causes another crash on
the next boot, it needs to be possible to avoid overwriting a saved core
dump with another core dump.
Add an option to do this and skip writing core dumps if the partition isn't
empty.
Fixes#12027.
Mergeshttps://github.com/espressif/esp-idf/pull/12105
Previously, Task Snapshot could be conditionally built based on the
CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT option. However, there is no overhead
with always enabling Task Snapshot functions, as the linker will remove any
functions if they are not called.
This commit...
- removes all ESP-IDF dependencies on the CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT
option so that Task Snapshot functions are always available.
- Makes CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT a hidden option to maintain
compatibility with user code.
- adds documentation regarding Task Snapshot.
Early log strings used by this component are placed in DRAM.
Disabling these logs saves ~5KB of internal memory
Signed-off-by: Vikram <vikram.dattu@espressif.com>
For RISCV, backtrace generation on device is not possible without
including and parsing DWARF sections. We extract the crash task stack
and let the host generate the backtrace
Core dump integrity check can now be parametrized through menuconfig.
It can be performed on boot or ignored. When core dump is activated
in the menuconfig, the user can still check the core dump at any time
with the function `esp_core_dump_image_check()`.
Fix a bug where `esp_core_dump_image_get()` was not accessible
when core dump was disabled.
Closes https://github.com/espressif/esp-idf/issues/6620
This commit includes the refactoring of the core dump feature. Thanks to
this refactoring, it is easier to integrate the support of RISC-V
architecture for this feature.
Fixes ESP-1758
It is not possible to write to Flash when the stack is located in
PSRAM, and it is not possible to write PSRAM buffers into Flash when
malloc can not be used.
This adds detection of UART core dumps to IDF monitor. By default,
core dumps are not printed to the console, but are processed by
espcoredump.py using 'info_corefile' command. The result is printed
to stdout.
This feature can be disabled in menuconfig.
In the future this can be extended to allow running espcoredump.py
with 'dbg_corefile' argument, which is similar to the current GDB Stub
behavior.
Related to IDF-52.
When legacy mode is used, the coredump still fails during linking
because "esp_flash_init_default_chip", "esp_flash_app_init" and
"esp_flash_default_chip " are not compiled and linked.
Instead of using ``if`` macros in callers, these functions are protected
by ``if`` macros in the header, and also not compiled in the sources.
"esp_flash_default_chip" variable is compiled with safe default value.
spi_flash has been updated and its functions work from flash by default instead of IRAM that cause issue
add Kconfig value into espcoredump to enable spi_flash legacy mode (CONFIG_SPI_FLASH_USE_LEGACY_IMPL) when core dump is selected
fix spi_flash issues to work correctly with legacy mode when CONFIG_SPI_FLASH_USE_LEGACY_IMPL is used
Move existing core dump files into espcoredump component folder
Add KConfig, linker.lf, make and CMakeList.txt for new component
Existing functionality separated into core_dump_common, core_dump_flash, core_dump_uart
Update test_core_dump.c and make files to link it as unit test
Update according to review:
Move target and RTOS related functionality into separated file (core_dump_port.c).