How can I use core 1 to assign work to core 0 #10434
Replies: 2 comments 18 replies
-
Surprised I do not have a reply yet, so i have this dumb hack solution, I really hope I do not have a EMI issue with this case that will SUCK... Sadly this is still a interrupt so it will stop other work from being done, should only be a issue if core 0 is reading a DHT22 sensor... but since the results are not time sensitive that is not a issue if i have to re-poll the sensor once and a while but i can store a assignment in a variable toggle the pin triggering the interrupt then core0 will do the work i want when i want it done
|
Beta Was this translation helpful? Give feedback.
-
To answer the general question -- if you want to make the second core trigger asyncio tasks in the first core, then asyncio.ThreadSafeFlag is what you need.
@GM-Script-Writer-62850 can you provide a reference or background for this? I feel like I keep hearing this repeated but haven't been able to get anyone to demonstrate a repro for this (since we fixed stuff several months ago).
Just to clarify because despite the "Nope." from @cve2022 it seems like you're agreeing. On the rp2040 there is two cores, and one thread per core (i.e. you may optionally create one additional thread). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Note that CPU cores are
[0,1]
running on a W5500_EVB_PICOI would like to have core 1 doing time sensitive polling work using
_thread
When core 1 finds work I want to send it to core 0 where core 0 is using uasyncio, i know
_thread
is buggy so i want to keep it simple core running on core 1 and let core 0 do the fancy stuffI was trying to use interrupts on core 0 and i am having a lot of issues with switch bounce and EMI, so i am just going to use polling ever ms, dealing with switch bounce is one thing but EMI...
Beta Was this translation helpful? Give feedback.
All reactions