Skip to content

Commit

Permalink
esp32, esp32s2: move panic handling code to new component
Browse files Browse the repository at this point in the history
  • Loading branch information
renzbagaporo committed Mar 10, 2020
1 parent a3816bc commit 2b10078
Show file tree
Hide file tree
Showing 41 changed files with 1,264 additions and 1,551 deletions.
2 changes: 1 addition & 1 deletion Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
CONFIG_APP_BUILD_TYPE_ELF_RAM=y
CONFIG_VFS_SUPPORT_TERMIOS=
CONFIG_NEWLIB_NANO_FORMAT=y
CONFIG_ESP32_PANIC_PRINT_HALT=y
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
CONFIG_ESP32_DEBUG_STUBS_ENABLE=
CONFIG_ESP_ERR_TO_NAME_LOOKUP=

Expand Down
2 changes: 1 addition & 1 deletion components/bootloader_support/src/esp32/bootloader_esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static void bootloader_check_wdt_reset(void)

void abort(void)
{
#if !CONFIG_ESP32_PANIC_SILENT_REBOOT
#if !CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT
ets_printf("abort() was called at PC 0x%08x\r\n", (intptr_t)__builtin_return_address(0) - 3);
#endif
if (esp_cpu_in_ocd_debug_mode()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static void bootloader_check_wdt_reset(void)

void abort(void)
{
#if !CONFIG_ESP32S2_PANIC_SILENT_REBOOT
#if !CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT
ets_printf("abort() was called at PC 0x%08x\r\n", (intptr_t)__builtin_return_address(0) - 3);
#endif
if (esp_cpu_in_ocd_debug_mode()) {
Expand Down
2 changes: 0 additions & 2 deletions components/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ else()
"cpu_start.c"
"crosscore_int.c"
"dport_access.c"
"dport_panic_highint_hdl.S"
"esp_himem.c"
"hw_random.c"
"int_wdt.c"
"intr_alloc.c"
"panic.c"
"pm_esp32.c"
"pm_trace.c"
"reset_reason.c"
Expand Down
32 changes: 0 additions & 32 deletions components/esp32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -356,38 +356,6 @@ menu "ESP32-specific"

Data is reserved at the beginning of RTC slow memory.

choice ESP32_PANIC
prompt "Panic handler behaviour"
default ESP32_PANIC_PRINT_REBOOT
help
If FreeRTOS detects unexpected behaviour or an unhandled exception, the panic handler is
invoked. Configure the panic handlers action here.

config ESP32_PANIC_PRINT_HALT
bool "Print registers and halt"
help
Outputs the relevant registers over the serial port and halt the
processor. Needs a manual reset to restart.

config ESP32_PANIC_PRINT_REBOOT
bool "Print registers and reboot"
help
Outputs the relevant registers over the serial port and immediately
reset the processor.

config ESP32_PANIC_SILENT_REBOOT
bool "Silent reboot"
help
Just resets the processor without outputting anything

config ESP32_PANIC_GDBSTUB
bool "Invoke GDBStub"
select ESP_GDBSTUB_ENABLED
help
Invoke gdbstub on the serial port, allowing for gdb to attach to it to do a postmortem
of the crash.
endchoice

config ESP32_DEBUG_OCDAWARE
bool "Make exception and panic handlers JTAG/OCD aware"
default y
Expand Down
5 changes: 0 additions & 5 deletions components/esp32/linker.lf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
[mapping:esp32]
archive: libesp32.a
entries:
panic (noflash)

[mapping:gcc]
archive: libgcc.a
entries:
Expand Down
Loading

0 comments on commit 2b10078

Please sign in to comment.