In my ESP32-S3 code I noticed that in my main loop I have to add `vTaskDelay(1)` otherwise I get a wdt reset.
I guess this is because if I don't suspend for a while my thread, the others cannot run.
Since `CONFIG_FREERTOS_HZ` is defined as 100, a delay of just 1 tick is 10 ms, too much!
Is there a way to suspend a task for less than a tick?
What may happen if I change that value to 1000? I mean, something bad can happen like UART or other timing-critical stuff?
vTaskDelay below 10 ms
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: vTaskDelay below 10 ms
Mostly, the overhead of FreeRTOS is increased as its task switching code is called 10x more often. You're probably better off solving whatever issue you have in another way, though; isn't there a peripheral that can do what you want without involving the CPU too much?
-
- Posts: 1733
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: vTaskDelay below 10 ms
Or, generally, try to use blocking function calls (mostly those whith a TickType_t maxwait parameter); and possibly create multiple tasks which can each handle different things and which block 'concurrently'.
-
- Posts: 168
- Joined: Sun May 22, 2022 2:42 pm
Re: vTaskDelay below 10 ms
This might be interesting for you: https://github.com/mickeyl/esp-microsleep
Who is online
Users browsing this forum: No registered users and 60 guests