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