Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use The ESP32 second core? #8197

Open
Tangerino opened this issue Jan 21, 2022 · 3 comments
Open

How to use The ESP32 second core? #8197

Tangerino opened this issue Jan 21, 2022 · 3 comments

Comments

@Tangerino
Copy link

Is it possible to attach a function to a second core to handle critical conditions?

@dpgeorge
Copy link
Member

See #7258 for a related discussion. That is now resolved by 3570785, MicroPython now runs on core 1 (the second core).

@Tangerino
Copy link
Author

I'm sorry but did not get your point.

I have a time critical process and wish to run it in the second core so I can handle sec events.
Like _thread.new_thread(core=2, f=func)

Thank you

@mocleiri
Copy link
Contributor

mocleiri commented Feb 3, 2022

You can´t do it in micropython itself but you can configure other FreeRTOS tasks and set the core there. Then you would communicate between your new tasks and a module in micropython.

For example the machine_i2s implementation has a non-blocking mode where a new FreeRTOS task is created and runs beside micropython and uses a queue to send data back into micropython.

if (xTaskCreatePinnedToCore(

In this case the helper task is running on the same core but that MP_TASK_COREID can be changed to refer to the other core.

tannewt added a commit to tannewt/circuitpython that referenced this issue Aug 24, 2023
…-s3-box-psram

8.2.x backport: Fix PSRAM on espressif ESP32S3 box and box lite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants