Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp_rom_delay_us crash and log show ets_delay_us in ROM (IDFGH-14299) #15090

Closed
3 tasks done
MATACE opened this issue Dec 25, 2024 · 2 comments
Closed
3 tasks done

esp_rom_delay_us crash and log show ets_delay_us in ROM (IDFGH-14299) #15090

MATACE opened this issue Dec 25, 2024 · 2 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@MATACE
Copy link

MATACE commented Dec 25, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.3.1

Espressif SoC revision.

ESP32-S3 (QFN56) (revision v0.2)

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32-WROOM-S

Power Supply used.

USB

What is the expected behavior?

esp_rom_delay_us can be normal microsecond delay

What is the actual behavior?

0x40041a79: ets_delay_us in ROM
0x42008f15: app_main at F:/CodeProject/ESP32/IDF_LVGL/main/main.c:99
0x4201c497: main_task at F:/SsdSofawareInstall/ESP32_IDF/Espressif/frameworks/esp-idf-v5.3.1/components/freertos/app_startup.c:208
0x4037af79: vPortTaskWrapper at F:/SsdSofawareInstall/ESP32_IDF/Espressif/frameworks/esp-idf-v5.3.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

E (50312) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:E (50312) task_wdt: - IDLE0 (CPU 0)
E (50312) task_wdt: Tasks currently running:
E (50312) task_wdt: CPU 0: main
E (50312) task_wdt: CPU 1: IDLE1
E (50312) task_wdt: Print CPU 0 (current core) backtrace

esp_rom_delay_us crash: ets_delay_us in ROM

Steps to reproduce.

code like this:

static int delay_ms[3] = {10, 20, 30};

void delay_test(void *args)
{
int i = 0;

while (1)
{
    esp_rom_delay_us(delay_ms[i] * 1000);
    i++;
    if (i == 3) {
        i = 0;
    }
}

}

void app_main(void)
{
.....
.....
xTaskCreate(delay_test, "delay_test", 4096, NULL, 5, NULL);
.....
}

Debug Logs.

E (40312) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:E (40312) task_wdt:  - IDLE0 (CPU 0)
E (40312) task_wdt: Tasks currently running:
E (40312) task_wdt: CPU 0: main
E (40312) task_wdt: CPU 1: IDLE1
E (40312) task_wdt: Print CPU 0 (current core) backtrace


Backtrace: 0x4200B707:0x3FC94440 0x4200BB24:0x3FC94460 0x4037732D:0x3FC94490 0x40041A79:0x3FC99410 0x42008F15:0x3FC99430 0x4201C497:0x3FC99450 0x4037AF79:0x3FC99480
0x4200b707: task_wdt_timeout_handling at F:/SsdSofawareInstall/ESP32_IDF/Espressif/frameworks/esp-idf-v5.3.1/components/esp_system/task_wdt/task_wdt.c:434
0x4200bb24: task_wdt_isr at F:/SsdSofawareInstall/ESP32_IDF/Espressif/frameworks/esp-idf-v5.3.1/components/esp_system/task_wdt/task_wdt.c:507
0x4037732d: _xt_lowint1 at F:/SsdSofawareInstall/ESP32_IDF/Espressif/frameworks/esp-idf-v5.3.1/components/xtensa/xtensa_vectors.S:1240
0x40041a79: ets_delay_us in ROM
0x42008f15: app_main at F:/CodeProject/ESP32/IDF_LVGL/main/main.c:99
0x4201c497: main_task at F:/SsdSofawareInstall/ESP32_IDF/Espressif/frameworks/esp-idf-v5.3.1/components/freertos/app_startup.c:208
0x4037af79: vPortTaskWrapper at F:/SsdSofawareInstall/ESP32_IDF/Espressif/frameworks/esp-idf-v5.3.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

More Information.

No response

@MATACE MATACE added the Type: Bug bugs in IDF label Dec 25, 2024
@github-actions github-actions bot changed the title esp_rom_delay_us crash and log show ets_delay_us in ROM esp_rom_delay_us crash and log show ets_delay_us in ROM (IDFGH-14299) Dec 25, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 25, 2024
@suda-morris
Copy link
Collaborator

Because you created a task that never yield the CPU (the task is stuck in an infinite loop).

https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/system/wdts.html#task-watchdog-timer-twdt

@ESP-Marius
Copy link
Collaborator

As already explained by @suda-morris, this is expected behavior, if you busy-wait (which is what esp_rom_delay_us does) then the WDT will indeed trigger as it is intended to do.

If you want delays that actually yield the task and let the other tasks (and IDLE) run then please take a look at vTaskDelay

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants