You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying out the dev/lvgl branch, I was running into issues with the motor task seeming to get starved - it would feel quite 'crunchy' on the fine detents demo, and some printf debugging showed the main task loop was dropping to take 1.8-2ms averaged over a thousand loops, rather than the expected ~1ms.
After a lot of playing around with priorities and reading ESP-IDF docs on scheduling to try to understand how extra UI work on core0 could affect the motor task pinned to core1, it turned out to be the delay(1).
My reading of the ESP-IDF FreeRTOS docs on scheduling is that high load on Core0 will actually interfere with resolving timers accurately, so the motor task's delay(1) takes much more than a millisecond to resolve some of the time.
Trying out the dev/lvgl branch, I was running into issues with the motor task seeming to get starved - it would feel quite 'crunchy' on the fine detents demo, and some printf debugging showed the main task loop was dropping to take 1.8-2ms averaged over a thousand loops, rather than the expected ~1ms.
After a lot of playing around with priorities and reading ESP-IDF docs on scheduling to try to understand how extra UI work on core0 could affect the motor task pinned to core1, it turned out to be the delay(1).
My reading of the ESP-IDF FreeRTOS docs on scheduling is that high load on Core0 will actually interfere with resolving timers accurately, so the motor task's delay(1) takes much more than a millisecond to resolve some of the time.
Workaround/solution: using
delayMicroseconds(1000)
in place ofdelay(1)
, as this is implemented as a busy loop: https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-misc.c#L206 so doesn't get affected by Core0 load. Surprisingly, the watchdog idle task still seems happy.All testing on a Lilygo T-Micro32 Plus.
The text was updated successfully, but these errors were encountered: