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

feat(threads): multicore support #397

Merged
merged 14 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 51 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ embassy-usb = { version = "0.3", default-features = false }
embedded-hal = { version = "1.0.0", default-features = false }
embedded-hal-async = { version = "1.0.0", default-features = false }

esp-alloc = { git = "https://github.com/kaspar030/esp-hal", branch = "for-riot-rs-2024-10-16-0.21.1", default-features = false }
esp-hal = { git = "https://github.com/kaspar030/esp-hal", branch = "for-riot-rs-2024-10-16-0.21.1", default-features = false }
esp-hal-embassy = { git = "https://github.com/kaspar030/esp-hal", branch = "for-riot-rs-2024-10-16-0.21.1", default-features = false }
esp-alloc = { git = "https://github.com/kaspar030/esp-hal", branch = "for-riot-rs-2024-10-16-0.21.1+pr2377", default-features = false }
esp-hal = { git = "https://github.com/kaspar030/esp-hal", branch = "for-riot-rs-2024-10-16-0.21.1+pr2377", default-features = false }
esp-hal-embassy = { git = "https://github.com/kaspar030/esp-hal", branch = "for-riot-rs-2024-10-16-0.21.1+pr2377", default-features = false }
esp-println = "0.11.0"
esp-wifi = { git = "https://github.com/kaspar030/esp-hal", branch = "for-riot-rs-2024-10-16-0.21.1", default-features = false }
esp-wifi = { git = "https://github.com/kaspar030/esp-hal", branch = "for-riot-rs-2024-10-16-0.21.1+pr2377", default-features = false }

linkme = { version = "0.3.21", features = ["used_linker"] }

Expand All @@ -104,6 +104,7 @@ once_cell = { version = "=1.19.0", default-features = false, features = [
"critical-section",
] }
paste = { version = "1.0" }
rp-pac = { version = "6.0", default-features = false }
static_cell = { version = "2.0.0", features = ["nightly"] }

[profile.dev]
Expand Down
1 change: 1 addition & 0 deletions examples/laze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ subdirs:
- random
- threading
- threading-channel
- threading-multicore
- usb-serial
11 changes: 11 additions & 0 deletions examples/threading-multicore/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "threading-multicore"
version = "0.1.0"
authors = ["Elena Frank <elena.frank@proton.me>"]
edition.workspace = true
license.workspace = true
publish = false

[dependencies]
riot-rs = { path = "../../src/riot-rs", features = ["core-affinity"] }
riot-rs-boards = { path = "../../src/riot-rs-boards" }
15 changes: 15 additions & 0 deletions examples/threading-multicore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# threading multicore

## About

This application demonstrates basic threading on multicore.
elenaf9 marked this conversation as resolved.
Show resolved Hide resolved

## How to run

In this folder, run

laze build -b rpi-pico run

The application will start two threads that each print their ID and the core that they are running on, before
entering a busy loop.
The thread that is started first in pinned to Core 1 using core affinities.
6 changes: 6 additions & 0 deletions examples/threading-multicore/laze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apps:
- name: threading-multicore
selects:
- ?release
- sw/threading
- multi-core
Loading
Loading