7070# This list is used to check if the target is a dual-core one.
7171TARGETS_DUAL_CORE_NAMES = [x .mark .name for x in TARGETS_DUAL_CORE ]
7272
73- # The tests which panic on external stack require PSRAM capable runners
7473CONFIGS_EXTRAM_STACK = [
75- pytest .param ('coredump_extram_stack' , marks = [pytest .mark .esp32 , pytest .mark .psram ]),
76- pytest .param ('coredump_extram_stack' , marks = [pytest .mark .esp32s2 , pytest .mark .generic ]),
77- pytest .param ('coredump_extram_stack' , marks = [pytest .mark .esp32s3 , pytest .mark .quad_psram ]),
74+ pytest .param ('coredump_flash_extram_stack_heap_esp32' , marks = [pytest .mark .esp32 , pytest .mark .psram ]),
75+ pytest .param ('coredump_flash_extram_stack_heap_esp32s2' , marks = [pytest .mark .esp32s2 , pytest .mark .generic ]),
76+ pytest .param ('coredump_flash_extram_stack_heap_esp32s3' , marks = [pytest .mark .esp32s3 , pytest .mark .quad_psram ]),
77+ pytest .param ('coredump_flash_extram_stack_bss_esp32' , marks = [pytest .mark .esp32 , pytest .mark .psram ]),
78+ pytest .param ('coredump_flash_extram_stack_bss_esp32s2' , marks = [pytest .mark .esp32s2 , pytest .mark .generic ]),
79+ pytest .param ('coredump_flash_extram_stack_bss_esp32s3' , marks = [pytest .mark .esp32s3 , pytest .mark .quad_psram ]),
7880]
7981
8082CONFIGS_HW_STACK_GUARD = [
@@ -208,8 +210,11 @@ def test_task_wdt_cpu1(dut: PanicTestDut, config: str, test_func_name: str) -> N
208210
209211
210212@pytest .mark .parametrize ('config' , CONFIGS_EXTRAM_STACK , indirect = True )
211- def test_panic_extram_stack (dut : PanicTestDut , config : str , test_func_name : str ) -> None :
212- dut .run_test_func (test_func_name )
213+ def test_panic_extram_stack (dut : PanicTestDut , config : str ) -> None :
214+ if 'heap' in config :
215+ dut .run_test_func ('test_panic_extram_stack_heap' )
216+ else :
217+ dut .run_test_func ('test_panic_extram_stack_bss' )
213218 dut .expect_none ('Allocated stack is not in external RAM' )
214219 dut .expect_none ('Guru Meditation' )
215220 dut .expect_backtrace ()
@@ -222,7 +227,22 @@ def test_panic_extram_stack(dut: PanicTestDut, config: str, test_func_name: str)
222227 # The caller must be accessible after restoring the stack
223228 dut .expect_exact ('Core dump has been saved to flash.' )
224229
225- common_test (dut , config )
230+ if dut .target == 'esp32' :
231+ # ESP32 External data memory range [0x3f800000-0x3fc00000)
232+ coredump_pattern = re .compile ('.coredump.tasks.data (0x3[fF][8-9a-bA-B][0-9a-fA-F]{5}) (0x[a-fA-F0-9]+) RW' )
233+ elif dut .target == 'esp32s2' :
234+ # ESP32-S2 External data memory range [0x3f500000-0x3ff80000)
235+ coredump_pattern = re .compile ('.coredump.tasks.data (0x3[fF][5-9a-fA-F][0-7][0-9a-fA-F]{4}) (0x[a-fA-F0-9]+) RW' )
236+ else :
237+ # ESP32-S3 External data memory range [0x3c000000-0x3e000000)
238+ coredump_pattern = re .compile ('.coredump.tasks.data (0x3[c-dC-D][0-9a-fA-F]{6}) (0x[a-fA-F0-9]+) RW' )
239+
240+ common_test (
241+ dut ,
242+ config ,
243+ expected_backtrace = None ,
244+ expected_coredump = [coredump_pattern ]
245+ )
226246
227247
228248@pytest .mark .parametrize ('config' , CONFIGS , indirect = True )
0 commit comments