Code: Select all
void esp_task_wdt_isr_user_handler(void)
{
ets_printf("\n\n\nABCDEFG\n\n\n");
ets_delay_us(10000);
}
Code: Select all
void esp_task_wdt_isr_user_handler(void)
{
ets_printf("\n\n\nABCDEFG\n\n\n");
ets_delay_us(10000);
}
Code: Select all
extern "C" void esp_task_wdt_isr_user_handler(void)
{
ets_printf("lol\r\n");
}
All right, this (very useful) information about tasks state in TWDT is a good feature!ESP_Sprite wrote: ↑Wed May 15, 2019 7:07 amIt's because c/cpp files will be left out entirely if they don't contain any symbols that are unresolved, and the linker sees the availability of a 'weak' function as 'resolved'. Solution is to create a symbol in the c file somehow (e.g. void wdt_handler_dummy_symbol { }) and then add ing a linker flag to force it as unresolved (in component.mk. add -COMPONENT_ADD_LDFLAGS += u wdt_handler_dummy_symbol)
EDIT: Also, sorry, the information about what tasks did or did not reset the watchdog is not currently propagated to the callback.
I only need to save it in variable to AFTER reboot, log. Please, tell me if this can interfere in something.ESP_Sprite wrote: ↑Thu May 16, 2019 2:02 amNot really... usually, when a stack overflow happens, it is detected after the fact and random data from other tasks or the OS already has been overwritten. This means the stability of the system can't be relied upon anymore and it would not be a smart idea to do complicated stuff like uploading logs. Instead, I'd suggest you just allow the ESP32 to crash but to configure the panic handler in such a way that it writes a core dump to flash. Then, after the reboot, detect that the core dump is there and upload it to a server.
Code: Select all
volatile RTC_NOINIT_ATTR int16_t lt_sys_reset;//Global var
RTC_NOINIT_ATTR char lt_sys_tsk_ovf[16];//Global var
extern "C" void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName )
{
snprintf(lt_sys_tsk_ovf, 16, "%s", pcTaskName);
lt_sys_reset = 21;
ets_printf("***ERROR*** A stack overflow in task ");
ets_printf((char *)pcTaskName);
ets_printf(" has been detected.\r\n");
abort();
}
Users browsing this forum: No registered users and 154 guests