esp_task_wdt_print_triggered_tasks() function
Prints or retrieves information about tasks/users that triggered the Task Watchdog Timeout. This function provides various operations to handle tasks/users that did not reset the Task Watchdog in time. It can print detailed information about these tasks/users, such as their names, associated CPUs, and whether they have been reset. Additionally, it can retrieve the total length of the printed information or the CPU affinity of the failing tasks.
Arguments
msg_handler
Optional message handler function that will be called for each printed line.
opaque
Optional pointer to opaque data that will be passed to the message handler function.
cpus_fail
Optional pointer to an integer where the CPU affinity of the failing tasks will be stored.
Return value
- ESP_OK: The function executed successfully. - ESP_FAIL: No triggered tasks were found, and thus no information was printed or retrieved.
Notes
- If `msg_handler` is not provided, the information will be printed to console using ESP_EARLY_LOGE. - If `msg_handler` is provided, the function will send the printed information to the provided message handler function. - If `cpus_fail` is provided, the function will store the CPU affinity of the failing tasks in the provided integer. - During the execution of this function, logging is allowed in critical sections, as TWDT timeouts are considered fatal errors.
![]()
if (esp_task_wdt_print_triggered_tasks(NULL, NULL, &cpus_fail) != ESP_OK) {
esp_task_wdt_print_triggered_tasks() is called by 1 function and calls 6 functions:
![]()
esp_task_wdt_print_triggered_tasks()
esp_task_wdt_print_triggered_tasks() reads 7 variables:
![]()
esp_task_wdt_print_triggered_tasks()