Enabling WiFi and EVE2 display leads to trigger WDT

I’m writing a firmware for ESP32-S3 and I have problems using the WiFi with an EVE2 display (NHD-7.0-800480FT-CSXV-CTP). I tried to setup a minimal code to reproduce the issue.

#include <stdio.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <esp_log.h>
#include <nvs_flash.h>

static const char *TAG = "SYS";

void app_main(void)
{
  esp_err_t ret = nvs_flash_init();
  if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
  {
    ESP_ERROR_CHECK(nvs_flash_erase());
    ret = nvs_flash_init();
  }

  //Display_Init();
  Network_Init();

  while (1)
  {
    //Display_Fsm();

    ESP_LOGI(TAG, ".");
    vTaskDelay(pdMS_TO_TICKS(100));
  }
}

here the network functions:

int retry = 0;
EventGroupHandle_t eventGroup;

static void event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data)
{
    if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) esp_wifi_connect();
    else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) 
    {
        if (retry < EXAMPLE_ESP_MAXIMUM_RETRY) 
        {
            esp_wifi_connect();
            retry++;
            ESP_LOGI(TAG, "retry to connect to the AP");
        } 
        else 
        {
            xEventGroupSetBits(eventGroup, WIFI_FAIL_BIT);
            ESP_LOGW(TAG,"connect to the AP fail");
        }
    } 
    else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) 
    {
        ip_event_got_ip_t* event = (ip_event_got_ip_t*) event_data;
        ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip));
        retry = 0;
        xEventGroupSetBits(eventGroup, WIFI_CONNECTED_BIT);
    }
}

void Network_Init(void)
{
    ESP_ERROR_CHECK(esp_netif_init());
    eventGroup = xEventGroupCreate();
    ESP_ERROR_CHECK(esp_event_loop_create_default());
    esp_netif_create_default_wifi_sta();

    wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
    ESP_ERROR_CHECK(esp_wifi_init(&cfg));

    esp_event_handler_instance_t instance_any_id;
    esp_event_handler_instance_t instance_got_ip;
    ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL, &instance_any_id));
    ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &event_handler, NULL, &instance_got_ip));

    wifi_config_t wifi_config = 
    {
        .sta = 
        {
            .ssid = EXAMPLE_ESP_WIFI_SSID,
            .password = EXAMPLE_ESP_WIFI_PASS,
            .threshold.authmode = WIFI_AUTH_WPA2_PSK,
            //.sae_pwe_h2e = ESP_WIFI_SAE_MODE,
            //.sae_h2e_identifier = EXAMPLE_H2E_IDENTIFIER,
        },
    };
    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
    ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config));
    ESP_ERROR_CHECK(esp_wifi_start());

    ESP_LOGI(TAG, "wifi_init_sta finished.");
}

here the display functions:

void Display_Init(void)
{
    EVE_init_spi();
    EVE_init();

    // Draw static stuff and save to G-RAM
    EVE_cmd_inflate(MEM_LOGO, LOGO_SMALL, sizeof(LOGO_SMALL)); 
    drawStaticHeader();
    drawStaticPageMain();
    drawStaticPageAdvanced();
}

void Display_Fsm(void)
{
    ESP_LOGI(LOG, "!");
    handleTouch();
    displayListBegin();
    appendFromRam(MEM_DL_HEADER, num_dl_static_header);
    appendFromRam(MEM_DL_PAGE_MAIN, num_dl_static_page_main);
    drawTopBar();
    drawTopButtons();
    drawGloveStatus();
    drawNavigationButtons();
    displayListEnd();
}

The draw functions are quite long, I don’t know if I need to post them all.
Anyway, here the description of the issue:

  1. if I run the display functions only all works fine: the display is updated correctly and I see the . and ! debug symbols on the terminal

  2. if I run the network functions only all works fine: I see the . symbol and the WiFi connections debug strings

  3. if I enable both functions, the display is updated few times, then when the WiFi is activated

Here the output:

I (1162) wifi:wifi driver task: 3fcac798, prio:23, stack:3584, core=0
I (1172) wifi:wifi firmware version: 1160f50
I (1172) wifi:wifi certification version: v7.0
I (1172) wifi:config NVS flash: enabled
I (1172) wifi:config nano formating: disabled
I (1172) wifi:Init data frame dynamic rx buffer num: 32
I (1172) wifi:Init static rx mgmt buffer num: 5
I (1172) wifi:Init management short buffer num: 32
I (1172) wifi:Init dynamic tx buffer num: 32
I (1172) wifi:Init static tx FG buffer num: 2
I (1172) wifi:Init static rx buffer size: 1600
I (1172) wifi:Init static rx buffer num: 10
I (1172) wifi:Init dynamic rx buffer num: 32
I (1172) wifi_init: rx ba win: 6
I (1172) wifi_init: tcpip mbox: 32
I (1172) wifi_init: udp mbox: 6
I (1172) wifi_init: tcp mbox: 6
I (1172) wifi_init: tcp tx win: 5760
I (1172) wifi_init: tcp rx win: 5760
I (1172) wifi_init: tcp mss: 1440
I (1172) phy_init: phy_version 620,ec7ec30,Sep  5 2023,13:49:13
I (1212) wifi:mode : sta (24:58:7c:f4:96:30)
I (1212) wifi:enable tsf
I (1212) WIFI: wifi_init_sta finished.
I (1212) TFT: !
I (1222) wifi:new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1
I (1222) wifi:state: init -> auth (b0)
I (1222) SYS: .
I (1232) wifi:state: auth -> init (8a0)
I (1232) wifi:new:<6,0>, old:<6,0>, ap:<255,255>, sta:<6,0>, prof:1
I (1232) WIFI: retry to connect to the AP
I (1322) TFT: !
I (1322) SYS: .
I (1422) TFT: !
I (1422) SYS: .
I (1522) TFT: !
I (1522) SYS: .
I (1622) TFT: !
I (1622) SYS: .
I (1722) TFT: !
I (3642) WIFI: retry to connect to the AP
I (3652) wifi:new:<6,0>, old:<6,0>, ap:<255,255>, sta:<6,0>, prof:1
I (3652) wifi:state: init -> auth (b0)
I (3652) wifi:state: auth -> assoc (0)
I (3662) wifi:state: assoc -> run (10)
I (3692) wifi:connected with mark, aid = 4, channel 6, BW20, bssid = 3c:a6:2f:38:34:07
I (3692) wifi:security: WPA2-PSK, phy: bgn, rssi: -72
I (3692) wifi:pm start, type: 1

I (3692) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us
I (3692) wifi:set rx beacon pti, rx_bcn_pti: 0, bcn_timeout: 25000, mt_pti: 0, mt_time: 10000
I (3702) wifi:<ba-add>idx:0 (ifx:0, 3c:a6:2f:38:34:07), tid:6, ssn:2, winSize:64
I (3792) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (4702) esp_netif_handlers: sta ip: 192.168.2.138, mask: 255.255.0.0, gw: 192.168.2.1
I (4702) WIFI: got ip:192.168.2.138
E (6722) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (6722) task_wdt:  - IDLE0 (CPU 0)
E (6722) task_wdt: Tasks currently running:
E (6722) task_wdt: CPU 0: main
E (6722) task_wdt: CPU 1: IDLE1
E (6722) task_wdt: Print CPU 0 (current core) backtrace


Backtrace: 0x4200CD47:0x3FC9AA60 0x4200D164:0x3FC9AA80 0x4037780D:0x3FC9AAB0 0x4037F248:0x3FCA59D0 0x42009D3B:0x3FCA59F0 0x42009185:0x3FCA5A10 0x42009580:0x3FCA5A30 0x4200840D:0x3FCA5A50 0x4207BD77:0x3FCA5A70 0x4037ED69:0x3FCA5AA0
0x4200cd47: task_wdt_timeout_handling at /home/mark/dev/esp-idf/components/esp_system/task_wdt/task_wdt.c:441
0x4200d164: task_wdt_isr at /home/mark/dev/esp-idf/components/esp_system/task_wdt/task_wdt.c:515
0x4037780d: _xt_lowint1 at /home/mark/dev/esp-idf/components/xtensa/xtensa_vectors.S:1240
0x4037f248: _frxt_dispatch at /home/mark/dev/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S:484
0x42009d3b: EVE_execute_cmd at /home/mark/firmware/components/FT800-FT813-5.x/src/EVE_commands.c:444
0x42009185: displayListBegin at /home/mark/firmware/main/tasks/task_display.c:725
0x42009580: Display_Task at /home/mark/firmware/main/tasks/task_display.c:118
0x4200840d: app_main at /home/mark/firmware/main/main.c:117
0x4207bd77: main_task at /home/mark/dev/esp-idf/components/freertos/app_startup.c:208
0x4037ed69: vPortTaskWrapper at /home/mark/dev/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

as you can see after few seconds all the debug symbols are not printed anymore and the wdt is triggered because is hangs inside:

void EVE_execute_cmd(void)
{
    while (EVE_busy() != E_OK)
    {
        taskYIELD();
    }
}

it does not depend on the functions I use to draw on the display.
I read the documentation about SPI master and I don’t see anything about conflicts with the WiFi.

Here the configuration of the display:

add_definitions(
    -DEVE_CS=GPIO_NUM_14
    -DEVE_PDN=GPIO_NUM_47
    -DEVE_SCK=GPIO_NUM_11
    -DEVE_MISO=GPIO_NUM_12
    -DEVE_MOSI=GPIO_NUM_13
    -DEVE_ROTATE=2
    -DEVE_BACKLIGHT_FREQ=1000
    -DEVE_BACKLIGHT_PWM=10
    -DEVE_NHD_70)

Is there anything that would prevent the use of the WiFi with the SPI master?

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật