1 /*
2 * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include "esp_cpu.h"
8 #include "esp_log.h"
9 #include "bootloader_common.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
16 #if !CONFIG_OPTIMIZATION_ASSERTIONS_SILENT
17 esp_rom_printf("Assert failed in %s, %s:%d (%s)\r\n", func, file, line, expr);
18 #endif
19
20 while (1) {
21 }
22 }
23
abort(void)24 void abort(void)
25 {
26 #if !CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT
27 esp_rom_printf("abort() was called at PC 0x%08x\r\n", (intptr_t)__builtin_return_address(0) - 3);
28 #endif
29 #if CONFIG_ESP_DEBUG_OCDAWARE
30 if (esp_cpu_dbgr_is_attached()) {
31 esp_cpu_dbgr_break();
32 }
33 #endif
34 while (1) {
35 }
36 }
37