Skip to content

Commit 033d673

Browse files
authored
Merge branch 'main' into configurable-bank-support
2 parents 73f11d2 + af6f5ca commit 033d673

File tree

14 files changed

+71
-460
lines changed

14 files changed

+71
-460
lines changed

README.md

+48-43
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,55 @@
11
# Embassy
22

3-
Embassy is the next-generation framework for embedded applications. Write safe, correct and energy-efficient embedded code faster, using the Rust programming language, its async facilities, and the Embassy libraries.
3+
Embassy is the next-generation framework for embedded applications. Write safe, correct, and energy-efficient embedded code faster, using the Rust programming language, its async facilities, and the Embassy libraries.
4+
5+
## [Documentation](https://embassy.dev/book/index.html) - [API reference](https://docs.embassy.dev/) - [Website](https://embassy.dev/) - [Chat](https://matrix.to/#/#embassy-rs:matrix.org)
46

5-
## <a href="https://embassy.dev/book/index.html">Documentation</a> - <a href="https://docs.embassy.dev/">API reference</a> - <a href="https://embassy.dev/">Website</a> - <a href="https://matrix.to/#/#embassy-rs:matrix.org">Chat</a>
67
## Rust + async ❤️ embedded
78

8-
The Rust programming language is blazingly fast and memory-efficient, with no runtime, garbage collector or OS. It catches a wide variety of bugs at compile time, thanks to its full memory- and thread-safety, and expressive type system.
9+
The Rust programming language is blazingly fast and memory-efficient, with no runtime, garbage collector, or OS. It catches a wide variety of bugs at compile time, thanks to its full memory- and thread-safety, and expressive type system.
910

10-
Rust's <a href="https://rust-lang.github.io/async-book/">async/await</a> allows for unprecedentedly easy and efficient multitasking in embedded systems. Tasks get transformed at compile time into state machines that get run cooperatively. It requires no dynamic memory allocation, and runs on a single stack, so no per-task stack size tuning is required. It obsoletes the need for a traditional RTOS with kernel context switching, and is <a href="https://tweedegolf.nl/en/blog/65/async-rust-vs-rtos-showdown">faster and smaller than one!</a>
11+
Rust's [async/await](https://rust-lang.github.io/async-book/) allows for unprecedentedly easy and efficient multitasking in embedded systems. Tasks get transformed at compile time into state machines that get run cooperatively. It requires no dynamic memory allocation and runs on a single stack, so no per-task stack size tuning is required. It obsoletes the need for a traditional RTOS with kernel context switching, and is [faster and smaller than one!](https://tweedegolf.nl/en/blog/65/async-rust-vs-rtos-showdown)
1112

1213
## Batteries included
1314

14-
- **Hardware Abstraction Layers** - HALs implement safe, idiomatic Rust APIs to use the hardware capabilities, so raw register manipulation is not needed. The Embassy project maintains HALs for select hardware, but you can still use HALs from other projects with Embassy.
15-
- <a href="https://docs.embassy.dev/embassy-stm32/">embassy-stm32</a>, for all STM32 microcontroller families.
16-
- <a href="https://docs.embassy.dev/embassy-nrf/">embassy-nrf</a>, for the Nordic Semiconductor nRF52, nRF53, nRF54 and nRF91 series.
17-
- <a href="https://docs.embassy.dev/embassy-rp/">embassy-rp</a>, for the Raspberry Pi RP2040 and RP23xx microcontrollers.
18-
- <a href="https://docs.embassy.dev/embassy-mspm0/">embassy-mspm0</a>, for the Texas Instruments MSPM0 microcontrollers.
19-
- <a href="https://github.com/esp-rs">esp-rs</a>, for the Espressif Systems ESP32 series of chips.
20-
- Embassy HAL support for Espressif chips, as well as Async WiFi, Bluetooth and ESP-NOW, is being developed in the [esp-rs/esp-hal](https://github.com/esp-rs/esp-hal) repository.
21-
- <a href="https://github.com/ch32-rs/ch32-hal">ch32-hal</a>, for the WCH 32-bit RISC-V(CH32V) series of chips.
22-
- <a href="https://github.com/AlexCharlton/mpfs-hal">mpfs-hal</a>, for the Microchip PolarFire SoC.
23-
- <a href="https://github.com/py32-rs/py32-hal">py32-hal</a>, for the Puya Semiconductor PY32 series of microcontrollers.
24-
25-
- **Time that Just Works** -
26-
No more messing with hardware timers. <a href="https://docs.embassy.dev/embassy-time">embassy_time</a> provides Instant, Duration and Timer types that are globally available and never overflow.
27-
28-
- **Real-time ready** -
29-
Tasks on the same async executor run cooperatively, but you can create multiple executors with different priorities, so that higher priority tasks preempt lower priority ones. See the <a href="https://github.com/embassy-rs/embassy/blob/master/examples/nrf52840/src/bin/multiprio.rs">example</a>.
30-
31-
- **Low-power ready** -
32-
Easily build devices with years of battery life. The async executor automatically puts the core to sleep when there's no work to do. Tasks are woken by interrupts, there is no busy-loop polling while waiting.
33-
34-
- **Networking** -
35-
The <a href="https://docs.embassy.dev/embassy-net/">embassy-net</a> network stack implements extensive networking functionality, including Ethernet, IP, TCP, UDP, ICMP and DHCP. Async drastically simplifies managing timeouts and serving multiple connections concurrently.
15+
- **Hardware Abstraction Layers
16+
** - HALs implement safe, idiomatic Rust APIs to use the hardware capabilities, so raw register manipulation is not needed. The Embassy project maintains HALs for select hardware, but you can still use HALs from other projects with Embassy.
17+
- [embassy-stm32](https://docs.embassy.dev/embassy-stm32/), for all STM32 microcontroller families.
18+
- [embassy-nrf](https://docs.embassy.dev/embassy-nrf/), for the Nordic Semiconductor nRF52, nRF53, nRF54 and nRF91 series.
19+
- [embassy-rp](https://docs.embassy.dev/embassy-rp/), for the Raspberry Pi RP2040 and RP23xx microcontrollers.
20+
- [embassy-mspm0](https://docs.embassy.dev/embassy-mspm0/), for the Texas Instruments MSPM0 microcontrollers.
21+
- [esp-rs](https://github.com/esp-rs), for the Espressif Systems ESP32 series of chips.
22+
- Embassy HAL support for Espressif chips, as well as Async Wi-Fi, Bluetooth, and ESP-NOW, is being developed in the [esp-rs/esp-hal](https://github.com/esp-rs/esp-hal) repository.
23+
- [ch32-hal](https://github.com/ch32-rs/ch32-hal), for the WCH 32-bit RISC-V(CH32V) series of chips.
24+
- [mpfs-hal](https://github.com/AlexCharlton/mpfs-hal), for the Microchip PolarFire SoC.
25+
- [py32-hal](https://github.com/py32-rs/py32-hal), for the Puya Semiconductor PY32 series of microcontrollers.
3626

37-
- **Bluetooth**
38-
- The <a href="https://github.com/embassy-rs/trouble">trouble</a> crate provides a Bluetooth Low Energy 4.x and 5.x Host that runs on any microcontroller implementing the <a href="https://github.com/embassy-rs/bt-hci">bt-hci</a> traits (currently `nRF52`, `rp2040`, `rp23xx` and `esp32` and `serial` controllers are supported).
39-
- The <a href="https://github.com/embassy-rs/nrf-softdevice">nrf-softdevice</a> crate provides Bluetooth Low Energy 4.x and 5.x support for nRF52 microcontrollers.
40-
- The <a href="https://github.com/embassy-rs/embassy/tree/main/embassy-stm32-wpan">embassy-stm32-wpan</a> crate provides Bluetooth Low Energy 5.x support for stm32wb microcontrollers.
27+
- **Time that Just Works** -
28+
No more messing with hardware timers. [embassy_time](https://docs.embassy.dev/embassy-time) provides Instant, Duration, and Timer types that are globally available and never overflow.
29+
30+
- **Real-time ready** -
31+
Tasks on the same async executor run cooperatively, but you can create multiple executors with different priorities so that higher priority tasks preempt lower priority ones. See the [example](https://github.com/embassy-rs/embassy/blob/master/examples/nrf52840/src/bin/multiprio.rs).
4132

42-
- **LoRa** - The <a href="https://github.com/lora-rs/lora-rs">lora-rs</a> project provides an async LoRa and LoRaWAN stack that works well on Embassy.
33+
- **Low-power ready** -
34+
Easily build devices with years of battery life. The async executor automatically puts the core to sleep when there's no work to do. Tasks are woken by interrupts, there is no busy-loop polling while waiting.
35+
36+
- **Networking** -
37+
The [embassy-net](https://docs.embassy.dev/embassy-net/) network stack implements extensive networking functionality, including Ethernet, IP, TCP, UDP, ICMP, and DHCP. Async drastically simplifies managing timeouts and serving multiple connections concurrently.
38+
39+
- **Bluetooth**
40+
- The [trouble](https://github.com/embassy-rs/trouble) crate provides a Bluetooth Low Energy 4.x and 5.x Host that runs on any microcontroller implementing the [bt-hci](https://github.com/embassy-rs/bt-hci) traits (currently
41+
`nRF52`, `rp2040`, `rp23xx` and `esp32` and `serial` controllers are supported).
42+
- The [nrf-softdevice](https://github.com/embassy-rs/nrf-softdevice) crate provides Bluetooth Low Energy 4.x and 5.x support for nRF52 microcontrollers.
43+
- The [embassy-stm32-wpan](https://github.com/embassy-rs/embassy/tree/main/embassy-stm32-wpan) crate provides Bluetooth Low Energy 5.x support for stm32wb microcontrollers.
4344

44-
- **USB** -
45-
<a href="https://docs.embassy.dev/embassy-usb/">embassy-usb</a> implements a device-side USB stack. Implementations for common classes such as USB serial (CDC ACM) and USB HID are available, and a rich builder API allows building your own.
45+
- **LoRa** -
46+
The [lora-rs](https://github.com/lora-rs/lora-rs) project provides an async LoRa and LoRaWAN stack that works well on Embassy.
4647

47-
- **Bootloader and DFU** -
48-
<a href="https://github.com/embassy-rs/embassy/tree/master/embassy-boot">embassy-boot</a> is a lightweight bootloader supporting firmware application upgrades in a power-fail-safe way, with trial boots and rollbacks.
48+
- **USB** -
49+
[embassy-usb](https://docs.embassy.dev/embassy-usb/) implements a device-side USB stack. Implementations for common classes such as USB serial (CDC ACM) and USB HID are available, and a rich builder API allows building your own.
4950

51+
- **Bootloader and DFU** -
52+
[embassy-boot](https://github.com/embassy-rs/embassy/tree/master/embassy-boot) is a lightweight bootloader supporting firmware application upgrades in a power-fail-safe way, with trial boots and rollbacks.
5053

5154
## Sneak peek
5255

@@ -93,13 +96,15 @@ async fn main(spawner: Spawner) {
9396

9497
## Examples
9598

96-
Examples are found in the `examples/` folder separated by the chip manufacturer they are designed to run on. For example:
99+
Examples are found in the
100+
`examples/` folder separated by the chip manufacturer they are designed to run on. For example:
97101

98-
* `examples/nrf52840` run on the `nrf52840-dk` board (PCA10056) but should be easily adaptable to other nRF52 chips and boards.
99-
* `examples/nrf5340` run on the `nrf5340-dk` board (PCA10095).
100-
* `examples/stm32xx` for the various STM32 families.
101-
* `examples/rp` are for the RP2040 chip.
102-
* `examples/std` are designed to run locally on your PC.
102+
* `examples/nrf52840` run on the
103+
`nrf52840-dk` board (PCA10056) but should be easily adaptable to other nRF52 chips and boards.
104+
* `examples/nrf5340` run on the `nrf5340-dk` board (PCA10095).
105+
* `examples/stm32xx` for the various STM32 families.
106+
* `examples/rp` are for the RP2040 chip.
107+
* `examples/std` are designed to run locally on your PC.
103108

104109
### Running examples
105110

@@ -126,7 +131,7 @@ cargo run --release --bin blinky
126131

127132
For more help getting started, see [Getting Started][1] and [Running the Examples][2].
128133

129-
## Developing Embassy with Rust Analyzer based editors
134+
## Developing Embassy with Rust Analyzer-based editors
130135

131136
The [Rust Analyzer](https://rust-analyzer.github.io/) is used by [Visual Studio Code](https://code.visualstudio.com/)
132137
and others. Given the multiple targets that Embassy serves, there is no Cargo workspace file. Instead, the Rust Analyzer
@@ -136,7 +141,7 @@ please refer to the `.vscode/settings.json` file's `rust-analyzer.linkedProjects
136141
## Minimum supported Rust version (MSRV)
137142

138143
Embassy is guaranteed to compile on stable Rust 1.75 and up. It *might*
139-
compile with older versions but that may change in any new patch release.
144+
compile with older versions, but that may change in any new patch release.
140145

141146
## Why the name?
142147

docs/examples/basic/.cargo/config.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
2-
# replace nRF82840_xxAA with your chip as listed in `probe-run --list-chips`
3-
runner = "probe-run --chip nRF52840_xxAA"
2+
# replace nRF82840_xxAA with your chip as listed in `probe-rs chip list`
3+
runner = "probe-rs run --chip nRF52840_xxAA"
44

55
[build]
66
target = "thumbv7em-none-eabi"

docs/examples/layer-by-layer/.cargo/config.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
2-
runner = "probe-run --chip STM32L475VG"
2+
# replace your chip as listed in `probe-rs chip list`
3+
runner = "probe-rs run --chip STM32L475VG"
34

45
rustflags = [
56
"-C", "link-arg=--nmagic",

docs/pages/getting_started.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ If everything worked correctly, you should see a blinking LED on your board, and
6666
[source]
6767
----
6868
Finished dev [unoptimized + debuginfo] target(s) in 1m 56s
69-
Running `probe-run --chip STM32F407VGTx target/thumbv7em-none-eabi/debug/blinky`
69+
Running `probe-rs run --chip STM32F407VGTx target/thumbv7em-none-eabi/debug/blinky`
7070
(HOST) INFO flashing program (71.36 KiB)
7171
(HOST) INFO success!
7272
────────────────────────────────────────────────────────────────────────────────

docs/pages/new_project.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ stm32g474-example
150150
# Before upgrading check that everything is available on all tier1 targets here:
151151
# https://rust-lang.github.io/rustup-components-history
152152
[toolchain]
153-
channel = "nightly-2023-11-01"
153+
channel = "1.85"
154154
components = [ "rust-src", "rustfmt", "llvm-tools", "miri" ]
155155
targets = ["thumbv7em-none-eabi"]
156156
----

docs/pages/project_structure.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ A minimal example:
8585
[source,toml]
8686
----
8787
[toolchain]
88-
channel = "nightly-2023-08-19" # <- as of writing, this is the exact rust version embassy uses
88+
channel = "1.85" # <- as of writing, this is the exact rust version embassy uses
8989
components = [ "rust-src", "rustfmt" ] # <- optionally add "llvm-tools-preview" for some extra features like "cargo size"
9090
targets = [
91-
"thumbv6m-none-eabi" # <-change for your platform
91+
"thumbv6m-none-eabi" # <- change for your platform
9292
]
9393
----

embassy-net/CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
No unreleased changes yet... Quick, go send a PR!
1111

12-
## 0.7 - 2025-02-14
12+
## 0.7 - 2025-05-06
1313

1414
- don't infinite loop if udp::send methods receive a buffer too large to ever be sent
1515
- add ICMP sockets and a ping utility
16+
- configurable rate_limit for the ping utility
17+
- Feature match udp sockets
1618

1719
## 0.6 - 2025-01-05
1820

0 commit comments

Comments
 (0)