Tick time when ESP-IDF is built under Arduino
Posted: Sat Oct 02, 2021 3:16 pm
As indicated in this topic, we have a lump of code which works fine under ESP-IDF native but is unstable when built under Arduino ESP32.
One of the clear differences between the two is the tick time: 10 ms under ESP-IDF native and 1 ms under Arduino ESP32.
I have a test which runs around a loop 100 times sending a message to two queues at the end of which are two tasks: on ESP-IDF native this test has never failed, on Arduino ESP32 I get no more prints back from the target after the loop begins running. The tasks at the end of the queues do nothing other than each set a global that I can check once the test has completed; no debug prints, nothing heavy. Yet if I add a few milliseconds of RTOS delay (vTaskDelay(2000/portTICK_PERIOD_MS)) in the loop it passes fine under Arduino ESP32.
Questions:
1. Is there a reason why ESP-IDF uses 10 ms as its tick, rather than the more conventional 1ms?
2. Is there a reason why the sdkconfig for Arduino sets it to 1ms? Since Arduino does not use task-like things itself it seems a strange change to make.
3. If I set the sdkconfig under Arduino to use 10ms will that actually propagate into the build, given that the ESP-IDF code is a pre-built .a file?
One of the clear differences between the two is the tick time: 10 ms under ESP-IDF native and 1 ms under Arduino ESP32.
I have a test which runs around a loop 100 times sending a message to two queues at the end of which are two tasks: on ESP-IDF native this test has never failed, on Arduino ESP32 I get no more prints back from the target after the loop begins running. The tasks at the end of the queues do nothing other than each set a global that I can check once the test has completed; no debug prints, nothing heavy. Yet if I add a few milliseconds of RTOS delay (vTaskDelay(2000/portTICK_PERIOD_MS)) in the loop it passes fine under Arduino ESP32.
Questions:
1. Is there a reason why ESP-IDF uses 10 ms as its tick, rather than the more conventional 1ms?
2. Is there a reason why the sdkconfig for Arduino sets it to 1ms? Since Arduino does not use task-like things itself it seems a strange change to make.
3. If I set the sdkconfig under Arduino to use 10ms will that actually propagate into the build, given that the ESP-IDF code is a pre-built .a file?