bootloader_panic.c 737 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include "esp_cpu.h"
  7. #include "esp_log.h"
  8. #include "bootloader_common.h"
  9. #include "esp_rom_sys.h"
  10. void __assert_func(const char *file, int line, const char *func, const char *expr)
  11. {
  12. #if !CONFIG_OPTIMIZATION_ASSERTIONS_SILENT
  13. esp_rom_printf("Assert failed in %s, %s:%d (%s)\r\n", func, file, line, expr);
  14. #endif
  15. while (1) {
  16. }
  17. }
  18. void abort(void)
  19. {
  20. #if !CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT
  21. esp_rom_printf("abort() was called at PC 0x%08x\r\n", (intptr_t)__builtin_return_address(0) - 3);
  22. #endif
  23. if (esp_cpu_dbgr_is_attached()) {
  24. esp_cpu_dbgr_break();
  25. }
  26. while (1) {
  27. }
  28. }