File tree Expand file tree Collapse file tree 5 files changed +22
-8
lines changed Expand file tree Collapse file tree 5 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ menu "Core dump"
14
14
15
15
config ESP_COREDUMP_ENABLE_TO_FLASH
16
16
bool "Flash"
17
- depends on !SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
18
17
select FREERTOS_ENABLE_TASK_SNAPSHOT
19
18
select ESP_COREDUMP_ENABLE
20
19
config ESP_COREDUMP_ENABLE_TO_UART
@@ -79,10 +78,21 @@ menu "Core dump"
79
78
Config delay (in ms) before printing core dump to UART.
80
79
Delay can be interrupted by pressing Enter key.
81
80
81
+
82
+ config ESP_COREDUMP_USE_STACK_SIZE
83
+ bool
84
+ default y if ESP_COREDUMP_ENABLE_TO_FLASH && SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
85
+ default n
86
+ help
87
+ Force the use of a custom DRAM stack for coredump when Task stacks can be in PSRAM.
88
+
82
89
config ESP_COREDUMP_STACK_SIZE
83
90
int "Reserved stack size"
84
91
depends on ESP_COREDUMP_ENABLE
85
- default 0
92
+ range 0 4096 if !ESP_COREDUMP_USE_STACK_SIZE
93
+ range 1280 4096 if ESP_COREDUMP_USE_STACK_SIZE
94
+ default 0 if !ESP_COREDUMP_USE_STACK_SIZE
95
+ default 1280 if ESP_COREDUMP_USE_STACK_SIZE
86
96
help
87
97
Size of the memory to be reserved for core dump stack. If 0 core dump process will run on
88
98
the stack of crashed task/ISR, otherwise special stack will be allocated.
Original file line number Diff line number Diff line change @@ -121,7 +121,13 @@ FORCE_INLINE_ATTR void esp_core_dump_report_stack_usage(void)
121
121
esp_core_dump_restore_sp (& s_stack_context );
122
122
}
123
123
124
- #else
124
+ #else // CONFIG_ESP_COREDUMP_STACK_SIZE > 0
125
+
126
+ /* Here, we are not going to use a custom stack for coredump. Make sure the current configuration doesn't require one. */
127
+ #if CONFIG_ESP_COREDUMP_USE_STACK_SIZE
128
+ #pragma error "CONFIG_ESP_COREDUMP_STACK_SIZE must not be 0 in the current configuration"
129
+ #endif // ESP_COREDUMP_USE_STACK_SIZE
130
+
125
131
FORCE_INLINE_ATTR void esp_core_dump_setup_stack (void )
126
132
{
127
133
/* If we are in ISR set watchpoint to the end of ISR stack */
@@ -139,7 +145,7 @@ FORCE_INLINE_ATTR void esp_core_dump_setup_stack(void)
139
145
FORCE_INLINE_ATTR void esp_core_dump_report_stack_usage (void )
140
146
{
141
147
}
142
- #endif
148
+ #endif // CONFIG_ESP_COREDUMP_STACK_SIZE > 0
143
149
144
150
static void * s_exc_frame = NULL ;
145
151
Original file line number Diff line number Diff line change @@ -312,10 +312,10 @@ bool esp_core_dump_check_task(core_dump_task_header_t *task)
312
312
*/
313
313
bool esp_core_dump_mem_seg_is_sane (uint32_t addr , uint32_t sz )
314
314
{
315
- //TODO: external SRAM not supported yet
316
315
return (esp_ptr_in_dram ((void * )addr ) && esp_ptr_in_dram ((void * )(addr + sz - 1 )))
317
316
|| (esp_ptr_in_rtc_slow ((void * )addr ) && esp_ptr_in_rtc_slow ((void * )(addr + sz - 1 )))
318
317
|| (esp_ptr_in_rtc_dram_fast ((void * )addr ) && esp_ptr_in_rtc_dram_fast ((void * )(addr + sz - 1 )))
318
+ || (esp_ptr_external_ram ((void * )addr ) && esp_ptr_external_ram ((void * )(addr + sz - 1 )))
319
319
|| (esp_ptr_in_iram ((void * )addr ) && esp_ptr_in_iram ((void * )(addr + sz - 1 )));
320
320
}
321
321
Original file line number Diff line number Diff line change @@ -324,10 +324,10 @@ bool esp_core_dump_check_stack(core_dump_task_header_t *task)
324
324
*/
325
325
bool esp_core_dump_mem_seg_is_sane (uint32_t addr , uint32_t sz )
326
326
{
327
- //TODO: external SRAM not supported yet
328
327
return (esp_ptr_in_dram ((void * )addr ) && esp_ptr_in_dram ((void * )(addr + sz - 1 )))
329
328
|| (esp_ptr_in_rtc_slow ((void * )addr ) && esp_ptr_in_rtc_slow ((void * )(addr + sz - 1 )))
330
329
|| (esp_ptr_in_rtc_dram_fast ((void * )addr ) && esp_ptr_in_rtc_dram_fast ((void * )(addr + sz - 1 )))
330
+ || (esp_ptr_external_ram ((void * )addr ) && esp_ptr_external_ram ((void * )(addr + sz - 1 )))
331
331
|| (esp_ptr_in_iram ((void * )addr ) && esp_ptr_in_iram ((void * )(addr + sz - 1 )));
332
332
}
333
333
Original file line number Diff line number Diff line change @@ -69,8 +69,6 @@ static IRAM_ATTR esp_err_t start(void *arg)
69
69
static IRAM_ATTR esp_err_t end (void * arg )
70
70
{
71
71
#if CONFIG_IDF_TARGET_ESP32
72
- Cache_Flush (0 );
73
- Cache_Flush (1 );
74
72
Cache_Read_Enable (0 );
75
73
Cache_Read_Enable (1 );
76
74
#elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
You can’t perform that action at this time.
0 commit comments