diff --git a/components/freertos/port/esp8266/panic.c b/components/freertos/port/esp8266/panic.c index 7b2dc39e..c136c972 100644 --- a/components/freertos/port/esp8266/panic.c +++ b/components/freertos/port/esp8266/panic.c @@ -131,7 +131,7 @@ static void panic_stack(StackType_t *start_stk, StackType_t *end_stk) * * @return none */ -static void panic_info(void *frame, int wdt) +static __attribute__((noreturn)) void panic_info(void *frame, int wdt) { extern int _chip_nmi_cnt; @@ -210,7 +210,7 @@ static void panic_info(void *frame, int wdt) while (1); } -void IRAM_ATTR panicHandler(void *frame, int wdt) +void __attribute__((noreturn)) panicHandler(void *frame, int wdt) { int cnt = 10; @@ -220,13 +220,10 @@ void IRAM_ATTR panicHandler(void *frame, int wdt) REG_WRITE(INT_ENA_WDEV, 0); } - // for panic the function that disable cache - Cache_Read_Enable_New(); - panic_info(frame, wdt); } -void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression) +void __attribute__((noreturn)) _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression) { printf("ESP_ERROR_CHECK failed: esp_err_t 0x%x at %p\n", rc, __builtin_return_address(0)); printf("file: \"%s\" line %d\nfunc: %s\nexpression: %s\n", file, line, function, expression); diff --git a/components/freertos/port/esp8266/port.c b/components/freertos/port/esp8266/port.c index 2cb5e2aa..c4469053 100644 --- a/components/freertos/port/esp8266/port.c +++ b/components/freertos/port/esp8266/port.c @@ -315,7 +315,7 @@ int xPortInIsrContext(void) return _xt_isr_status != 0; } -void __attribute__((weak)) vApplicationStackOverflowHook(xTaskHandle xTask, const char *pcTaskName) +void __attribute__((weak, noreturn)) vApplicationStackOverflowHook(xTaskHandle xTask, const char *pcTaskName) { int *p = NULL; diff --git a/components/freertos/port/esp8266/xtensa_vectors.S b/components/freertos/port/esp8266/xtensa_vectors.S index 1d23c7cb..1dcc2060 100644 --- a/components/freertos/port/esp8266/xtensa_vectors.S +++ b/components/freertos/port/esp8266/xtensa_vectors.S @@ -1421,6 +1421,7 @@ nmi_rfi: #endif #endif /* NMI */ + .global Cache_Read_Enable_New .global _xt_ext_panic .type _xt_ext_panic, @function .align 4 @@ -1477,7 +1478,10 @@ _panic_dump_reg: s32i a0, sp, XT_STK_A0 + call0 Cache_Read_Enable_New + //Call panic handler mov a2, sp movi a3, 0 - call0 panicHandler + movi a0, panicHandler + callx0 a0