-
Notifications
You must be signed in to change notification settings - Fork 12
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
threads: add support for RISC-V (esp32 only) #182
Conversation
This looks already very nice! |
This also supports the esp32c6 board now. I've merged the master without a rebase for now to include #181 but not destroy the history. I'll rebase properly before merge. |
Please squash & rebase! |
I think this is good to go, just one thing we need to find a solution for: threading conflicts use of wifi on esp32. So we'll need to model both in laze. I'll come up with sth. |
Preperation for riscv module, where setting up the stack requires access to the `ThreadData`.
023ad1a
to
465a3e3
Compare
This prevents conflicting with esp-wifi, which uses interrupt 3.
Done. Sorry for the many force-pushes, I accidentally merged to commits during rebase that shouldn't have been merged. |
👍 I'll open an issue for it once this is merged. Edit: #289. |
Thanks! |
Initial support for threading on RISCV.
For now this only supports the
esp32c3
andesp32c6
boards since we depend on specific features fromesp-hal
.Adding support for other esp boards can be done in follow up PRs.
Most of the changes are only within the new
riscv
module, but one general change I'd like to mention:threads.current_id
to the very first running thread is now done withinsched
when the thread actually starts running. Before, this was done already instart_threading
, but it caused some problems in the RISC-V implementation because then we couldn't differentiate between the thread running for the first time andcurrent_id == next_id
. I've tested on both arch'es and it still works with this change, so I think it should be alright?Note: I have not tested using threading and embassy tasks together. But we also don't have any examples that tested this for cortex-m, so I'd argue that it's out of scope for this PR. Wdyt?
Part of #157.