bootloader_panic.c 688 B

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