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

Pi Pico (second core) ? #15

Open
g0730n opened this issue Feb 10, 2024 · 3 comments
Open

Pi Pico (second core) ? #15

g0730n opened this issue Feb 10, 2024 · 3 comments

Comments

@g0730n
Copy link

g0730n commented Feb 10, 2024

Is there any way to add functionality for tasks to run on second core of Pi Pico?

@Rybec
Copy link
Owner

Rybec commented Feb 10, 2024

Sadly, CircuitPython does not have any kind of multi-core functionality, so there is not. If you are working in MicroPython, it might be possible to do that manually, by making a task that runs code on the second core and then periodically checks in with that code and handles communication for it. Note though, that this does not officially support MicroPython, so if you run into issues, it's up to you to figure them out. (That said, I've helped out people working into MicroPython before, and I don't mind it if you open an issue for a problem found in MicroPython. Just understand that I can't guarantee that I'll fix it. I may instead just mention incompatibilities in the documentation or suggest alterations you could make to fix the issue. I just don't have the time to maintain two separate ports.)

If at some point CircuitPython adds this functionality, I may provide some way to use it in pyRTOS, but I'm not certain it is necessary. It shouldn't be very difficult to do what I suggested above, making a task that runs a function on another core and then communicates with that function through some shared variable. You would want to use Python's built-in mutex locks though, as the pyRTOS locks rely on the single threaded nature of CircuitPython to avoid race conditions within the locks themselves.

@g0730n
Copy link
Author

g0730n commented Feb 11, 2024

Okay just checking. I haven't tried circuit python, or tested pyRTOS yet but will test it on my pico with micropython, thanks!

@Rybec
Copy link
Owner

Rybec commented Feb 11, 2024

You may have issues with some timing functions, as MicroPython doesn't support all of the same ones as CircuitPython (last time I checked, anyhow...). See issue #9 for some potential solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants