Skip to content

Commit

Permalink
feat(threads): multicore support (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
elenaf9 authored Oct 24, 2024
2 parents fb10fa9 + f3a9507 commit 5d81b43
Show file tree
Hide file tree
Showing 29 changed files with 902 additions and 119 deletions.
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.

## 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

0 comments on commit 5d81b43

Please sign in to comment.