mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 20:00:53 +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:
@@ -119,7 +119,7 @@ extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bo
|
||||
extern int r_ble_log_deinit_async(void);
|
||||
extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
|
||||
extern void r_ble_log_async_output_dump_all(bool output);
|
||||
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
|
||||
extern void esp_panic_handler_feed_wdts(void);
|
||||
extern int r_ble_log_ctrl_level_and_mod(uint8_t log_level, uint32_t mod_switch);
|
||||
extern int r_ble_ctrl_mod_type(uint16_t mod, uint32_t mod_type_switch);
|
||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||
@@ -379,13 +379,13 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_reconfigure_wdts(5000);
|
||||
esp_panic_handler_feed_wdts();
|
||||
r_ble_log_async_output_dump_all(true);
|
||||
esp_bt_ontroller_log_deinit();
|
||||
stop_write = true;
|
||||
|
||||
buffer = (const uint8_t *)mapped_ptr;
|
||||
esp_panic_handler_reconfigure_wdts(5000);
|
||||
esp_panic_handler_feed_wdts();
|
||||
if (is_filled) {
|
||||
read_index = next_erase_index;
|
||||
} else {
|
||||
@@ -397,7 +397,7 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
|
||||
while (read_index != write_index) {
|
||||
esp_rom_printf("%02x ", buffer[read_index]);
|
||||
if (print_len > max_print_len) {
|
||||
esp_panic_handler_reconfigure_wdts(5000);
|
||||
esp_panic_handler_feed_wdts();
|
||||
print_len = 0;
|
||||
}
|
||||
|
||||
@@ -1401,7 +1401,7 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
|
||||
} else {
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_reconfigure_wdts(1000);
|
||||
esp_panic_handler_feed_wdts();
|
||||
for (int i = 0; i < len; i++) {
|
||||
esp_rom_printf("%02x ", addr[i]);
|
||||
}
|
||||
@@ -1422,7 +1422,7 @@ void esp_ble_controller_log_dump_all(bool output)
|
||||
} else {
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
portENTER_CRITICAL_SAFE(&spinlock);
|
||||
esp_panic_handler_reconfigure_wdts(5000);
|
||||
esp_panic_handler_feed_wdts();
|
||||
BT_ASSERT_PRINT("\r\n[DUMP_START:");
|
||||
r_ble_log_async_output_dump_all(output);
|
||||
BT_ASSERT_PRINT(":DUMP_END]\r\n");
|
||||
|
Reference in New Issue
Block a user