How to use ESP32's second core


#1

Hello!
I’m new to Zerynth, started yesterday, i’m using it on my ESP32. My question is:
Is it possible to use the second core of the microcontroller with Zerynth? I didn’t find anything about it in the docs.
Because you can do it easyly on the FreeRTOS, just select which processor shall manage the task during in the task creation. This resource is quite useful. Without attaching a core to a task, only the default core will be used, and this is a loss of potential.


#2

Hi @Robson_Gama,

at the moment the Zerynth VM runs only on the first core, so Python threads can be started only on that core.
Also C threads created using the Zerynth Operating System abstraction layer (VOS) runs on the first core.

On the other hand you could try hybrid C/Python, creating threads directly using ESP-IDF FreeRTOS APIs and placing them on the core you prefer, but I would avoid such a procedure since it makes the code not portable and could cause unexpected conflicts if not properly managed.


#3

Thanks!

I’m going to try the C / Python approach using the two cores, sounds interesting.
I think a good idea is to give a different “job” to each core, as example one dealing with Communications and the other running Sensors Tasks. This way i can might be able to avoid most conflicts.

But i wonder if Zerynth team is planning on developing support for the second core? I would really appreciate that.