1menu "Core dump"
2
3    choice ESP_COREDUMP_TO_FLASH_OR_UART
4        prompt "Data destination"
5        default ESP_COREDUMP_ENABLE_TO_NONE
6        help
7            Select place to store core dump: flash, uart or none (to disable core dumps generation).
8
9            Core dumps to Flash are not available if PSRAM is used for task stacks.
10
11            If core dump is configured to be stored in flash and custom partition table is used add
12            corresponding entry to your CSV. For examples, please see predefined partition table CSV descriptions
13            in the components/partition_table directory.
14
15        config ESP_COREDUMP_ENABLE_TO_FLASH
16            bool "Flash"
17            depends on !SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
18            select FREERTOS_ENABLE_TASK_SNAPSHOT
19            select ESP_COREDUMP_ENABLE
20        config ESP_COREDUMP_ENABLE_TO_UART
21            bool "UART"
22            select FREERTOS_ENABLE_TASK_SNAPSHOT
23            select ESP_COREDUMP_ENABLE
24        config ESP_COREDUMP_ENABLE_TO_NONE
25            bool "None"
26    endchoice
27
28    choice ESP_COREDUMP_DATA_FORMAT
29        prompt "Core dump data format"
30        default ESP_COREDUMP_DATA_FORMAT_ELF
31        depends on !ESP_COREDUMP_ENABLE_TO_NONE
32        help
33            Select the data format for core dump.
34        config ESP_COREDUMP_DATA_FORMAT_BIN
35            bool "Binary format"
36        config ESP_COREDUMP_DATA_FORMAT_ELF
37            bool "ELF format"
38    endchoice
39
40    choice ESP_COREDUMP_CHECKSUM
41        prompt "Core dump data integrity check"
42        default ESP_COREDUMP_CHECKSUM_CRC32
43        depends on !ESP_COREDUMP_ENABLE_TO_NONE
44        help
45            Select the integrity check for the core dump.
46        config ESP_COREDUMP_CHECKSUM_CRC32
47            bool "Use CRC32 for integrity verification"
48        config ESP_COREDUMP_CHECKSUM_SHA256
49            bool "Use SHA256 for integrity verification"
50            depends on ESP_COREDUMP_DATA_FORMAT_ELF && IDF_TARGET_ESP32
51    endchoice
52
53    config ESP_COREDUMP_CHECK_BOOT
54        bool "Check core dump data integrity on boot"
55        default y
56        depends on ESP_COREDUMP_ENABLE_TO_FLASH
57        help
58            When enabled, if any data are found on the flash core dump partition,
59            they will be checked by calculating their checksum.
60
61    config ESP_COREDUMP_ENABLE
62        bool
63        default F
64        help
65            Enables/disable core dump module.
66
67    config ESP_COREDUMP_MAX_TASKS_NUM
68        int "Maximum number of tasks"
69        depends on ESP_COREDUMP_ENABLE
70        default 64
71        help
72            Maximum number of tasks snapshots in core dump.
73
74    config ESP_COREDUMP_UART_DELAY
75        int "Delay before print to UART"
76        depends on ESP_COREDUMP_ENABLE_TO_UART
77        default 0
78        help
79            Config delay (in ms) before printing core dump to UART.
80            Delay can be interrupted by pressing Enter key.
81
82    config ESP_COREDUMP_STACK_SIZE
83        int "Reserved stack size"
84        depends on ESP_COREDUMP_ENABLE
85        # Temporarily disable this feature on Xtensa boards as switching stack
86        # pointer triggers an exception (IDF-2797)
87        depends on IDF_TARGET_ARCH_RISCV
88        default 0
89        help
90            Size of the memory to be reserved for core dump stack. If 0 core dump process will run on
91            the stack of crashed task/ISR, otherwise special stack will be allocated.
92            To ensure that core dump itself will not overflow task/ISR stack set this to the value above 800.
93            NOTE: It eats DRAM.
94
95    config ESP_COREDUMP_SUMMARY_STACKDUMP_SIZE
96        int "Size of the stack dump buffer"
97        depends on ESP_COREDUMP_DATA_FORMAT_ELF && ESP_COREDUMP_ENABLE_TO_FLASH && IDF_TARGET_ARCH_RISCV
98        range 512 4096
99        default 1024
100        help
101            Size of the buffer that would be reserved for extracting backtrace info summary.
102            This buffer will contain the stack dump of the crashed task. This dump is useful in generating backtrace
103
104    choice ESP_COREDUMP_DECODE
105        prompt "Handling of UART core dumps in IDF Monitor"
106        depends on ESP_COREDUMP_ENABLE_TO_UART
107        config ESP_COREDUMP_DECODE_INFO
108            bool "Decode and show summary (info_corefile)"
109        config ESP_COREDUMP_DECODE_DISABLE
110            bool "Don't decode"
111    endchoice
112
113    config ESP_COREDUMP_DECODE
114        string
115        default "disable" if ESP_COREDUMP_DECODE_DISABLE
116        default "info" if ESP_COREDUMP_DECODE_INFO
117
118endmenu
119