#S3 multicore support in circuitpython?

1 messages · Page 1 of 1 (latest)

wraith viper
#

Next challenge for my project is to get multicore support spun up on my s3 core. I have i2c measurement boards running nicely and posting data to a remote backend. I want to get a web server up now and would like to have that on the second core, but finding very little information. Can anyone point me towards a good resource / examples?

flint plume
#

Circuitpython doesn't run multiple threads and can't use multicore in python

wraith viper
#

Thanks for the clarification. I will have to think this through carefully for next steps then.

flint plume
#

CP is on core 1 on ESP, and I believe that it means that some ESP background network code is already running on the other core, but I don't actually know (and that doesn't make the Circuitpython network code less blocking)
there is a desire to allow some network stuff to be non-blocking, or at least async-compatible, which might end up profiting from multicore performances

#

but not the python code itself

chrome nymph
#

I don't know if it's event technically possible, and if it were what the size of the task would be, but an idea that I'd find very interesting is to take a 2 core device like an RP2040 where the second core is idle when running CP, and find some way to run an arduino sketch on it.
The big bugaboo monster with that is memory management. The RP2040 doesn't have an MMU, so it'd take real care to ensure that CP and the sketch don't tread on each other's toes.

raw token
#

That might be one of the easist ways to enable using a second core... allow user to deisignate (e.g., settings.toml) some memory to block off from CP so it could be used by the other core. Maybe also a block or some method for IPC. Not sure how PIO does things.

flint plume
wraith viper
#

My actual usecase is forgiving of realtime enough to hopefully make it viable. The webserver should be very lightweight for configuring the measurements, so when the webserver is active it can considered to be session configuration, so as long as sessions run reasonable I will ok. I will creep towards something. Greatly appreciate each and every comment.