From 2d552700069403820ce5ea636d4bab32b45bad9d Mon Sep 17 00:00:00 2001 From: Erhan Kurubas Date: Wed, 18 Oct 2023 00:04:17 +0200 Subject: [PATCH] fix(esp_hw_support): re-enable CONFIG_ESP_DEBUG_OCDAWARE functionality --- components/bootloader_support/src/bootloader_panic.c | 2 ++ components/esp_system/panic.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/bootloader_support/src/bootloader_panic.c b/components/bootloader_support/src/bootloader_panic.c index 6cff254ce6..aac9e72638 100644 --- a/components/bootloader_support/src/bootloader_panic.c +++ b/components/bootloader_support/src/bootloader_panic.c @@ -26,9 +26,11 @@ void abort(void) #if !CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT esp_rom_printf("abort() was called at PC 0x%08x\r\n", (intptr_t)__builtin_return_address(0) - 3); #endif +#if CONFIG_ESP_DEBUG_OCDAWARE if (esp_cpu_dbgr_is_attached()) { esp_cpu_dbgr_break(); } +#endif while (1) { } } diff --git a/components/esp_system/panic.c b/components/esp_system/panic.c index b425cbc8c0..c77568d4a1 100644 --- a/components/esp_system/panic.c +++ b/components/esp_system/panic.c @@ -288,6 +288,7 @@ void esp_panic_handler(panic_info_t *info) // If on-chip-debugger is attached, and system is configured to be aware of this, // then only print up to details. Users should be able to probe for the other information // in debug mode. +#if CONFIG_ESP_DEBUG_OCDAWARE if (esp_cpu_dbgr_is_attached()) { panic_print_str("Setting breakpoint at 0x"); panic_print_hex((uint32_t)info->addr); @@ -305,7 +306,7 @@ void esp_panic_handler(panic_info_t *info) esp_cpu_set_breakpoint(0, info->addr); // use breakpoint 0 return; } - +#endif //CONFIG_ESP_DEBUG_OCDAWARE // start panic WDT to restart system if we hang in this handler if (!wdt_hal_is_enabled(&rtc_wdt_ctx)) { wdt_hal_init(&rtc_wdt_ctx, WDT_RWDT, 0, false);