FreeRTOS, dual-core, two task, ...to slow
Posted: Wed Mar 20, 2019 2:54 am
A question about the FreeRTOS and dual-core function:
I want to realize a fast loop function that should run in a core. All other side functions should run non-time critical in the other core. I have two tasks, one in each core.
After a few attempts, I did not succeed in realizing this because each task requires a delay(x) with x >= 1ms for the FreeRTOS system. Despite many attempts ... e.g. (esp_task_wdt_add (NULL); esp_task_wdt_reset ();) instead of delay(x) in aCore ... nothing makes me run a fast loop
Is it therefore impossible to use it e.g. to run a program loop faster than 1kHz without crashing?
while (1) {
for (i = 0; i <1000; i ++)
digitalWrite (pin, HIGH);
for (i = 0; i <1000; i ++)
digitalWrite (pin, LOW);
}
This is of course just an example with the pin, it should then run a measurement program there, but please with about 20kHz and not <1kHz... with a DSO you can see the breaks on the pin.
How can I realize this? I want to use one task in each core, or does this work only if I use only one core for everything, without a task?
I like the ESP32 with its many possibilities and its performance, hopefully not only on paper ....
Thanks for suggestions.
I want to realize a fast loop function that should run in a core. All other side functions should run non-time critical in the other core. I have two tasks, one in each core.
After a few attempts, I did not succeed in realizing this because each task requires a delay(x) with x >= 1ms for the FreeRTOS system. Despite many attempts ... e.g. (esp_task_wdt_add (NULL); esp_task_wdt_reset ();) instead of delay(x) in aCore ... nothing makes me run a fast loop
Is it therefore impossible to use it e.g. to run a program loop faster than 1kHz without crashing?
while (1) {
for (i = 0; i <1000; i ++)
digitalWrite (pin, HIGH);
for (i = 0; i <1000; i ++)
digitalWrite (pin, LOW);
}
This is of course just an example with the pin, it should then run a measurement program there, but please with about 20kHz and not <1kHz... with a DSO you can see the breaks on the pin.
How can I realize this? I want to use one task in each core, or does this work only if I use only one core for everything, without a task?
I like the ESP32 with its many possibilities and its performance, hopefully not only on paper ....
Thanks for suggestions.