mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-17 15:15:02 +00:00
fix(panic_handler): Updated panic handler to use RTC WDT
This commit updates the following: - Updates the panic handler to use only the RTC WDT to reset the system. - Refactors some of the panic handler code. - Updates Bluetooth files where in they now feed the WDTs instead of reconfiguring them. - Removes some unnecessary configuration of WDTs from various files. - Added a unit test to verify that the system does not lock up when the panic handler is stuck. - Updates the memprot unit tests to work with the refactored panic handler. Closes https://github.com/espressif/esp-idf/issues/15166 Closes https://github.com/espressif/esp-idf/issues/15018 Closes https://github.com/espressif/esp-idf/issues/10110
This commit is contained in:
@@ -597,6 +597,72 @@ def test_panic_delay(dut: PanicTestDut) -> None:
|
||||
dut.expect_exact('rst:0xc (SW_CPU_RESET)')
|
||||
|
||||
|
||||
@pytest.mark.parametrize('config', ['panic'], indirect=True)
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.generic
|
||||
def test_panic_handler_stuck0(dut: PanicTestDut, config: str, test_func_name: str) -> None:
|
||||
dut.run_test_func(test_func_name)
|
||||
|
||||
# Expect a panic handler stuck message
|
||||
dut.expect_exact('Panic handler stuck')
|
||||
|
||||
# Expect a reboot
|
||||
dut.expect_cpu_reset()
|
||||
|
||||
|
||||
@pytest.mark.parametrize('config', ['panic'], indirect=True)
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.generic
|
||||
def test_panic_handler_stuck1(dut: PanicTestDut, config: str, test_func_name: str) -> None:
|
||||
dut.run_test_func(test_func_name)
|
||||
|
||||
# Expect a panic handler stuck message
|
||||
dut.expect_exact('Panic handler stuck')
|
||||
|
||||
# Expect a reboot
|
||||
dut.expect_cpu_reset()
|
||||
|
||||
|
||||
@pytest.mark.parametrize('config', ['panic'], indirect=True)
|
||||
@pytest.mark.supported_targets
|
||||
@pytest.mark.generic
|
||||
def test_panic_handler_crash0(dut: PanicTestDut, config: str, test_func_name: str) -> None:
|
||||
dut.run_test_func(test_func_name)
|
||||
|
||||
# Expect a panic handler crash message
|
||||
dut.expect_exact('Panic handler crashed 1 times')
|
||||
|
||||
# Expect a the second panic handler crash message
|
||||
dut.expect_exact('Panic handler crashed 2 times')
|
||||
|
||||
# Expect bailout message
|
||||
dut.expect_exact('Panic handler entered multiple times. Abort panic handling. Rebooting ...')
|
||||
|
||||
# Expect a reboot
|
||||
dut.expect_cpu_reset()
|
||||
|
||||
|
||||
@pytest.mark.parametrize('config', ['panic'], indirect=True)
|
||||
@pytest.mark.esp32
|
||||
@pytest.mark.esp32s3
|
||||
@pytest.mark.generic
|
||||
def test_panic_handler_crash1(dut: PanicTestDut, config: str, test_func_name: str) -> None:
|
||||
dut.run_test_func(test_func_name)
|
||||
|
||||
# Expect a panic handler crash message
|
||||
dut.expect_exact('Panic handler crashed 1 times')
|
||||
|
||||
# Expect a the second panic handler crash message
|
||||
dut.expect_exact('Panic handler crashed 2 times')
|
||||
|
||||
# Expect bailout message
|
||||
dut.expect_exact('Panic handler entered multiple times. Abort panic handling. Rebooting ...')
|
||||
|
||||
# Expect a reboot
|
||||
dut.expect_cpu_reset()
|
||||
|
||||
|
||||
#########################
|
||||
# for memprot test only #
|
||||
#########################
|
||||
|
Reference in New Issue
Block a user