Page 1 of 1

esp32 0x8 (TG1WDT_SYS_RESET)问题

Posted: Mon Oct 30, 2023 1:17 pm
by Swiper_witty
硬件:ESP32-WROOM-32
idf:4.5.
使用freertos历程配置
会重启,报错
0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

代码如下

Code: Select all

/* FreeRTOS Example

*/

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "freertos/event_groups.h"
#include "freertos/queue.h"

#include "esp_task_wdt.h" 
#include "esp_err.h"
#include "esp_log.h"
#include "nvs_flash.h"

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

void test_task(void *pvParam)
{
    int num = 0;
    while (1)
    {
        num++;
        num *= 1;
        if (num > 1000000 && ((num / 10) % 2) == 1)
        {
            ESP_LOGI("test_task FUN", "doing : %d", num++);
            num = 0;
        }

    }
    
}

void Main_Init(void);
void Build_task(void);
void app_main(void)
{
    Main_Init();
    Build_task();

    char *temp_array;
        temp_array = malloc(300);
    while (1)
    {
        vTaskList(temp_array);
        printf("-------------------------------------------------->\n");
        printf(" Name          state   Priority  task    num\n");
        printf("%s \n",temp_array);
        vTaskDelay(pdMS_TO_TICKS(3000));
    }
}

TaskHandle_t test_taskhanlde;
void Build_task(void)
{

    test_taskhanlde = NULL;
    xTaskCreate(test_task, "test task", 4096, NULL, 1, &test_taskhanlde);

}

void Main_Init(void)
{
    // Allow other core to finish initialization
    vTaskDelay(pdMS_TO_TICKS(100));

}

出现下面的报错

Code: Select all

I (5060) test_task FUN: doing : 1000010
E (10492) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (10492) task_wdt:  - IDLE (CPU 1)
E (10492) task_wdt: Tasks currently running:
E (10492) task_wdt: CPU 0: IDLE
E (10492) task_wdt: CPU 1: test task
E (10492) task_wdt: Aborting.
大佬帮忙看看,感谢!
:D :D :D

Re: esp32 0x8 (TG1WDT_SYS_RESET)问题

Posted: Wed Nov 01, 2023 12:22 pm
by Swiper_witty
好像知道了,是test task造成的,他一直在while,没有vtaskdelay来释放,一直进不到idle去喂狗,所以被重启了,解决方法是吧这个任务放到core 1,然后把core 1的看门狗关掉,就正常了。