From e3b495908cda737cadad6ad645d19f0cb2fe98b2 Mon Sep 17 00:00:00 2001 From: "J. Neuschäfer" Date: Thu, 27 Jun 2024 16:48:31 +0200 Subject: docs: Fix mention of ExtiInput The struct is called ExtiInput, not ExtiButton. --- docs/pages/layer_by_layer.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/layer_by_layer.adoc b/docs/pages/layer_by_layer.adoc index f87291c20..7852d27b7 100644 --- a/docs/pages/layer_by_layer.adoc +++ b/docs/pages/layer_by_layer.adoc @@ -76,7 +76,7 @@ The async version looks very similar to the HAL version, apart from a few minor * The peripheral initialization is done by the main macro, and is handed to the main task. * Before checking the button state, the application is awaiting a transition in the pin state (low -> high or high -> low). -When `button.await_for_any_edge().await` is called, the executor will pause the main task and put the microcontroller in sleep mode, unless there are other tasks that can run. Internally, the Embassy HAL has configured the interrupt handler for the button (in `ExtiButton`), so that whenever an interrupt is raised, the task awaiting the button will be woken up. +When `button.await_for_any_edge().await` is called, the executor will pause the main task and put the microcontroller in sleep mode, unless there are other tasks that can run. Internally, the Embassy HAL has configured the interrupt handler for the button (in `ExtiInput`), so that whenever an interrupt is raised, the task awaiting the button will be woken up. The minimal overhead of the executor and the ability to run multiple tasks "concurrently" combined with the enormous simplification of the application, makes `async` a great fit for embedded. -- cgit From 028ca55f9ca3bfa2e4aa99b16bc0e0e29241fe70 Mon Sep 17 00:00:00 2001 From: kalkyl Date: Mon, 8 Jul 2024 17:16:35 +0200 Subject: Add more docs and cross-links --- docs/pages/faq.adoc | 3 ++- docs/pages/sharing_peripherals.adoc | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index a2f56a539..fc1316062 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -352,7 +352,8 @@ There are two main ways to handle concurrency in Embassy: In general, either of these approaches will work. The main differences of these approaches are: -When using **separate tasks**, each task needs its own RAM allocation, so there's a little overhead for each task, so one task that does three things will likely be a little bit smaller than three tasks that do one thing (not a lot, probably a couple dozen bytes). In contrast, with **multiple futures in one task**, you don't need multiple task allocations, and it will generally be easier to share data, or use borrowed resources, inside of a single task. +When using **separate tasks**, each task needs its own RAM allocation, so there's a little overhead for each task, so one task that does three things will likely be a little bit smaller than three tasks that do one thing (not a lot, probably a couple dozen bytes). In contrast, with **multiple futures in one task**, you don't need multiple task allocations, and it will generally be easier to share data, or use borrowed resources, inside of a single task. +An example showcasing some methods for sharing things between tasks link:https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/sharing.rs[can be found here]. But when it comes to "waking" tasks, for example when a data transfer is complete or a button is pressed, it's faster to wake a dedicated task, because that task does not need to check which future is actually ready. `join` and `select` must check ALL of the futures they are managing to see which one (or which ones) are ready to do more work. This is because all Rust executors (like Embassy or Tokio) only have the ability to wake tasks, not specific futures. This means you will use slightly less CPU time juggling futures when using dedicated tasks. diff --git a/docs/pages/sharing_peripherals.adoc b/docs/pages/sharing_peripherals.adoc index 6bcd56b01..ebd899c4e 100644 --- a/docs/pages/sharing_peripherals.adoc +++ b/docs/pages/sharing_peripherals.adoc @@ -126,3 +126,5 @@ async fn toggle_led(control: Sender<'static, ThreadModeRawMutex, LedState, 64>, This example replaces the Mutex with a Channel, and uses another task (the main loop) to drive the LED. The advantage of this approach is that only a single task references the peripheral, separating concerns. However, using a Mutex has a lower overhead and might be necessary if you need to ensure that the operation is completed before continuing to do other work in your task. + +An example showcasing more methods for sharing link:https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/sharing.rs[can be found here]. \ No newline at end of file -- cgit From af9c7379f99b309a99b0b573ebfb8ea1bebecaf9 Mon Sep 17 00:00:00 2001 From: kalkyl Date: Mon, 8 Jul 2024 22:53:50 +0200 Subject: Add link to example in book --- docs/pages/sharing_peripherals.adoc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/sharing_peripherals.adoc b/docs/pages/sharing_peripherals.adoc index ebd899c4e..6ba13f93b 100644 --- a/docs/pages/sharing_peripherals.adoc +++ b/docs/pages/sharing_peripherals.adoc @@ -127,4 +127,8 @@ async fn toggle_led(control: Sender<'static, ThreadModeRawMutex, LedState, 64>, This example replaces the Mutex with a Channel, and uses another task (the main loop) to drive the LED. The advantage of this approach is that only a single task references the peripheral, separating concerns. However, using a Mutex has a lower overhead and might be necessary if you need to ensure that the operation is completed before continuing to do other work in your task. -An example showcasing more methods for sharing link:https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/sharing.rs[can be found here]. \ No newline at end of file +An example showcasing more methods for sharing link:https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/sharing.rs[can be found here]. + +== Sharing an I2C or SPI bus between multiple devices + +An example of how to deal with multiple devices sharing a common I2C or SPI bus link:https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/shared_bus.rs[can be found here]. -- cgit From 2f62376a15b931dcf24708717695107f2c99fb1b Mon Sep 17 00:00:00 2001 From: rafael Date: Mon, 8 Jul 2024 23:27:42 +0200 Subject: add faq --- docs/pages/faq.adoc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index fc1316062..4ab04e2a1 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -358,3 +358,7 @@ An example showcasing some methods for sharing things between tasks link:https:/ But when it comes to "waking" tasks, for example when a data transfer is complete or a button is pressed, it's faster to wake a dedicated task, because that task does not need to check which future is actually ready. `join` and `select` must check ALL of the futures they are managing to see which one (or which ones) are ready to do more work. This is because all Rust executors (like Embassy or Tokio) only have the ability to wake tasks, not specific futures. This means you will use slightly less CPU time juggling futures when using dedicated tasks. Practically, there's not a LOT of difference either way - so go with what makes it easier for you and your code first, but there will be some details that are slightly different in each case. + +== splitting peripherals resources between tasks + +There are two ways to split resources between tasks, either manually assigned or by a convenient macro. See link:https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/assign_resources.rs[this example] \ No newline at end of file -- cgit From dc6639fa4d53ec7ad6a6aa0bd810952e4123e51d Mon Sep 17 00:00:00 2001 From: Mark Tomlin Date: Mon, 22 Jul 2024 06:59:13 -0400 Subject: Updated github branch from `master` to `main`. --- docs/pages/basic_application.adoc | 2 +- docs/pages/nrf.adoc | 2 +- docs/pages/overview.adoc | 2 +- docs/pages/stm32.adoc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/pages/basic_application.adoc b/docs/pages/basic_application.adoc index 7b4ebda4f..5c4e3e8b3 100644 --- a/docs/pages/basic_application.adoc +++ b/docs/pages/basic_application.adoc @@ -4,7 +4,7 @@ So you've got one of the examples running, but what now? Let's go through a simp == Main -The full example can be found link:https://github.com/embassy-rs/embassy/tree/master/docs/examples/basic[here]. +The full example can be found link:https://github.com/embassy-rs/embassy/tree/main/docs/examples/basic[here]. NOTE: If you’re using VS Code and rust-analyzer to view and edit the examples, you may need to make some changes to `.vscode/settings.json` to tell it which project we’re working on. Follow the instructions commented in that file to get rust-analyzer working correctly. diff --git a/docs/pages/nrf.adoc b/docs/pages/nrf.adoc index 1706087ae..de052b63f 100644 --- a/docs/pages/nrf.adoc +++ b/docs/pages/nrf.adoc @@ -1,6 +1,6 @@ = Embassy nRF HAL -The link:https://github.com/embassy-rs/embassy/tree/master/embassy-nrf[Embassy nRF HAL] is based on the PACs (Peripheral Access Crate) from link:https://github.com/nrf-rs/[nrf-rs]. +The link:https://github.com/embassy-rs/embassy/tree/main/embassy-nrf[Embassy nRF HAL] is based on the PACs (Peripheral Access Crate) from link:https://github.com/nrf-rs/[nrf-rs]. == Timer driver diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index 1b9381bfe..7d59d5521 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -48,7 +48,7 @@ link:https://github.com/lora-rs/lora-rs[lora-rs] supports LoRa networking on a w link:https://docs.embassy.dev/embassy-usb/[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. === Bootloader and DFU -link:https://github.com/embassy-rs/embassy/tree/master/embassy-boot[embassy-boot] is a lightweight bootloader supporting firmware application upgrades in a power-fail-safe way, with trial boots and rollbacks. +link:https://github.com/embassy-rs/embassy/tree/main/embassy-boot[embassy-boot] is a lightweight bootloader supporting firmware application upgrades in a power-fail-safe way, with trial boots and rollbacks. == What is DMA? diff --git a/docs/pages/stm32.adoc b/docs/pages/stm32.adoc index 7bfc0592b..df139a420 100644 --- a/docs/pages/stm32.adoc +++ b/docs/pages/stm32.adoc @@ -1,6 +1,6 @@ = Embassy STM32 HAL -The link:https://github.com/embassy-rs/embassy/tree/master/embassy-stm32[Embassy STM32 HAL] is based on the `stm32-metapac` project. +The link:https://github.com/embassy-rs/embassy/tree/main/embassy-stm32[Embassy STM32 HAL] is based on the `stm32-metapac` project. == The infinite variant problem -- cgit From 4811c14cc8ad57251e50e3aaa6d221f80603f577 Mon Sep 17 00:00:00 2001 From: Mark Tomlin Date: Mon, 22 Jul 2024 07:26:55 -0400 Subject: Updated cargo toml section links. --- docs/pages/new_project.adoc | 2 +- docs/pages/sharing_peripherals.adoc | 4 ++-- docs/pages/time_keeping.adoc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/pages/new_project.adoc b/docs/pages/new_project.adoc index 346d9f0f8..821bcbd27 100644 --- a/docs/pages/new_project.adoc +++ b/docs/pages/new_project.adoc @@ -1,6 +1,6 @@ = Starting a new project -Once you’ve successfully xref:getting_started.adoc[run some example projects], the next step is to make a standalone Embassy project. +Once you’ve successfully xref:#_getting_started[run some example projects], the next step is to make a standalone Embassy project. == Tools for generating Embassy projects diff --git a/docs/pages/sharing_peripherals.adoc b/docs/pages/sharing_peripherals.adoc index 6ba13f93b..dfb8c1ffe 100644 --- a/docs/pages/sharing_peripherals.adoc +++ b/docs/pages/sharing_peripherals.adoc @@ -8,7 +8,7 @@ The following examples shows different ways to use the on-board LED on a Raspber Using mutual exclusion is the simplest way to share a peripheral. -TIP: Dependencies needed to run this example link:/book/dev/basic_application.html#_the_cargo_toml[can be found here]. +TIP: Dependencies needed to run this example link:#_the_cargo_toml[can be found here]. [,rust] ---- use defmt::*; @@ -78,7 +78,7 @@ To indicate that the pin will be set to an Output. The `AnyPin` could have been A channel is another way to ensure exclusive access to a resource. Using a channel is great in the cases where the access can happen at a later point in time, allowing you to enqueue operations and do other things. -TIP: Dependencies needed to run this example link:/book/dev/basic_application.html#_the_cargo_toml[can be found here]. +TIP: Dependencies needed to run this example link:#_the_cargo_toml[can be found here]. [,rust] ---- use defmt::*; diff --git a/docs/pages/time_keeping.adoc b/docs/pages/time_keeping.adoc index 17492a884..11ddb2b2b 100644 --- a/docs/pages/time_keeping.adoc +++ b/docs/pages/time_keeping.adoc @@ -16,7 +16,7 @@ The `embassy::time::Timer` type provides two timing methods. An example of a delay is provided as follows: -TIP: Dependencies needed to run this example link:/book/dev/basic_application.html#_the_cargo_toml[can be found here]. +TIP: Dependencies needed to run this example link:#_the_cargo_toml[can be found here]. [,rust] ---- use embassy::executor::{task, Executor}; @@ -41,7 +41,7 @@ that expect a generic delay implementation to be provided. An example of how this can be used: -TIP: Dependencies needed to run this example link:/book/dev/basic_application.html#_the_cargo_toml[can be found here]. +TIP: Dependencies needed to run this example link:#_the_cargo_toml[can be found here]. [,rust] ---- use embassy::executor::{task, Executor}; -- cgit From 44282b18faf77b7ff2fa521eb7995fa46ca16e01 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 2 Aug 2024 19:20:26 +0200 Subject: Prepare embassy-time release --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index e82165032..40d23ffa1 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" [dependencies] embassy-executor = { version = "0.5.0", path = "../../../embassy-executor", features = ["defmt", "integrated-timers", "arch-cortex-m", "executor-thread"] } -embassy-time = { version = "0.3.1", path = "../../../embassy-time", features = ["defmt"] } +embassy-time = { version = "0.3.2", path = "../../../embassy-time", features = ["defmt"] } embassy-nrf = { version = "0.1.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "0.3" -- cgit From 2f3b3335e12f4c3aa988078d46cb6a3597277bd7 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 2 Aug 2024 19:25:35 +0200 Subject: Prepare for embassy-nrf release --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 40d23ffa1..6d5689d07 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" [dependencies] embassy-executor = { version = "0.5.0", path = "../../../embassy-executor", features = ["defmt", "integrated-timers", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.3.2", path = "../../../embassy-time", features = ["defmt"] } -embassy-nrf = { version = "0.1.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } +embassy-nrf = { version = "0.2.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "0.3" defmt-rtt = "0.3" -- cgit From 37d7b0cd06b7a5d952d2e7de173b10ab32d96c5a Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 2 Aug 2024 21:50:18 +0200 Subject: prepare release embassy-executor --- docs/examples/basic/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-async/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 6d5689d07..5d391adf3 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -6,7 +6,7 @@ version = "0.1.0" license = "MIT OR Apache-2.0" [dependencies] -embassy-executor = { version = "0.5.0", path = "../../../embassy-executor", features = ["defmt", "integrated-timers", "arch-cortex-m", "executor-thread"] } +embassy-executor = { version = "0.6.0", path = "../../../embassy-executor", features = ["defmt", "integrated-timers", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.3.2", path = "../../../embassy-time", features = ["defmt"] } embassy-nrf = { version = "0.2.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index 64f7e8403..7f8d8af3e 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" cortex-m = "0.7" cortex-m-rt = "0.7" embassy-stm32 = { version = "0.1.0", features = ["stm32l475vg", "memory-x", "exti"] } -embassy-executor = { version = "0.5.0", features = ["arch-cortex-m", "executor-thread"] } +embassy-executor = { version = "0.6.0", features = ["arch-cortex-m", "executor-thread"] } defmt = "0.3.0" defmt-rtt = "0.3.0" -- cgit From 20b1b15bda969309566ad495d54635da8b7f29b2 Mon Sep 17 00:00:00 2001 From: rafael Date: Sat, 17 Aug 2024 12:37:42 +0200 Subject: add one more embassy in the wild example (#3262) --- docs/pages/embassy_in_the_wild.adoc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/pages/embassy_in_the_wild.adoc b/docs/pages/embassy_in_the_wild.adoc index 76b1169bd..bb457a869 100644 --- a/docs/pages/embassy_in_the_wild.adoc +++ b/docs/pages/embassy_in_the_wild.adoc @@ -2,6 +2,8 @@ Here are known examples of real-world projects which make use of Embassy. Feel free to link:https://github.com/embassy-rs/embassy/blob/main/docs/pages/embassy_in_the_wild.adoc[add more]! +* link:https://github.com/1-rafael-1/pi-pico-alarmclock-rust[A Raspberry Pi Pico W Alarmclock] +** A hobbyist project building an alarm clock around a Pi Pico W complete with code, components list and enclosure design files. * link:https://github.com/haobogu/rmk/[RMK: A feature-rich Rust keyboard firmware] ** RMK has built-in layer support, wireless(BLE) support, real-time key editing support using vial, and more! ** Targets STM32, RP2040, nRF52 and ESP32 MCUs -- cgit From d8459685fd1e53a0fb57f44d950e0bc4f450c5f7 Mon Sep 17 00:00:00 2001 From: James Munns Date: Sun, 18 Aug 2024 10:58:07 +0200 Subject: Update faq.adoc - "code doesn't work in release mode" (#3267) Add debugging tips from chat --- docs/pages/faq.adoc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index 4ab04e2a1..8eb947b5e 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -361,4 +361,14 @@ Practically, there's not a LOT of difference either way - so go with what makes == splitting peripherals resources between tasks -There are two ways to split resources between tasks, either manually assigned or by a convenient macro. See link:https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/assign_resources.rs[this example] \ No newline at end of file +There are two ways to split resources between tasks, either manually assigned or by a convenient macro. See link:https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/assign_resources.rs[this example] + +== My code/driver works in debug mode, but not release mode (or with LTO) + +Issues like these while implementing drivers often fall into one of the following general causes, which are a good list of common errors to check for: + +1. Some kind of race condition - the faster code means you miss an interrupt or something +2. Some kind of UB, if you have unsafe code, or something like DMA with fences missing +3. Some kind of hardware errata, or some hardware misconfiguration like wrong clock speeds +4. Some issue with an interrupt handler, either enabling, disabling, or re-enabling of interrupts when necessary +5. Some kind of async issue, like not registering wakers fully before checking flags, or not registering or pending wakers at the right time -- cgit From 833537231e763c31eeb29fe7aad005a08477189d Mon Sep 17 00:00:00 2001 From: Süha Ünüvar <87157627+phycrax@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:50:46 +0800 Subject: add link to rustybits zero to async video in resources section --- docs/pages/overview.adoc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index 7d59d5521..2ebc85f6d 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -77,3 +77,7 @@ For more reading material on async Rust and Embassy: * link:https://tweedegolf.nl/en/blog/65/async-rust-vs-rtos-showdown[Comparsion of FreeRTOS and Embassy] * link:https://dev.to/apollolabsbin/series/20707[Tutorials] * link:https://blog.drogue.io/firmware-updates-part-1/[Firmware Updates with Embassy] + +Videos: + +* link:https://www.youtube.com/watch?v=wni5h5vIPhU[From Zero to Async in Embedded Rust] \ No newline at end of file -- cgit From 6d89f2729ab7a6ee3dd78ccaef1b16677b5a9eee Mon Sep 17 00:00:00 2001 From: kingofpayne <43875454+kingofpayne@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:07:56 +0200 Subject: boot: flash-erase-zero (#3344) Allow compatibility with devices whose flash erase set bytes to 0x00 instead of 0xFF, using a new flash-erase-zero feature. See issue #3342. --- docs/pages/bootloader.adoc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/pages/bootloader.adoc b/docs/pages/bootloader.adoc index 3b0cdb182..d8d50040b 100644 --- a/docs/pages/bootloader.adoc +++ b/docs/pages/bootloader.adoc @@ -19,6 +19,8 @@ The bootloader supports In general, the bootloader works on any platform that implements the `embedded-storage` traits for its internal flash, but may require custom initialization code to work. +STM32L0x1 devices require the `flash-erase-zero` feature to be enabled. + == Design image::bootloader_flash.png[Bootloader flash layout] -- cgit From 05d453bfd81bce49d541b2eeee3a8788e5a5fd7e Mon Sep 17 00:00:00 2001 From: Olivier Hériveaux Date: Mon, 23 Sep 2024 16:11:45 +0200 Subject: Fixed signature script in bootloader documentation --- docs/pages/bootloader.adoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/pages/bootloader.adoc b/docs/pages/bootloader.adoc index 3b0cdb182..a80e75c4c 100644 --- a/docs/pages/bootloader.adoc +++ b/docs/pages/bootloader.adoc @@ -86,8 +86,7 @@ Then, to sign your firmware given a declaration of `FIRMWARE_DIR` and a firmware [source, bash] ---- -shasum -a 512 -b $FIRMWARE_DIR/myfirmware > $SECRETS_DIR/message.txt -cat $SECRETS_DIR/message.txt | dd ibs=128 count=1 | xxd -p -r > $SECRETS_DIR/message.txt +shasum -a 512 -b $FIRMWARE_DIR/myfirmware | head -c128 | xxd -p -r > $SECRETS_DIR/message.txt signify -S -s $SECRETS_DIR/key.sec -m $SECRETS_DIR/message.txt -x $SECRETS_DIR/message.txt.sig cp $FIRMWARE_DIR/myfirmware $FIRMWARE_DIR/myfirmware+signed tail -n1 $SECRETS_DIR/message.txt.sig | base64 -d -i - | dd ibs=10 skip=1 >> $FIRMWARE_DIR/myfirmware+signed -- cgit From d1db7d90434e7cf8d82361818427942c19923726 Mon Sep 17 00:00:00 2001 From: Dániel Buga Date: Fri, 25 Oct 2024 18:53:59 +0200 Subject: Explain how to keep the executor awake --- docs/pages/faq.adoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index 8eb947b5e..d4f49bfc1 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -372,3 +372,16 @@ Issues like these while implementing drivers often fall into one of the followin 3. Some kind of hardware errata, or some hardware misconfiguration like wrong clock speeds 4. Some issue with an interrupt handler, either enabling, disabling, or re-enabling of interrupts when necessary 5. Some kind of async issue, like not registering wakers fully before checking flags, or not registering or pending wakers at the right time + +== How can I prevent the thread-mode executor from going to sleep? == + +In some cases you might want to prevent the thread-mode executor from going to sleep, for example when doing so would result in current spikes that reduce analog performance. +As a workaround, you can spawn a task that yields in a loop, preventing the executor from going to sleep. Note that this may increase power consumption. + +[source,rust] +---- +#[embassy_executor::task] +async fn idle() { + loop { embassy_futures::yield_now().await; } +} +---- -- cgit From 6545dfee6d370cd37701fbbbf85d46c1a8e34521 Mon Sep 17 00:00:00 2001 From: ckrenslehner Date: Fri, 25 Oct 2024 19:22:20 +0200 Subject: Update overview.adoc --- docs/pages/overview.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index 2ebc85f6d..8f97d937f 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -52,7 +52,7 @@ link:https://github.com/embassy-rs/embassy/tree/main/embassy-boot[embassy-boot] == What is DMA? -For most I/O in embedded devices, the peripheral doesn't directly support the transmission of multiple bits at once, with CAN being a notable exception. Instead, the MCU must write each byte, one at a time, and then wait until the peripheral is ready to send the next. For high I/O rates, this can pose a problem if the MCU must devote an increasing portion of its time handling each byte. The solution to this problem is to use the Direct Memory Access controller. +For most I/O in embedded devices, the peripheral doesn't directly support the transmission of multiple bytes at once, with CAN being a notable exception. Instead, the MCU must write each byte, one at a time, and then wait until the peripheral is ready to send the next. For high I/O rates, this can pose a problem if the MCU must devote an increasing portion of its time handling each byte. The solution to this problem is to use the Direct Memory Access controller. The Direct Memory Access controller (DMA) is a controller that is present in MCUs that Embassy supports, including stm32 and nrf. The DMA allows the MCU to set up a transfer, either send or receive, and then wait for the transfer to complete. With DMA, once started, no MCU intervention is required until the transfer is complete, meaning that the MCU can perform other computation, or set up other I/O while the transfer is in progress. For high I/O rates, DMA can cut the time that the MCU spends handling I/O by over half. However, because DMA is more complex to set-up, it is less widely used in the embedded community. Embassy aims to change that by making DMA the first choice rather than the last. Using Embassy, there's no additional tuning required once I/O rates increase because your application is already set-up to handle them. @@ -80,4 +80,4 @@ For more reading material on async Rust and Embassy: Videos: -* link:https://www.youtube.com/watch?v=wni5h5vIPhU[From Zero to Async in Embedded Rust] \ No newline at end of file +* link:https://www.youtube.com/watch?v=wni5h5vIPhU[From Zero to Async in Embedded Rust] -- cgit From 2c05ac5262eb2beaa043818f02d82b656f272b4f Mon Sep 17 00:00:00 2001 From: ckrenslehner Date: Fri, 25 Oct 2024 20:36:46 +0200 Subject: Update embassy Cargo.toml section in new_project.adoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Embassy is already published to crates.io 🍾 --- docs/pages/new_project.adoc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/pages/new_project.adoc b/docs/pages/new_project.adoc index 821bcbd27..fa4c2e359 100644 --- a/docs/pages/new_project.adoc +++ b/docs/pages/new_project.adoc @@ -73,16 +73,28 @@ Now that cargo knows what target to compile for (and probe-rs knows what chip to Looking in `examples/stm32g4/Cargo.toml`, we can see that the examples require a number of embassy crates. For blinky, we’ll only need three of them: `embassy-stm32`, `embassy-executor` and `embassy-time`. -At the time of writing, the latest version of embassy isn‘t available on crates.io, so we need to install it straight from the git repository. The recommended way of doing so is as follows: + +At the time of writing, embassy is already published to crates.io. Therefore, dependencies can easily added via Cargo.toml. + +[source,toml] +---- +[dependencies] +embassy-stm32 = { version = "0.1.0", features = ["defmt", "time-driver-any", "stm32g474re", "memory-x", "unstable-pac", "exti"] } +embassy-executor = { version = "0.6.1", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } +embassy-time = { version = "0.3.2", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } +---- + +Prior embassy needed to be installed straight from the git repository. This can is still useful, if you want to checkout a specic revision of an embassy crate which is not yet published. +The recommended way of doing so is as follows: * Copy the required `embassy-*` lines from the example `Cargo.toml` * Make any necessary changes to `features`, e.g. requiring the `stm32g474re` feature of `embassy-stm32` * Remove the `path = ""` keys in the `embassy-*` entries * Create a `[patch.crates-io]` section, with entries for each embassy crate we need. These should all contain identical values: a link to the git repository, and a reference to the commit we’re checking out. Assuming you want the latest commit, you can find it by running `git ls-remote https://github.com/embassy-rs/embassy.git HEAD` -NOTE: When using this method, it’s necessary that the `version` keys in `[dependencies]` match up with the versions defined in each crate’s `Cargo.toml` in the specificed `rev` under `[patch.crates.io]`. This means that when updating, you have to a pick a new revision, change everything in `[patch.crates.io]` to match it, and then correct any versions under `[dependencies]` which have changed. Hopefully this will no longer be necessary once embassy is released on crates.io! +NOTE: When using this method, it’s necessary that the `version` keys in `[dependencies]` match up with the versions defined in each crate’s `Cargo.toml` in the specificed `rev` under `[patch.crates.io]`. This means that when updating, you have to a pick a new revision, change everything in `[patch.crates.io]` to match it, and then correct any versions under `[dependencies]` which have changed. -At the time of writing, this method produces the following results: +An example Cargo.toml file might look as follows: [source,toml] ---- -- cgit From 3d0921ffc4afb49b5d28277a02cee55fcec08881 Mon Sep 17 00:00:00 2001 From: ckrenslehner Date: Fri, 25 Oct 2024 20:41:51 +0200 Subject: fix spelling --- docs/pages/new_project.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/new_project.adoc b/docs/pages/new_project.adoc index fa4c2e359..38cea044b 100644 --- a/docs/pages/new_project.adoc +++ b/docs/pages/new_project.adoc @@ -84,7 +84,7 @@ embassy-executor = { version = "0.6.1", features = ["nightly", "arch-cortex-m", embassy-time = { version = "0.3.2", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } ---- -Prior embassy needed to be installed straight from the git repository. This can is still useful, if you want to checkout a specic revision of an embassy crate which is not yet published. +Prior, embassy needed to be installed straight from the git repository. Installing from git is still useful, if you want to checkout a specic revision of an embassy crate which is not yet published. The recommended way of doing so is as follows: * Copy the required `embassy-*` lines from the example `Cargo.toml` -- cgit From 32dcff39959bda11a7a3ef35fb3c77e172d46ae4 Mon Sep 17 00:00:00 2001 From: rafael Date: Sun, 10 Nov 2024 17:20:59 +0100 Subject: add simple-robot to Embassy in the wild --- docs/pages/embassy_in_the_wild.adoc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/pages/embassy_in_the_wild.adoc b/docs/pages/embassy_in_the_wild.adoc index bb457a869..620794c31 100644 --- a/docs/pages/embassy_in_the_wild.adoc +++ b/docs/pages/embassy_in_the_wild.adoc @@ -2,6 +2,8 @@ Here are known examples of real-world projects which make use of Embassy. Feel free to link:https://github.com/embassy-rs/embassy/blob/main/docs/pages/embassy_in_the_wild.adoc[add more]! +* link:https://github.com/1-rafael-1/simple-robot[A simple tracked robot based on Raspberry Pi Pico 2] +** A hobbyist project building a tracked robot with basic autonomous and manual drive mode. * link:https://github.com/1-rafael-1/pi-pico-alarmclock-rust[A Raspberry Pi Pico W Alarmclock] ** A hobbyist project building an alarm clock around a Pi Pico W complete with code, components list and enclosure design files. * link:https://github.com/haobogu/rmk/[RMK: A feature-rich Rust keyboard firmware] -- cgit From 796f6c034a148e1fedb3196a2c73a155f5d0545f Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Tue, 12 Nov 2024 17:48:36 +0100 Subject: Release embassy-executor 0.6.3. --- docs/examples/basic/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-async/Cargo.toml | 2 +- docs/pages/new_project.adoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 5d391adf3..d46431b9a 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -6,7 +6,7 @@ version = "0.1.0" license = "MIT OR Apache-2.0" [dependencies] -embassy-executor = { version = "0.6.0", path = "../../../embassy-executor", features = ["defmt", "integrated-timers", "arch-cortex-m", "executor-thread"] } +embassy-executor = { version = "0.6.3", path = "../../../embassy-executor", features = ["defmt", "integrated-timers", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.3.2", path = "../../../embassy-time", features = ["defmt"] } embassy-nrf = { version = "0.2.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index 7f8d8af3e..f6d2e4fc7 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" cortex-m = "0.7" cortex-m-rt = "0.7" embassy-stm32 = { version = "0.1.0", features = ["stm32l475vg", "memory-x", "exti"] } -embassy-executor = { version = "0.6.0", features = ["arch-cortex-m", "executor-thread"] } +embassy-executor = { version = "0.6.3", features = ["arch-cortex-m", "executor-thread"] } defmt = "0.3.0" defmt-rtt = "0.3.0" diff --git a/docs/pages/new_project.adoc b/docs/pages/new_project.adoc index 38cea044b..f8dd848be 100644 --- a/docs/pages/new_project.adoc +++ b/docs/pages/new_project.adoc @@ -80,7 +80,7 @@ At the time of writing, embassy is already published to crates.io. Therefore, de ---- [dependencies] embassy-stm32 = { version = "0.1.0", features = ["defmt", "time-driver-any", "stm32g474re", "memory-x", "unstable-pac", "exti"] } -embassy-executor = { version = "0.6.1", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } +embassy-executor = { version = "0.6.3", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } embassy-time = { version = "0.3.2", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } ---- -- cgit From 75a21e5045c3d770c69737df1b586e668ba5b1b1 Mon Sep 17 00:00:00 2001 From: Badr Bouslikhin Date: Thu, 5 Dec 2024 18:39:54 +0100 Subject: docs: add an faq on bootloader failures --- docs/pages/faq.adoc | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index d4f49bfc1..3e32563cc 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -385,3 +385,49 @@ async fn idle() { loop { embassy_futures::yield_now().await; } } ---- + +== Why is my bootloader restarting in loop? + +== Troubleshooting Bootloader Restart Loops + +If your bootloader restarts in a loop, there could be multiple reasons. Here are some things to check: + +=== Validate the `memory.x` File +The bootloader performs critical checks when creating partitions using the addresses defined in `memory.x`. Ensure the following assertions hold true: + +[source,rust] +---- +const { + core::assert!(Self::PAGE_SIZE % ACTIVE::WRITE_SIZE as u32 == 0); + core::assert!(Self::PAGE_SIZE % ACTIVE::ERASE_SIZE as u32 == 0); + core::assert!(Self::PAGE_SIZE % DFU::WRITE_SIZE as u32 == 0); + core::assert!(Self::PAGE_SIZE % DFU::ERASE_SIZE as u32 == 0); +} + +// Ensure enough progress pages to store copy progress +assert_eq!(0, Self::PAGE_SIZE % aligned_buf.len() as u32); +assert!(aligned_buf.len() >= STATE::WRITE_SIZE); +assert_eq!(0, aligned_buf.len() % ACTIVE::WRITE_SIZE); +assert_eq!(0, aligned_buf.len() % DFU::WRITE_SIZE); +---- + +If any of these assertions fail, the bootloader will likely restart in a loop. This failure might not log any messages (e.g., when using `defmt`). Confirm that your `memory.x` file and flash memory align with these requirements. + +=== Handling Panic Logging +Some panic errors might log messages, but certain microcontrollers reset before the message is fully printed. To ensure panic messages are logged, add a delay using no-operation (NOP) instructions before the reset: + +[source,rust] +---- +#[panic_handler] +fn panic(_info: &core::panic::PanicInfo) -> ! { + for _ in 0..10_000_000 { + cortex_m::asm::nop(); + } + cortex_m::asm::udf(); +} +---- + +=== Feed the watchdog + + +Some `embassy-boot` implementations (like `embassy-boot-nrf` and `embassy-boot-rp`) rely on a watchdog timer to detect application failure. The bootloader will restart if your application code does not properly feed the watchdog timer. Make sure to feed it correctly. -- cgit From 2f2e2c6031a1abaecdac5ed2febe109e647fe6fd Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 9 Dec 2024 00:28:14 +0100 Subject: Make `integrated-timers` the default, remove Cargo feature. --- docs/examples/basic/Cargo.toml | 2 +- docs/pages/new_project.adoc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index d46431b9a..daf83873d 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -6,7 +6,7 @@ version = "0.1.0" license = "MIT OR Apache-2.0" [dependencies] -embassy-executor = { version = "0.6.3", path = "../../../embassy-executor", features = ["defmt", "integrated-timers", "arch-cortex-m", "executor-thread"] } +embassy-executor = { version = "0.6.3", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.3.2", path = "../../../embassy-time", features = ["defmt"] } embassy-nrf = { version = "0.2.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } diff --git a/docs/pages/new_project.adoc b/docs/pages/new_project.adoc index f8dd848be..63340016b 100644 --- a/docs/pages/new_project.adoc +++ b/docs/pages/new_project.adoc @@ -80,7 +80,7 @@ At the time of writing, embassy is already published to crates.io. Therefore, de ---- [dependencies] embassy-stm32 = { version = "0.1.0", features = ["defmt", "time-driver-any", "stm32g474re", "memory-x", "unstable-pac", "exti"] } -embassy-executor = { version = "0.6.3", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } +embassy-executor = { version = "0.6.3", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt"] } embassy-time = { version = "0.3.2", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } ---- @@ -100,7 +100,7 @@ An example Cargo.toml file might look as follows: ---- [dependencies] embassy-stm32 = {version = "0.1.0", features = ["defmt", "time-driver-any", "stm32g474re", "memory-x", "unstable-pac", "exti"]} -embassy-executor = { version = "0.3.3", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } +embassy-executor = { version = "0.3.3", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt"] } embassy-time = { version = "0.2", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } [patch.crates-io] -- cgit From 9a238e6ad8aedf29b5f5af7308c7f5f50061242c Mon Sep 17 00:00:00 2001 From: Dániel Buga Date: Wed, 18 Dec 2024 15:42:24 +0100 Subject: Prepare new embassy-time-*driver, embassy-executor, embassy-time --- docs/examples/basic/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index daf83873d..613fc2041 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -6,8 +6,8 @@ version = "0.1.0" license = "MIT OR Apache-2.0" [dependencies] -embassy-executor = { version = "0.6.3", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } -embassy-time = { version = "0.3.2", path = "../../../embassy-time", features = ["defmt"] } +embassy-executor = { version = "0.7.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } +embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } embassy-nrf = { version = "0.2.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "0.3" -- cgit From ab8ca3f126447edb3a9eb06aa6fd6cd394219c17 Mon Sep 17 00:00:00 2001 From: Dániel Buga Date: Fri, 20 Dec 2024 12:45:24 +0100 Subject: Rename ETQD, bump date --- docs/pages/faq.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index 3e32563cc..ed88515d0 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -140,9 +140,9 @@ Example: [source,toml] ---- [patch.crates-io] -embassy-time-queue-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "e5fdd35" } -embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "e5fdd35" } -# embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "e5fdd35" } +embassy-time-queue-utils = { git = "https://github.com/embassy-rs/embassy.git", rev = "7f8af8a" } +embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", rev = "7f8af8a" } +# embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "7f8af8a" } ---- Note that the git revision should match any other embassy patches or git dependencies that you are using! -- cgit From 8639692ce38bd0e33e87a42b9d51780ccc66952c Mon Sep 17 00:00:00 2001 From: Dániel Buga Date: Mon, 30 Dec 2024 20:25:42 +0100 Subject: Update faq --- docs/pages/faq.adoc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index ed88515d0..9c4d277f9 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -92,17 +92,9 @@ If you see linker error like this: >>> referenced by driver.rs:127 (src/driver.rs:127) >>> embassy_time-846f66f1620ad42c.embassy_time.4f6a638abb75dd4c-cgu.0.rcgu.o:(embassy_time::driver::now::hefb1f99d6e069842) in archive Devel/Embedded/pogodyna/target/thumbv7em-none-eabihf/debug/deps/libembassy_time-846f66f1620ad42c.rlib - rust-lld: error: undefined symbol: _embassy_time_allocate_alarm - >>> referenced by driver.rs:134 (src/driver.rs:134) - >>> embassy_time-846f66f1620ad42c.embassy_time.4f6a638abb75dd4c-cgu.0.rcgu.o:(embassy_time::driver::allocate_alarm::hf5145b6bd46706b2) in archive Devel/Embedded/pogodyna/target/thumbv7em-none-eabihf/debug/deps/libembassy_time-846f66f1620ad42c.rlib - - rust-lld: error: undefined symbol: _embassy_time_set_alarm_callback - >>> referenced by driver.rs:139 (src/driver.rs:139) - >>> embassy_time-846f66f1620ad42c.embassy_time.4f6a638abb75dd4c-cgu.0.rcgu.o:(embassy_time::driver::set_alarm_callback::h24f92388d96eafd2) in archive Devel/Embedded/pogodyna/target/thumbv7em-none-eabihf/debug/deps/libembassy_time-846f66f1620ad42c.rlib - - rust-lld: error: undefined symbol: _embassy_time_set_alarm + rust-lld: error: undefined symbol: _embassy_time_schedule_wake >>> referenced by driver.rs:144 (src/driver.rs:144) - >>> embassy_time-846f66f1620ad42c.embassy_time.4f6a638abb75dd4c-cgu.0.rcgu.o:(embassy_time::driver::set_alarm::h530a5b1f444a6d5b) in archive Devel/Embedded/pogodyna/target/thumbv7em-none-eabihf/debug/deps/libembassy_time-846f66f1620ad42c.rlib + >>> embassy_time-846f66f1620ad42c.embassy_time.4f6a638abb75dd4c-cgu.0.rcgu.o:(embassy_time::driver::schedule_wake::h530a5b1f444a6d5b) in archive Devel/Embedded/pogodyna/target/thumbv7em-none-eabihf/debug/deps/libembassy_time-846f66f1620ad42c.rlib ---- You probably need to enable a time driver for your HAL (not in `embassy-time`!). For example with `embassy-stm32`, you might need to enable `time-driver-any`: @@ -158,10 +150,9 @@ Note that the git revision should match any other embassy patches or git depende * Set the following keys in the `[unstable]` section of your `.cargo/config.toml` ** `build-std = ["core"]` ** `build-std-features = ["panic_immediate_abort"]` -* Enable feature `embassy-time/generic-queue`, disable feature `embassy-executor/integrated-timers` * When using `InterruptExecutor`: ** disable `executor-thread` - ** make `main`` spawn everything, then enable link:https://docs.rs/cortex-m/latest/cortex_m/peripheral/struct.SCB.html#method.set_sleeponexit[SCB.SLEEPONEXIT] and `loop { cortex_m::asm::wfi() }` + ** make `main` spawn everything, then enable link:https://docs.rs/cortex-m/latest/cortex_m/peripheral/struct.SCB.html#method.set_sleeponexit[SCB.SLEEPONEXIT] and `loop { cortex_m::asm::wfi() }` ** *Note:* If you need 2 priority levels, using 2 interrupt executors is better than 1 thread executor + 1 interrupt executor. == How do I set up the task arenas on stable? -- cgit From de27d9cd00f4b1bfe8eeda5bc2cdfc6fde746e47 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 6 Jan 2025 09:22:09 +0100 Subject: Update cyw43, nrf, rp hals and embassy-boot --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 613fc2041..04d042250 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" [dependencies] embassy-executor = { version = "0.7.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } -embassy-nrf = { version = "0.2.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } +embassy-nrf = { version = "0.3.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "0.3" defmt-rtt = "0.3" -- cgit From 9d94d68a7f2c92dc306ea6864ef518b6e73d15ec Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Thu, 9 Jan 2025 11:41:00 +0100 Subject: Create embassy-nrf 0.3.1 --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 04d042250..705c334a7 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" [dependencies] embassy-executor = { version = "0.7.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } -embassy-nrf = { version = "0.3.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } +embassy-nrf = { version = "0.3.1", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "0.3" defmt-rtt = "0.3" -- cgit From 593d9973e0cddad753aa62c072d425781d9101b4 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 10 Jan 2025 17:38:32 +0100 Subject: Release embassy-stm32 v0.2.0 --- docs/examples/layer-by-layer/blinky-async/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-hal/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-irq/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index f6d2e4fc7..2c3996e87 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" [dependencies] cortex-m = "0.7" cortex-m-rt = "0.7" -embassy-stm32 = { version = "0.1.0", features = ["stm32l475vg", "memory-x", "exti"] } +embassy-stm32 = { version = "0.2.0", features = ["stm32l475vg", "memory-x", "exti"] } embassy-executor = { version = "0.6.3", features = ["arch-cortex-m", "executor-thread"] } defmt = "0.3.0" diff --git a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml index c15de2db2..d8f94b69d 100644 --- a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" [dependencies] cortex-m = "0.7" cortex-m-rt = "0.7" -embassy-stm32 = { version = "0.1.0", features = ["stm32l475vg", "memory-x"] } +embassy-stm32 = { version = "0.2.0", features = ["stm32l475vg", "memory-x"] } defmt = "0.3.0" defmt-rtt = "0.3.0" diff --git a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml index 9733658b6..15153cab4 100644 --- a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" [dependencies] cortex-m = "0.7" cortex-m-rt = { version = "0.7" } -embassy-stm32 = { version = "0.1.0", features = ["stm32l475vg", "memory-x", "unstable-pac"] } +embassy-stm32 = { version = "0.2.0", features = ["stm32l475vg", "memory-x", "unstable-pac"] } defmt = "0.3.0" defmt-rtt = "0.3.0" -- cgit From 6003582bebf07bcfcf57b957e897697d35a8b46c Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Fri, 10 Jan 2025 21:51:29 +0100 Subject: docs: add intro to embassy by therustybits --- docs/pages/overview.adoc | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index 8f97d937f..6e9e58ad3 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -80,4 +80,5 @@ For more reading material on async Rust and Embassy: Videos: +* link:https://www.youtube.com/watch?v=pDd5mXBF4tY[Intro to Embassy] * link:https://www.youtube.com/watch?v=wni5h5vIPhU[From Zero to Async in Embedded Rust] -- cgit From 9cd2deba4d7da2b607613c98b004896512e9aabf Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Sat, 11 Jan 2025 16:23:30 +0100 Subject: Fix typo --- docs/pages/overview.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index 6e9e58ad3..6ac0e0b2b 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -6,7 +6,7 @@ Embassy is a project to make async/await a first-class option for embedded devel When handling I/O, software must call functions that block program execution until the I/O operation completes. When running inside of an OS such as Linux, such functions generally transfer control to the kernel so that another task (known as a “thread”) can be executed if available, or the CPU can be put to sleep until another task is ready. -Because an OS cannot presume that threads will behave cooperatively, threads are relatively resource-intensive, and may be forcibly interrupted they do not transfer control back to the kernel within an allotted time. If tasks could be presumed to behave cooperatively, or at least not maliciously, it would be possible to create tasks that appear to be almost free when compared to a traditional OS thread. +Because an OS cannot presume that threads will behave cooperatively, threads are relatively resource-intensive, and may be forcibly interrupted if they do not transfer control back to the kernel within an allotted time. If tasks could be presumed to behave cooperatively, or at least not maliciously, it would be possible to create tasks that appear to be almost free when compared to a traditional OS thread. In other programming languages, these lightweight tasks are known as “coroutines” or ”goroutines”. In Rust, they are implemented with async. Async-await works by transforming each async function into an object called a future. When a future blocks on I/O the future yields, and the scheduler, called an executor, can select a different future to execute. -- cgit From 2fab8d0b9ba8eecc40b76c00fab19abf0426a8ff Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 15 Jan 2025 02:09:24 +0100 Subject: Update doc projects deps, don't use patch.crates-io --- docs/examples/layer-by-layer/Cargo.toml | 4 -- .../layer-by-layer/blinky-async/Cargo.toml | 8 ++-- docs/examples/layer-by-layer/blinky-hal/Cargo.toml | 6 +-- docs/examples/layer-by-layer/blinky-irq/Cargo.toml | 6 +-- docs/examples/layer-by-layer/blinky-pac/Cargo.toml | 6 +-- .../examples/layer-by-layer/blinky-pac/src/main.rs | 48 +++++++++------------- 6 files changed, 33 insertions(+), 45 deletions(-) (limited to 'docs') diff --git a/docs/examples/layer-by-layer/Cargo.toml b/docs/examples/layer-by-layer/Cargo.toml index 0f233eae5..f18c9e7e4 100644 --- a/docs/examples/layer-by-layer/Cargo.toml +++ b/docs/examples/layer-by-layer/Cargo.toml @@ -7,10 +7,6 @@ members = [ "blinky-async", ] -[patch.crates-io] -embassy-executor = { path = "../../../embassy-executor" } -embassy-stm32 = { path = "../../../embassy-stm32" } - [profile.release] codegen-units = 1 debug = 2 diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index 2c3996e87..51ddf87d4 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0" [dependencies] cortex-m = "0.7" cortex-m-rt = "0.7" -embassy-stm32 = { version = "0.2.0", features = ["stm32l475vg", "memory-x", "exti"] } -embassy-executor = { version = "0.6.3", features = ["arch-cortex-m", "executor-thread"] } +embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "exti"] } +embassy-executor = { version = "0.7.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread"] } -defmt = "0.3.0" -defmt-rtt = "0.3.0" +defmt = "0.3" +defmt-rtt = "0.4" panic-probe = { version = "0.3.0", features = ["print-defmt"] } diff --git a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml index d8f94b69d..1e292e6b4 100644 --- a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml @@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0" [dependencies] cortex-m = "0.7" cortex-m-rt = "0.7" -embassy-stm32 = { version = "0.2.0", features = ["stm32l475vg", "memory-x"] } +embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x"] } -defmt = "0.3.0" -defmt-rtt = "0.3.0" +defmt = "0.3" +defmt-rtt = "0.4" panic-probe = { version = "0.3.0", features = ["print-defmt"] } diff --git a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml index 15153cab4..04ffc23ba 100644 --- a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml @@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0" [dependencies] cortex-m = "0.7" cortex-m-rt = { version = "0.7" } -embassy-stm32 = { version = "0.2.0", features = ["stm32l475vg", "memory-x", "unstable-pac"] } +embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "unstable-pac"] } -defmt = "0.3.0" -defmt-rtt = "0.3.0" +defmt = "0.3" +defmt-rtt = "0.4" panic-probe = { version = "0.3.0", features = ["print-defmt"] } diff --git a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml index f872b94cb..cf2d7fede 100644 --- a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml @@ -7,8 +7,8 @@ license = "MIT OR Apache-2.0" [dependencies] cortex-m = "0.7" cortex-m-rt = "0.7" -stm32-metapac = { version = "1", features = ["stm32l475vg", "memory-x"] } +stm32-metapac = { version = "16", features = ["stm32l475vg"] } -defmt = "0.3.0" -defmt-rtt = "0.3.0" +defmt = "0.3" +defmt-rtt = "0.4" panic-probe = { version = "0.3.0", features = ["print-defmt"] } diff --git a/docs/examples/layer-by-layer/blinky-pac/src/main.rs b/docs/examples/layer-by-layer/blinky-pac/src/main.rs index 990d46cb6..cfbd91306 100644 --- a/docs/examples/layer-by-layer/blinky-pac/src/main.rs +++ b/docs/examples/layer-by-layer/blinky-pac/src/main.rs @@ -8,46 +8,38 @@ use {defmt_rtt as _, panic_probe as _, stm32_metapac as pac}; fn main() -> ! { // Enable GPIO clock let rcc = pac::RCC; - unsafe { - rcc.ahb2enr().modify(|w| { - w.set_gpioben(true); - w.set_gpiocen(true); - }); + rcc.ahb2enr().modify(|w| { + w.set_gpioben(true); + w.set_gpiocen(true); + }); - rcc.ahb2rstr().modify(|w| { - w.set_gpiobrst(true); - w.set_gpiocrst(true); - w.set_gpiobrst(false); - w.set_gpiocrst(false); - }); - } + rcc.ahb2rstr().modify(|w| { + w.set_gpiobrst(true); + w.set_gpiocrst(true); + w.set_gpiobrst(false); + w.set_gpiocrst(false); + }); // Setup button let gpioc = pac::GPIOC; const BUTTON_PIN: usize = 13; - unsafe { - gpioc.pupdr().modify(|w| w.set_pupdr(BUTTON_PIN, vals::Pupdr::PULLUP)); - gpioc.otyper().modify(|w| w.set_ot(BUTTON_PIN, vals::Ot::PUSHPULL)); - gpioc.moder().modify(|w| w.set_moder(BUTTON_PIN, vals::Moder::INPUT)); - } + gpioc.pupdr().modify(|w| w.set_pupdr(BUTTON_PIN, vals::Pupdr::PULL_UP)); + gpioc.otyper().modify(|w| w.set_ot(BUTTON_PIN, vals::Ot::PUSH_PULL)); + gpioc.moder().modify(|w| w.set_moder(BUTTON_PIN, vals::Moder::INPUT)); // Setup LED let gpiob = pac::GPIOB; const LED_PIN: usize = 14; - unsafe { - gpiob.pupdr().modify(|w| w.set_pupdr(LED_PIN, vals::Pupdr::FLOATING)); - gpiob.otyper().modify(|w| w.set_ot(LED_PIN, vals::Ot::PUSHPULL)); - gpiob.moder().modify(|w| w.set_moder(LED_PIN, vals::Moder::OUTPUT)); - } + gpiob.pupdr().modify(|w| w.set_pupdr(LED_PIN, vals::Pupdr::FLOATING)); + gpiob.otyper().modify(|w| w.set_ot(LED_PIN, vals::Ot::PUSH_PULL)); + gpiob.moder().modify(|w| w.set_moder(LED_PIN, vals::Moder::OUTPUT)); // Main loop loop { - unsafe { - if gpioc.idr().read().idr(BUTTON_PIN) == vals::Idr::LOW { - gpiob.bsrr().write(|w| w.set_bs(LED_PIN, true)); - } else { - gpiob.bsrr().write(|w| w.set_br(LED_PIN, true)); - } + if gpioc.idr().read().idr(BUTTON_PIN) == vals::Idr::LOW { + gpiob.bsrr().write(|w| w.set_bs(LED_PIN, true)); + } else { + gpiob.bsrr().write(|w| w.set_br(LED_PIN, true)); } } } -- cgit From 8052ef037e88b034fa9eddc8e7d8e7efa5dd3f0d Mon Sep 17 00:00:00 2001 From: Dániel Buga Date: Tue, 21 Jan 2025 22:25:35 +0100 Subject: Add __pender error to the FAQ --- docs/pages/faq.adoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index 9c4d277f9..f95ccf48b 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -117,6 +117,20 @@ If you are in the early project setup phase and not using anything from the HAL, use embassy_stm32 as _; ---- +Another common error you may experience is: + +[source,text] +---- + = note: rust-lld: error: undefined symbol: __pender + >>> referenced by mod.rs:373 (src/raw/mod.rs:373) + >>> embassy_executor-e78174e249bca7f4.embassy_executor.1e9d60fc90940543-cgu.0.rcgu.o:(embassy_executor::raw::Pender::pend::h0f19b6e01762e4cd) in archive [...]libembassy_executor-e78174e249bca7f4.rlib +---- + +There are two possible causes to this error: + +* You are using `embassy-executor` withuout enabling one of the architecture-specific features, but you are using a HAL that does not bring its own executors. For example, for Cortex-M (like the RP2040), you need to enable the `arch-cortex-m` feature of `embassy-executor`. +* You are not using `embassy-executor`. In this case, you need to enable the one of the `generic-queue-X` features of `embassy-time`. + == Error: `Only one package in the dependency graph may specify the same links value.` You have multiple versions of the same crate in your dependency tree. This means that some of your -- cgit From 89b5795eec6279911458da524dba3b3c68929913 Mon Sep 17 00:00:00 2001 From: Graic <33105645+Graicc@users.noreply.github.com> Date: Sat, 1 Feb 2025 18:06:43 -0500 Subject: Fix typo in getting started docs --- docs/pages/getting_started.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/getting_started.adoc b/docs/pages/getting_started.adoc index 017409018..954f3fd28 100644 --- a/docs/pages/getting_started.adoc +++ b/docs/pages/getting_started.adoc @@ -86,7 +86,7 @@ NOTE: How does the `+cargo run+` command know how to connect to our board and pr === It didn’t work! -If you hare having issues when running `+cargo run --release+`, please check the following: +If you are having issues when running `+cargo run --release+`, please check the following: * You are specifying the correct `+--chip+` on the command line, OR * You have set `+.cargo/config.toml+`’s run line to the correct chip, AND -- cgit From 74c42fd9d0522fdd5150b630ea8b7d493964cf31 Mon Sep 17 00:00:00 2001 From: Owen Brooks Date: Tue, 11 Feb 2025 19:58:34 +1100 Subject: Fix typos in docs --- docs/pages/best_practices.adoc | 2 +- docs/pages/layer_by_layer.adoc | 2 +- docs/pages/overview.adoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/pages/best_practices.adoc b/docs/pages/best_practices.adoc index bfcedec06..eabaa9eb9 100644 --- a/docs/pages/best_practices.adoc +++ b/docs/pages/best_practices.adoc @@ -35,7 +35,7 @@ After the processing, another 1024 byte buffer will be placed on the stack to be Pass the data by reference and not by value on both, the way in and the way out. For example, you could return a slice of the input buffer as the output. -Requiring the lifetime of the input slice and the output slice to be the same, the memory safetly of this procedure will be enforced by the compiler. +Requiring the lifetime of the input slice and the output slice to be the same, the memory safety of this procedure will be enforced by the compiler. [,rust] ---- diff --git a/docs/pages/layer_by_layer.adoc b/docs/pages/layer_by_layer.adoc index 7852d27b7..7dba11b5e 100644 --- a/docs/pages/layer_by_layer.adoc +++ b/docs/pages/layer_by_layer.adoc @@ -76,7 +76,7 @@ The async version looks very similar to the HAL version, apart from a few minor * The peripheral initialization is done by the main macro, and is handed to the main task. * Before checking the button state, the application is awaiting a transition in the pin state (low -> high or high -> low). -When `button.await_for_any_edge().await` is called, the executor will pause the main task and put the microcontroller in sleep mode, unless there are other tasks that can run. Internally, the Embassy HAL has configured the interrupt handler for the button (in `ExtiInput`), so that whenever an interrupt is raised, the task awaiting the button will be woken up. +When `button.wait_for_any_edge().await` is called, the executor will pause the main task and put the microcontroller in sleep mode, unless there are other tasks that can run. Internally, the Embassy HAL has configured the interrupt handler for the button (in `ExtiInput`), so that whenever an interrupt is raised, the task awaiting the button will be woken up. The minimal overhead of the executor and the ability to run multiple tasks "concurrently" combined with the enormous simplification of the application, makes `async` a great fit for embedded. diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index 6ac0e0b2b..a1bf180cd 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -74,7 +74,7 @@ include::embassy_in_the_wild.adoc[leveloffset = 2] For more reading material on async Rust and Embassy: -* link:https://tweedegolf.nl/en/blog/65/async-rust-vs-rtos-showdown[Comparsion of FreeRTOS and Embassy] +* link:https://tweedegolf.nl/en/blog/65/async-rust-vs-rtos-showdown[Comparison of FreeRTOS and Embassy] * link:https://dev.to/apollolabsbin/series/20707[Tutorials] * link:https://blog.drogue.io/firmware-updates-part-1/[Firmware Updates with Embassy] -- cgit From 4b809af90538b83de42d60eb6ac5b8509feaeecf Mon Sep 17 00:00:00 2001 From: Krzysztof Królczyk Date: Mon, 10 Feb 2025 16:14:51 +0100 Subject: fix: #3760 - typo in docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krzysztof Królczyk --- docs/pages/layer_by_layer.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/layer_by_layer.adoc b/docs/pages/layer_by_layer.adoc index 7852d27b7..7dba11b5e 100644 --- a/docs/pages/layer_by_layer.adoc +++ b/docs/pages/layer_by_layer.adoc @@ -76,7 +76,7 @@ The async version looks very similar to the HAL version, apart from a few minor * The peripheral initialization is done by the main macro, and is handed to the main task. * Before checking the button state, the application is awaiting a transition in the pin state (low -> high or high -> low). -When `button.await_for_any_edge().await` is called, the executor will pause the main task and put the microcontroller in sleep mode, unless there are other tasks that can run. Internally, the Embassy HAL has configured the interrupt handler for the button (in `ExtiInput`), so that whenever an interrupt is raised, the task awaiting the button will be woken up. +When `button.wait_for_any_edge().await` is called, the executor will pause the main task and put the microcontroller in sleep mode, unless there are other tasks that can run. Internally, the Embassy HAL has configured the interrupt handler for the button (in `ExtiInput`), so that whenever an interrupt is raised, the task awaiting the button will be woken up. The minimal overhead of the executor and the ability to run multiple tasks "concurrently" combined with the enormous simplification of the application, makes `async` a great fit for embedded. -- cgit From 01b7ff8ff04af62cc04331a229f5305d320907fe Mon Sep 17 00:00:00 2001 From: Krzysztof Królczyk Date: Mon, 10 Feb 2025 17:38:39 +0100 Subject: fix: layer-by-layer examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes: #3794 #3793 Remove 'blinky-irq' from workspace. During linking from workspace level - embassy-stm32 and example code redefine EXTI15_10 symbol Building it separately, outside of workspace works Signed-off-by: Krzysztof Królczyk --- docs/examples/layer-by-layer/Cargo.toml | 1 - docs/examples/layer-by-layer/blinky-async/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-hal/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-irq/Cargo.toml | 4 +++- docs/examples/layer-by-layer/blinky-pac/Cargo.toml | 2 +- docs/examples/layer-by-layer/memory.x | 5 +++++ 6 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 docs/examples/layer-by-layer/memory.x (limited to 'docs') diff --git a/docs/examples/layer-by-layer/Cargo.toml b/docs/examples/layer-by-layer/Cargo.toml index f18c9e7e4..01666ec6e 100644 --- a/docs/examples/layer-by-layer/Cargo.toml +++ b/docs/examples/layer-by-layer/Cargo.toml @@ -3,7 +3,6 @@ resolver = "2" members = [ "blinky-pac", "blinky-hal", - "blinky-irq", "blinky-async", ] diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index 51ddf87d4..541eb6edf 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -cortex-m = "0.7" +cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7" embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "exti"] } embassy-executor = { version = "0.7.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread"] } diff --git a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml index 1e292e6b4..dd574c3e7 100644 --- a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml @@ -5,8 +5,8 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -cortex-m = "0.7" cortex-m-rt = "0.7" +cortex-m = { version = "0.7", features = ["critical-section-single-core"] } embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x"] } defmt = "0.3" diff --git a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml index 04ffc23ba..8733ee894 100644 --- a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "blinky-irq" version = "0.1.0" @@ -5,7 +7,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -cortex-m = "0.7" +cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = { version = "0.7" } embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "unstable-pac"] } diff --git a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml index cf2d7fede..155c41ec6 100644 --- a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" license = "MIT OR Apache-2.0" [dependencies] -cortex-m = "0.7" +cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7" stm32-metapac = { version = "16", features = ["stm32l475vg"] } diff --git a/docs/examples/layer-by-layer/memory.x b/docs/examples/layer-by-layer/memory.x new file mode 100644 index 000000000..69f5b28a1 --- /dev/null +++ b/docs/examples/layer-by-layer/memory.x @@ -0,0 +1,5 @@ +MEMORY +{ + FLASH : ORIGIN = 0x08000000, LENGTH = 2048K /* BANK_1 */ + RAM : ORIGIN = 0x20000000, LENGTH = 640K /* SRAM */ +} -- cgit From 7a2f038800e336f4b823afca9d3eb2e70e90b1e0 Mon Sep 17 00:00:00 2001 From: Ronald Weber Date: Wed, 19 Feb 2025 17:29:21 +0100 Subject: doc: Fix "the the" --- docs/pages/new_project.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/new_project.adoc b/docs/pages/new_project.adoc index 63340016b..af1cb75c5 100644 --- a/docs/pages/new_project.adoc +++ b/docs/pages/new_project.adoc @@ -109,7 +109,7 @@ embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "7703f embassy-stm32 = { git = "https://github.com/embassy-rs/embassy", rev = "7703f47c1ecac029f603033b7977d9a2becef48c" } ---- -There are a few other dependencies we need to build the project, but fortunately they’re much simpler to install. Copy their lines from the example `Cargo.toml` to the the `[dependencies]` section in the new `Cargo.toml`: +There are a few other dependencies we need to build the project, but fortunately they’re much simpler to install. Copy their lines from the example `Cargo.toml` to the `[dependencies]` section in the new `Cargo.toml`: [source,toml] ---- -- cgit From 3525771e847ebcc14e5ce23b5f71f3f6098ae8e6 Mon Sep 17 00:00:00 2001 From: Alex Charlton Date: Thu, 6 Mar 2025 11:57:07 -0800 Subject: Add mpfs-hal references to docs --- docs/pages/hal.adoc | 2 ++ docs/pages/overview.adoc | 1 + 2 files changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/pages/hal.adoc b/docs/pages/hal.adoc index 14b85e1f1..e1a29751e 100644 --- a/docs/pages/hal.adoc +++ b/docs/pages/hal.adoc @@ -12,3 +12,5 @@ async traits in `embedded-hal` and `embedded-hal-async`. You can also use these For the ESP32 series, there is an link:https://github.com/esp-rs/esp-hal[esp-hal] which you can use. For the WCH 32-bit RISC-V series, there is an link:https://github.com/ch32-rs/ch32-hal[ch32-hal], which you can use. + +For the Microchip PolarFire SoC, there is link:https://github.com/AlexCharlton/mpfs-hal[mpfs-hal]. \ No newline at end of file diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index a1bf180cd..9b93ba10c 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -31,6 +31,7 @@ The Embassy project maintains HALs for select hardware, but you can still use HA * link:https://docs.embassy.dev/embassy-rp/[embassy-rp], for the Raspberry Pi RP2040 microcontroller. * link:https://github.com/esp-rs[esp-rs], for the Espressif Systems ESP32 series of chips. * link:https://github.com/ch32-rs/ch32-hal[ch32-hal], for the WCH 32-bit RISC-V(CH32V) series of chips. +* link:https://github.com/AlexCharlton/mpfs-hal[mpfs-hal], for the Microchip PolarFire SoC. NOTE: A common question is if one can use the Embassy HALs standalone. Yes, it is possible! There are no dependency on the executor within the HALs. You can even use them without async, as they implement both the link:https://github.com/rust-embedded/embedded-hal[Embedded HAL] blocking and async traits. -- cgit From 0f0030651c4d0fdc8809b341e9b27d7626128cf6 Mon Sep 17 00:00:00 2001 From: decaday Date: Wed, 19 Mar 2025 11:59:05 +0800 Subject: Add py32-hal to documentation --- docs/pages/hal.adoc | 4 +++- docs/pages/overview.adoc | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/hal.adoc b/docs/pages/hal.adoc index e1a29751e..3c6839792 100644 --- a/docs/pages/hal.adoc +++ b/docs/pages/hal.adoc @@ -13,4 +13,6 @@ For the ESP32 series, there is an link:https://github.com/esp-rs/esp-hal[esp-hal For the WCH 32-bit RISC-V series, there is an link:https://github.com/ch32-rs/ch32-hal[ch32-hal], which you can use. -For the Microchip PolarFire SoC, there is link:https://github.com/AlexCharlton/mpfs-hal[mpfs-hal]. \ No newline at end of file +For the Microchip PolarFire SoC, there is link:https://github.com/AlexCharlton/mpfs-hal[mpfs-hal]. + +For the Puya Semiconductor PY32 series, there is link:https://github.com/py32-rs/py32-hal[py32-hal]. \ No newline at end of file diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index 9b93ba10c..abc7d25de 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -32,6 +32,7 @@ The Embassy project maintains HALs for select hardware, but you can still use HA * link:https://github.com/esp-rs[esp-rs], for the Espressif Systems ESP32 series of chips. * link:https://github.com/ch32-rs/ch32-hal[ch32-hal], for the WCH 32-bit RISC-V(CH32V) series of chips. * link:https://github.com/AlexCharlton/mpfs-hal[mpfs-hal], for the Microchip PolarFire SoC. +* link:https://github.com/py32-rs/py32-hal[py32-hal], for the Puya Semiconductor PY32 series of chips. NOTE: A common question is if one can use the Embassy HALs standalone. Yes, it is possible! There are no dependency on the executor within the HALs. You can even use them without async, as they implement both the link:https://github.com/rust-embedded/embedded-hal[Embedded HAL] blocking and async traits. -- cgit From 9afb385f6d92149ff15cf03c3bfaa8cb512a6191 Mon Sep 17 00:00:00 2001 From: i509VCB Date: Wed, 19 Mar 2025 13:05:10 -0500 Subject: Add docs related things --- docs/pages/overview.adoc | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index 9b93ba10c..333a5dd9f 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -29,6 +29,7 @@ The Embassy project maintains HALs for select hardware, but you can still use HA * link:https://docs.embassy.dev/embassy-stm32/[embassy-stm32], for all STM32 microcontroller families. * link:https://docs.embassy.dev/embassy-nrf/[embassy-nrf], for the Nordic Semiconductor nRF52, nRF53, nRF91 series. * link:https://docs.embassy.dev/embassy-rp/[embassy-rp], for the Raspberry Pi RP2040 microcontroller. +* link:https://docs.embassy.dev/embassy-mspm0/[embassy-mspm0], for the Texas Instruments MSPM0 microcontrollers. * link:https://github.com/esp-rs[esp-rs], for the Espressif Systems ESP32 series of chips. * link:https://github.com/ch32-rs/ch32-hal[ch32-hal], for the WCH 32-bit RISC-V(CH32V) series of chips. * link:https://github.com/AlexCharlton/mpfs-hal[mpfs-hal], for the Microchip PolarFire SoC. -- cgit From aa5ecbdb56aa5c3cf35d5c0512c0a0e2a3739cee Mon Sep 17 00:00:00 2001 From: Dániel Buga Date: Mon, 31 Mar 2025 13:16:11 +0200 Subject: Remove task arena FAQ --- docs/pages/faq.adoc | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index f95ccf48b..88e0c3330 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -169,29 +169,6 @@ Note that the git revision should match any other embassy patches or git depende ** make `main` spawn everything, then enable link:https://docs.rs/cortex-m/latest/cortex_m/peripheral/struct.SCB.html#method.set_sleeponexit[SCB.SLEEPONEXIT] and `loop { cortex_m::asm::wfi() }` ** *Note:* If you need 2 priority levels, using 2 interrupt executors is better than 1 thread executor + 1 interrupt executor. -== How do I set up the task arenas on stable? - -When you aren't using the `nightly` feature of `embassy-executor`, the executor uses a bump allocator, which may require configuration. - -Something like this error will occur at **compile time** if the task arena is *too large* for the target's RAM: - -[source,plain] ----- -rust-lld: error: section '.bss' will not fit in region 'RAM': overflowed by _ bytes -rust-lld: error: section '.uninit' will not fit in region 'RAM': overflowed by _ bytes ----- - -And this message will appear at **runtime** if the task arena is *too small* for the tasks running: - -[source,plain] ----- -ERROR panicked at 'embassy-executor: task arena is full. You must increase the arena size, see the documentation for details: https://docs.embassy.dev/embassy-executor/' ----- - -NOTE: If all tasks are spawned at startup, this panic will occur immediately. - -Check out link:https://docs.embassy.dev/embassy-executor/git/cortex-m/index.html#task-arena[Task Arena Documentation] for more details. - == Can I use manual ISRs alongside Embassy? Yes! This can be useful if you need to respond to an event as fast as possible, and the latency caused by the usual “ISR, wake, return from ISR, context switch to woken task” flow is too much for your application. Simply define a `#[interrupt] fn INTERRUPT_NAME() {}` handler as you would link:https://docs.rust-embedded.org/book/start/interrupts.html[in any other embedded rust project]. -- cgit From aa9a16e569dfb56ce2b689733975f4d854af0b00 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Thu, 3 Apr 2025 08:47:25 -0700 Subject: Add embassy-imxrt Adds initial support for MIMXRT600 series MCUs from NXP. Subsequent PRs will add more drivers. --- docs/pages/imxrt.adoc | 13 +++++++++++++ docs/pages/system.adoc | 1 + 2 files changed, 14 insertions(+) create mode 100644 docs/pages/imxrt.adoc (limited to 'docs') diff --git a/docs/pages/imxrt.adoc b/docs/pages/imxrt.adoc new file mode 100644 index 000000000..adf5218e8 --- /dev/null +++ b/docs/pages/imxrt.adoc @@ -0,0 +1,13 @@ += Embassy iMXRT HAL + +The link: link:https://github.com/embassy-rs/embassy/tree/main/embassy-imxrt[Embassy iMXRT HAL] is based on the following PACs (Peripheral Access Crate): + +* link:https://github.com/OpenDevicePartnership/mimxrt685s-pac[mimxrt685s-pac] +* link:https://github.com/OpenDevicePartnership/mimxrt633s-pac[mimxrt633s-pac] + +== Peripherals + +The following peripherals have a HAL implementation at present + +* GPIO + diff --git a/docs/pages/system.adoc b/docs/pages/system.adoc index 985f92b18..09241a8df 100644 --- a/docs/pages/system.adoc +++ b/docs/pages/system.adoc @@ -6,6 +6,7 @@ include::runtime.adoc[leveloffset = 2] include::bootloader.adoc[leveloffset = 2] include::time_keeping.adoc[leveloffset = 2] include::hal.adoc[leveloffset = 2] +include::imxrt.adoc[leveloffset = 2] include::nrf.adoc[leveloffset = 2] include::stm32.adoc[leveloffset = 2] include::sharing_peripherals.adoc[leveloffset = 2] -- cgit From 6719e1305921c08fcfba7e8f48e315ef8b676c6e Mon Sep 17 00:00:00 2001 From: 1-rafael-1 Date: Sun, 13 Apr 2025 22:23:07 +0200 Subject: update documentation and examples to mention RP235x --- docs/pages/faq.adoc | 2 +- docs/pages/hal.adoc | 2 +- docs/pages/overview.adoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index 88e0c3330..3b5eafa99 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -4,7 +4,7 @@ These are a list of unsorted, commonly asked questions and answers. Please feel free to add items to link:https://github.com/embassy-rs/embassy/edit/main/docs/pages/faq.adoc[this page], especially if someone in the chat answered a question for you! -== How to deploy to RP2040 without a debugging probe. +== How to deploy to RP2040 or RP235x without a debugging probe. Install link:https://github.com/JoNil/elf2uf2-rs[elf2uf2-rs] for converting the generated elf binary into a uf2 file. diff --git a/docs/pages/hal.adoc b/docs/pages/hal.adoc index 3c6839792..3bbe94e02 100644 --- a/docs/pages/hal.adoc +++ b/docs/pages/hal.adoc @@ -4,7 +4,7 @@ Embassy provides HALs for several microcontroller families: * `embassy-nrf` for the nRF microcontrollers from Nordic Semiconductor * `embassy-stm32` for STM32 microcontrollers from ST Microelectronics -* `embassy-rp` for the Raspberry Pi RP2040 microcontrollers +* `embassy-rp` for the Raspberry Pi RP2040 and RP235x microcontrollers These HALs implement async/await functionality for most peripherals while also implementing the async traits in `embedded-hal` and `embedded-hal-async`. You can also use these HALs with another executor. diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index b169c686e..acd757795 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -28,7 +28,7 @@ The Embassy project maintains HALs for select hardware, but you can still use HA * link:https://docs.embassy.dev/embassy-stm32/[embassy-stm32], for all STM32 microcontroller families. * link:https://docs.embassy.dev/embassy-nrf/[embassy-nrf], for the Nordic Semiconductor nRF52, nRF53, nRF91 series. -* link:https://docs.embassy.dev/embassy-rp/[embassy-rp], for the Raspberry Pi RP2040 microcontroller. +* link:https://docs.embassy.dev/embassy-rp/[embassy-rp], for the Raspberry Pi RP2040 as well as RP235x microcontroller. * link:https://docs.embassy.dev/embassy-mspm0/[embassy-mspm0], for the Texas Instruments MSPM0 microcontrollers. * link:https://github.com/esp-rs[esp-rs], for the Espressif Systems ESP32 series of chips. * link:https://github.com/ch32-rs/ch32-hal[ch32-hal], for the WCH 32-bit RISC-V(CH32V) series of chips. -- cgit From 8b565fc85e88bf8cf43024bd02df1640b10af728 Mon Sep 17 00:00:00 2001 From: Marc Poulhiès Date: Wed, 16 Apr 2025 21:40:30 +0200 Subject: Fix link in faq.adoc Looks like a link was using markdown instead of asciidoc. --- docs/pages/faq.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index 3b5eafa99..a535e89f8 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -212,7 +212,7 @@ _stack_start = ORIGIN(RAM) + LENGTH(RAM); Please refer to the STM32 documentation for the specific values suitable for your board and setup. The STM32 Cube examples often contain a linker script `.ld` file. Look for the `MEMORY` section and try to determine the FLASH and RAM sizes and section start. -If you find a case where the memory.x is wrong, please report it on [this Github issue](https://github.com/embassy-rs/stm32-data/issues/301) so other users are not caught by surprise. +If you find a case where the memory.x is wrong, please report it on link:https://github.com/embassy-rs/stm32-data/issues/301[this Github issue] so other users are not caught by surprise. == The USB examples are not working on my board, is there anything else I need to configure? -- cgit From e5c03e1e791bf3460fe6e0af65a02f2259763eaa Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 2 May 2025 17:56:32 -0400 Subject: chore: use `probe-rs` instead of `probe-run` I found a few remaining deprecated `probe-run` cases. --- docs/examples/basic/.cargo/config.toml | 4 ++-- docs/examples/layer-by-layer/.cargo/config.toml | 3 ++- docs/pages/getting_started.adoc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/examples/basic/.cargo/config.toml b/docs/examples/basic/.cargo/config.toml index 8ca28df39..17616a054 100644 --- a/docs/examples/basic/.cargo/config.toml +++ b/docs/examples/basic/.cargo/config.toml @@ -1,6 +1,6 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -# replace nRF82840_xxAA with your chip as listed in `probe-run --list-chips` -runner = "probe-run --chip nRF52840_xxAA" +# replace nRF82840_xxAA with your chip as listed in `probe-rs chip list` +runner = "probe-rs run --chip nRF52840_xxAA" [build] target = "thumbv7em-none-eabi" diff --git a/docs/examples/layer-by-layer/.cargo/config.toml b/docs/examples/layer-by-layer/.cargo/config.toml index 3012f05dc..f30d9e446 100644 --- a/docs/examples/layer-by-layer/.cargo/config.toml +++ b/docs/examples/layer-by-layer/.cargo/config.toml @@ -1,5 +1,6 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "probe-run --chip STM32L475VG" +# replace your chip as listed in `probe-rs chip list` +runner = "probe-rs run --chip STM32L475VG" rustflags = [ "-C", "link-arg=--nmagic", diff --git a/docs/pages/getting_started.adoc b/docs/pages/getting_started.adoc index 954f3fd28..d1f65a885 100644 --- a/docs/pages/getting_started.adoc +++ b/docs/pages/getting_started.adoc @@ -66,7 +66,7 @@ If everything worked correctly, you should see a blinking LED on your board, and [source] ---- Finished dev [unoptimized + debuginfo] target(s) in 1m 56s - Running `probe-run --chip STM32F407VGTx target/thumbv7em-none-eabi/debug/blinky` + Running `probe-rs run --chip STM32F407VGTx target/thumbv7em-none-eabi/debug/blinky` (HOST) INFO flashing program (71.36 KiB) (HOST) INFO success! ──────────────────────────────────────────────────────────────────────────────── -- cgit From 0406b83c526f03567863d80a603db77c514df27f Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Sun, 4 May 2025 09:39:35 +0900 Subject: Tweak the example `rust-toolchain.toml` in doc --- docs/pages/project_structure.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/pages/project_structure.adoc b/docs/pages/project_structure.adoc index 722ec8d9d..227508b97 100644 --- a/docs/pages/project_structure.adoc +++ b/docs/pages/project_structure.adoc @@ -85,9 +85,9 @@ A minimal example: [source,toml] ---- [toolchain] -channel = "nightly-2023-08-19" # <- as of writing, this is the exact rust version embassy uses +channel = "1.85" # <- as of writing, this is the exact rust version embassy uses components = [ "rust-src", "rustfmt" ] # <- optionally add "llvm-tools-preview" for some extra features like "cargo size" targets = [ - "thumbv6m-none-eabi" # <-change for your platform + "thumbv6m-none-eabi" # <- change for your platform ] ---- -- cgit From a42fa0a67aef90453b239b62b81df8db20664c87 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Sun, 4 May 2025 09:54:37 +0900 Subject: Tweak --- docs/pages/new_project.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/new_project.adoc b/docs/pages/new_project.adoc index af1cb75c5..cd943b4f6 100644 --- a/docs/pages/new_project.adoc +++ b/docs/pages/new_project.adoc @@ -150,7 +150,7 @@ stm32g474-example # Before upgrading check that everything is available on all tier1 targets here: # https://rust-lang.github.io/rustup-components-history [toolchain] -channel = "nightly-2023-11-01" +channel = "1.85" components = [ "rust-src", "rustfmt", "llvm-tools", "miri" ] targets = ["thumbv7em-none-eabi"] ---- -- cgit From 0460a924ac06a7dd33b4e50396948ba9bcb5374e Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Tue, 6 May 2025 09:09:22 +0900 Subject: chore: Wrap link_section attribute with unsafe --- docs/pages/faq.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index a535e89f8..b21be9a30 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -268,7 +268,7 @@ General steps: 1. Find out which memory region BDMA has access to. You can get this information from the bus matrix and the memory mapping table in the STM32 datasheet. 2. Add the memory region to `memory.x`, you can modify the generated one from https://github.com/embassy-rs/stm32-data-generated/tree/main/data/chips. 3. You might need to modify `build.rs` to make cargo pick up the modified `memory.x`. -4. In your code, access the defined memory region using `#[link_section = ".xxx"]` +4. In your code, access the defined memory region using `#[unsafe(link_section = ".xxx")]` 5. Copy data to that region before using BDMA. See link:https://github.com/embassy-rs/embassy/blob/main/examples/stm32h7/src/bin/spi_bdma.rs[SMT32H7 SPI BDMA example] for more details. -- cgit From d4c378e059443dbaaaece02a0f5148db62bd4484 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Fri, 11 Apr 2025 14:28:59 -0700 Subject: Add embassy-imxrt CRC driver --- docs/pages/imxrt.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/imxrt.adoc b/docs/pages/imxrt.adoc index adf5218e8..a84fbae03 100644 --- a/docs/pages/imxrt.adoc +++ b/docs/pages/imxrt.adoc @@ -9,5 +9,5 @@ The link: link:https://github.com/embassy-rs/embassy/tree/main/embassy-imxrt[Emb The following peripherals have a HAL implementation at present +* CRC * GPIO - -- cgit From 8e7e4332b40707e8d36338ad8ec486320bb3538f Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Fri, 11 Apr 2025 15:03:53 -0700 Subject: Add embassy-imxrt RNG driver --- docs/pages/imxrt.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/imxrt.adoc b/docs/pages/imxrt.adoc index adf5218e8..9fcb6725c 100644 --- a/docs/pages/imxrt.adoc +++ b/docs/pages/imxrt.adoc @@ -10,4 +10,4 @@ The link: link:https://github.com/embassy-rs/embassy/tree/main/embassy-imxrt[Emb The following peripherals have a HAL implementation at present * GPIO - +* RNG -- cgit From d64ae225b30bc3a0f7a9b1277188b6e60fc97484 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Thu, 10 Apr 2025 10:39:54 -0700 Subject: Add UART and DMA drivers Both blocking and async versions are supported. Add separate examples for each mode. --- docs/pages/imxrt.adoc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/pages/imxrt.adoc b/docs/pages/imxrt.adoc index bbd65e494..87867e1e0 100644 --- a/docs/pages/imxrt.adoc +++ b/docs/pages/imxrt.adoc @@ -10,5 +10,7 @@ The link: link:https://github.com/embassy-rs/embassy/tree/main/embassy-imxrt[Emb The following peripherals have a HAL implementation at present * CRC +* DMA * GPIO * RNG +* UART -- cgit From ef0f29f0ede245671ffd82fcf384a9105f174c24 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sun, 18 May 2025 20:51:15 +0200 Subject: Update defmt dependencies --- docs/examples/basic/Cargo.toml | 6 +++--- docs/examples/layer-by-layer/blinky-async/Cargo.toml | 6 +++--- docs/examples/layer-by-layer/blinky-hal/Cargo.toml | 6 +++--- docs/examples/layer-by-layer/blinky-irq/Cargo.toml | 6 +++--- docs/examples/layer-by-layer/blinky-pac/Cargo.toml | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 705c334a7..f5cf2b231 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -10,9 +10,9 @@ embassy-executor = { version = "0.7.0", path = "../../../embassy-executor", feat embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } embassy-nrf = { version = "0.3.1", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } -defmt = "0.3" -defmt-rtt = "0.3" +defmt = "1.0.1" +defmt-rtt = "1.0.0" cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } cortex-m-rt = "0.7.0" -panic-probe = { version = "0.3", features = ["print-defmt"] } +panic-probe = { version = "1.0.0", features = ["print-defmt"] } diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index 541eb6edf..2a6741b33 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -10,6 +10,6 @@ cortex-m-rt = "0.7" embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "exti"] } embassy-executor = { version = "0.7.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3.0", features = ["print-defmt"] } +defmt = "1.0.1" +defmt-rtt = "1.0.0" +panic-probe = { version = "1.0.0", features = ["print-defmt"] } diff --git a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml index dd574c3e7..9a261f804 100644 --- a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml @@ -9,6 +9,6 @@ cortex-m-rt = "0.7" cortex-m = { version = "0.7", features = ["critical-section-single-core"] } embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3.0", features = ["print-defmt"] } +defmt = "1.0.1" +defmt-rtt = "1.0.0" +panic-probe = { version = "1.0.0", features = ["print-defmt"] } diff --git a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml index 8733ee894..c3ec9ad1a 100644 --- a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml @@ -11,6 +11,6 @@ cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = { version = "0.7" } embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "unstable-pac"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3.0", features = ["print-defmt"] } +defmt = "1.0.1" +defmt-rtt = "1.0.0" +panic-probe = { version = "1.0.0", features = ["print-defmt"] } diff --git a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml index 155c41ec6..4e7e2f2ff 100644 --- a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml @@ -9,6 +9,6 @@ cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7" stm32-metapac = { version = "16", features = ["stm32l475vg"] } -defmt = "0.3" -defmt-rtt = "0.4" -panic-probe = { version = "0.3.0", features = ["print-defmt"] } +defmt = "1.0.1" +defmt-rtt = "1.0.0" +panic-probe = { version = "1.0.0", features = ["print-defmt"] } -- cgit From 035040e53cba24d7a15a055b605d50c568eb9e57 Mon Sep 17 00:00:00 2001 From: Nathan Vander Wilt Date: Tue, 27 May 2025 11:38:11 -0700 Subject: Update layer_by_layer.adoc to clarify PAC limitations proposed fix for #4226, re. https://github.com/embassy-rs/embassy/issues/4226#issuecomment-2908772500 --- docs/pages/layer_by_layer.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/layer_by_layer.adoc b/docs/pages/layer_by_layer.adoc index 7dba11b5e..0692ee4fa 100644 --- a/docs/pages/layer_by_layer.adoc +++ b/docs/pages/layer_by_layer.adoc @@ -8,7 +8,7 @@ The application we'll write is a simple 'push button, blink led' application, wh == PAC version -The PAC is the lowest API for accessing peripherals and registers, if you don't count reading/writing directly to memory addresses. It provides distinct types to make accessing peripheral registers easier, but it does not prevent you from writing unsafe code. +The PAC is the lowest API for accessing peripherals and registers, if you don't count reading/writing directly to memory addresses. It provides distinct types to make accessing peripheral registers easier, but it does little to prevent you from configuring or coordinating those registers incorrectly. Writing an application using the PAC directly is therefore not recommended, but if the functionality you want to use is not exposed in the upper layers, that's what you need to use. -- cgit From 69abc42077e6de4453d422330a9a07407a36f218 Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Sun, 1 Jun 2025 00:08:09 +1000 Subject: doc: add high-level embassy-boot a-b info --- docs/pages/bootloader.adoc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs') diff --git a/docs/pages/bootloader.adoc b/docs/pages/bootloader.adoc index 53f85d995..b0f0331aa 100644 --- a/docs/pages/bootloader.adoc +++ b/docs/pages/bootloader.adoc @@ -2,6 +2,13 @@ `embassy-boot` a lightweight bootloader supporting firmware application upgrades in a power-fail-safe way, with trial boots and rollbacks. +The update method used is referred to as an A/B partition update scheme. + +With a general-purpose OS, A/B partition update is accomplished by directly booting either the A or B partition depending on the update state. +To accomplish the same goal in a way that is portable across all microcontrollers, `embassy-boot` swaps data page by page (in both directions) between the DFU and the Active partition when a firmware update is triggered. + +Because the original Active application is moved into the DFU partition during this update, the operation can be reversed if the update is interrupted or the new firmware does not flag that it booted successfully. + +See the design section for more details on how this is implemented. + The bootloader can be used either as a library or be flashed directly if you are happy with the default configuration and capabilities. By design, the bootloader does not provide any network capabilities. Networking capabilities for fetching new firmware can be provided by the user application, using the bootloader as a library for updating the firmware, or by using the bootloader as a library and adding this capability yourself. -- cgit From f84792aaa7212a38f721ad7f2533f54970f5c298 Mon Sep 17 00:00:00 2001 From: paul fornage Date: Fri, 20 Jun 2025 07:47:30 -0700 Subject: Add syntax highlighter --- docs/index.adoc | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/index.adoc b/docs/index.adoc index 9c6150196..80754d5a4 100644 --- a/docs/index.adoc +++ b/docs/index.adoc @@ -5,6 +5,7 @@ :toc-placement: left :toclevels: 2 :imagesdir: images +:source-highlighter: rouge # Embassy Book -- cgit From 5da6e31a3e4a1175ddf34e1ebdf83a8d685ea521 Mon Sep 17 00:00:00 2001 From: Dániel Buga Date: Tue, 24 Jun 2025 16:19:33 +0200 Subject: Correct esp-hal link --- docs/pages/overview.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/pages/overview.adoc b/docs/pages/overview.adoc index acd757795..18eaaeb75 100644 --- a/docs/pages/overview.adoc +++ b/docs/pages/overview.adoc @@ -30,7 +30,7 @@ The Embassy project maintains HALs for select hardware, but you can still use HA * link:https://docs.embassy.dev/embassy-nrf/[embassy-nrf], for the Nordic Semiconductor nRF52, nRF53, nRF91 series. * link:https://docs.embassy.dev/embassy-rp/[embassy-rp], for the Raspberry Pi RP2040 as well as RP235x microcontroller. * link:https://docs.embassy.dev/embassy-mspm0/[embassy-mspm0], for the Texas Instruments MSPM0 microcontrollers. -* link:https://github.com/esp-rs[esp-rs], for the Espressif Systems ESP32 series of chips. +* link:https://github.com/esp-rs/esp-hal[esp-hal], for the Espressif Systems ESP32 series of chips. * link:https://github.com/ch32-rs/ch32-hal[ch32-hal], for the WCH 32-bit RISC-V(CH32V) series of chips. * link:https://github.com/AlexCharlton/mpfs-hal[mpfs-hal], for the Microchip PolarFire SoC. * link:https://github.com/py32-rs/py32-hal[py32-hal], for the Puya Semiconductor PY32 series of chips. -- cgit From 8d2657383e29c78bd6b4a4dd7c2977ee970c636d Mon Sep 17 00:00:00 2001 From: Dániel Buga Date: Wed, 2 Jul 2025 10:33:16 +0200 Subject: Link to esp-generate --- docs/pages/new_project.adoc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/pages/new_project.adoc b/docs/pages/new_project.adoc index cd943b4f6..906d89f36 100644 --- a/docs/pages/new_project.adoc +++ b/docs/pages/new_project.adoc @@ -11,6 +11,8 @@ Once you’ve successfully xref:#_getting_started[run some example projects], th - link:https://github.com/lulf/embassy-template[embassy-template] (STM32, NRF, and RP) - link:https://github.com/bentwire/embassy-rp2040-template[embassy-rp2040-template] (RP) +=== esp-generate +- link:https://github.com/esp-rs/esp-generate[esp-generate] (ESP32 using esp-hal) == Starting a project from scratch -- cgit From 1df59ffec4eed74ade4086da496a32d376e4190a Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 14 Jul 2025 11:40:51 +0200 Subject: chore: update to `embassy-nrf` v0.4.0 --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index f5cf2b231..09fc517e7 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" [dependencies] embassy-executor = { version = "0.7.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } -embassy-nrf = { version = "0.3.1", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } +embassy-nrf = { version = "0.4.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "1.0.1" defmt-rtt = "1.0.0" -- cgit From c7e33b28b8134662a0e0cf3e7215a78a00b2f1dd Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 14 Jul 2025 11:50:13 +0200 Subject: Revert "chore: update to `embassy-nrf` v0.4.0" This reverts commit 1df59ffec4eed74ade4086da496a32d376e4190a. --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 09fc517e7..f5cf2b231 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" [dependencies] embassy-executor = { version = "0.7.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } -embassy-nrf = { version = "0.4.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } +embassy-nrf = { version = "0.3.1", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "1.0.1" defmt-rtt = "1.0.0" -- cgit From 4f50c85221f11eecb334169e98d96b7fb94a2753 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 14 Jul 2025 11:40:51 +0200 Subject: chore: update to `embassy-nrf` v0.4.0 --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index f5cf2b231..09fc517e7 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" [dependencies] embassy-executor = { version = "0.7.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } -embassy-nrf = { version = "0.3.1", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } +embassy-nrf = { version = "0.4.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "1.0.1" defmt-rtt = "1.0.0" -- cgit From 8c087e3641e2bf1f863c73a388b2f483051e6b29 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 16 Jul 2025 15:47:37 +0200 Subject: chore: release embassy-nrf 0.5.0 and embassy-rp 0.6.0 --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 09fc517e7..c4b72d81a 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" [dependencies] embassy-executor = { version = "0.7.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } -embassy-nrf = { version = "0.4.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } +embassy-nrf = { version = "0.5.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "1.0.1" defmt-rtt = "1.0.0" -- cgit From 3f1ddaf60e8fe2ce330ab7d5fefdf4814348df9e Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Thu, 31 Jul 2025 10:32:01 +0200 Subject: chore: prepare embassy-executor 0.8 release --- docs/examples/basic/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-async/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index c4b72d81a..32e326134 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -6,7 +6,7 @@ version = "0.1.0" license = "MIT OR Apache-2.0" [dependencies] -embassy-executor = { version = "0.7.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } +embassy-executor = { version = "0.8.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } embassy-nrf = { version = "0.5.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index 2a6741b33..7a9782960 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7" embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "exti"] } -embassy-executor = { version = "0.7.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread"] } +embassy-executor = { version = "0.8.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread"] } defmt = "1.0.1" defmt-rtt = "1.0.0" -- cgit From 9ca44b519ac707f8a95fba55d72d4bf09ccb44c0 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 4 Aug 2025 14:07:30 +0200 Subject: chore: bump nrf and rp hal versions --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 32e326134..15fd42703 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" [dependencies] embassy-executor = { version = "0.8.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } -embassy-nrf = { version = "0.5.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } +embassy-nrf = { version = "0.6.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "1.0.1" defmt-rtt = "1.0.0" -- cgit From 794477eca3062471a2cdc378730b5c2952cfd2c3 Mon Sep 17 00:00:00 2001 From: Rob Wells Date: Mon, 11 Aug 2025 19:56:31 +0100 Subject: book: Suggest Picotool for RP chips instead of elf2uf2-rs --- docs/pages/faq.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index b21be9a30..8098e12ac 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc @@ -6,16 +6,16 @@ Please feel free to add items to link:https://github.com/embassy-rs/embassy/edit == How to deploy to RP2040 or RP235x without a debugging probe. -Install link:https://github.com/JoNil/elf2uf2-rs[elf2uf2-rs] for converting the generated elf binary into a uf2 file. +Install link:https://github.com/raspberrypi/pico-sdk-tools/releases[Picotool] for uploading the binary. Configure the runner to use this tool, add this to `.cargo/config.toml`: [source,toml] ---- [target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "elf2uf2-rs --deploy --serial --verbose" +runner = "picotool load --update --verify --execute -t elf" ---- -The command-line parameters `--deploy` will detect your device and upload the binary, `--serial` starts a serial connection. See the documentation for more info. +Picotool will detect your device and upload the binary, skipping identical flash sectors (the `--update` command-line flag), verify that the binary was written correctly (`--verify`), and then run your new code (`--execute`). Run `picotool help load` for more information. == Missing main macro @@ -209,7 +209,7 @@ MEMORY _stack_start = ORIGIN(RAM) + LENGTH(RAM); ``` -Please refer to the STM32 documentation for the specific values suitable for your board and setup. The STM32 Cube examples often contain a linker script `.ld` file. +Please refer to the STM32 documentation for the specific values suitable for your board and setup. The STM32 Cube examples often contain a linker script `.ld` file. Look for the `MEMORY` section and try to determine the FLASH and RAM sizes and section start. If you find a case where the memory.x is wrong, please report it on link:https://github.com/embassy-rs/stm32-data/issues/301[this Github issue] so other users are not caught by surprise. @@ -334,7 +334,7 @@ There are two main ways to handle concurrency in Embassy: In general, either of these approaches will work. The main differences of these approaches are: -When using **separate tasks**, each task needs its own RAM allocation, so there's a little overhead for each task, so one task that does three things will likely be a little bit smaller than three tasks that do one thing (not a lot, probably a couple dozen bytes). In contrast, with **multiple futures in one task**, you don't need multiple task allocations, and it will generally be easier to share data, or use borrowed resources, inside of a single task. +When using **separate tasks**, each task needs its own RAM allocation, so there's a little overhead for each task, so one task that does three things will likely be a little bit smaller than three tasks that do one thing (not a lot, probably a couple dozen bytes). In contrast, with **multiple futures in one task**, you don't need multiple task allocations, and it will generally be easier to share data, or use borrowed resources, inside of a single task. An example showcasing some methods for sharing things between tasks link:https://github.com/embassy-rs/embassy/blob/main/examples/rp/src/bin/sharing.rs[can be found here]. But when it comes to "waking" tasks, for example when a data transfer is complete or a button is pressed, it's faster to wake a dedicated task, because that task does not need to check which future is actually ready. `join` and `select` must check ALL of the futures they are managing to see which one (or which ones) are ready to do more work. This is because all Rust executors (like Embassy or Tokio) only have the ability to wake tasks, not specific futures. This means you will use slightly less CPU time juggling futures when using dedicated tasks. -- cgit From c4c5167e3d18eafee7726a526093bed2b3d2d119 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Tue, 12 Aug 2025 18:16:50 +0200 Subject: chore: update metapac and prepare embassy-stm32 0.3.0 --- docs/examples/layer-by-layer/blinky-async/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-hal/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-irq/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index 7a9782960..dd0adf938 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" [dependencies] cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7" -embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "exti"] } +embassy-stm32 = { version = "0.3.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "exti"] } embassy-executor = { version = "0.8.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread"] } defmt = "1.0.1" diff --git a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml index 9a261f804..55795e4e2 100644 --- a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" [dependencies] cortex-m-rt = "0.7" cortex-m = { version = "0.7", features = ["critical-section-single-core"] } -embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x"] } +embassy-stm32 = { version = "0.3.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x"] } defmt = "1.0.1" defmt-rtt = "1.0.0" diff --git a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml index c3ec9ad1a..4a4bda4c4 100644 --- a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" [dependencies] cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = { version = "0.7" } -embassy-stm32 = { version = "0.2.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "unstable-pac"] } +embassy-stm32 = { version = "0.3.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "unstable-pac"] } defmt = "1.0.1" defmt-rtt = "1.0.0" -- cgit From 3a6ea3a31c90179fb3cbd30c18e3a310e2ee647c Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Fri, 15 Aug 2025 19:01:56 +0200 Subject: Load all crates in the graph, honor the "publish" flag to prevent publishing examples/tests. --- docs/examples/basic/Cargo.toml | 6 ++++++ docs/examples/layer-by-layer/blinky-async/Cargo.toml | 6 ++++++ docs/examples/layer-by-layer/blinky-hal/Cargo.toml | 6 ++++++ docs/examples/layer-by-layer/blinky-irq/Cargo.toml | 6 ++++++ docs/examples/layer-by-layer/blinky-pac/Cargo.toml | 6 ++++++ 5 files changed, 30 insertions(+) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 15fd42703..5fb137898 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -5,6 +5,7 @@ name = "embassy-basic-example" version = "0.1.0" license = "MIT OR Apache-2.0" +publish = false [dependencies] embassy-executor = { version = "0.8.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } @@ -16,3 +17,8 @@ defmt-rtt = "1.0.0" cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } cortex-m-rt = "0.7.0" panic-probe = { version = "1.0.0", features = ["print-defmt"] } + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi" } +] diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index dd0adf938..f1f678df3 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" +publish = false [dependencies] cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7" @@ -13,3 +14,8 @@ embassy-executor = { version = "0.8.0", path = "../../../../embassy-executor", f defmt = "1.0.1" defmt-rtt = "1.0.0" panic-probe = { version = "1.0.0", features = ["print-defmt"] } + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi" } +] diff --git a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml index 55795e4e2..cdfc4b850 100644 --- a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" +publish = false [dependencies] cortex-m-rt = "0.7" cortex-m = { version = "0.7", features = ["critical-section-single-core"] } @@ -12,3 +13,8 @@ embassy-stm32 = { version = "0.3.0", path = "../../../../embassy-stm32", feature defmt = "1.0.1" defmt-rtt = "1.0.0" panic-probe = { version = "1.0.0", features = ["print-defmt"] } + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi" } +] diff --git a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml index 4a4bda4c4..b15b228fc 100644 --- a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml @@ -6,6 +6,7 @@ version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" +publish = false [dependencies] cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = { version = "0.7" } @@ -14,3 +15,8 @@ embassy-stm32 = { version = "0.3.0", path = "../../../../embassy-stm32", feature defmt = "1.0.1" defmt-rtt = "1.0.0" panic-probe = { version = "1.0.0", features = ["print-defmt"] } + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi" } +] diff --git a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml index 4e7e2f2ff..0d4711da2 100644 --- a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" +publish = false [dependencies] cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7" @@ -12,3 +13,8 @@ stm32-metapac = { version = "16", features = ["stm32l475vg"] } defmt = "1.0.1" defmt-rtt = "1.0.0" panic-probe = { version = "1.0.0", features = ["print-defmt"] } + +[package.metadata.embassy] +build = [ + { target = "thumbv7em-none-eabi" } +] -- cgit From 83f2557eacd657070a84a9baf2da6e3aff03b2b7 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Tue, 26 Aug 2025 16:04:00 +0200 Subject: chore: prepare embassy crate releases --- docs/examples/basic/Cargo.toml | 6 +++--- docs/examples/layer-by-layer/blinky-async/Cargo.toml | 4 ++-- docs/examples/layer-by-layer/blinky-hal/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-irq/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index 5fb137898..b6dbeda2a 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0" publish = false [dependencies] -embassy-executor = { version = "0.8.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } -embassy-time = { version = "0.4.0", path = "../../../embassy-time", features = ["defmt"] } -embassy-nrf = { version = "0.6.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } +embassy-executor = { version = "0.9.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } +embassy-time = { version = "0.5.0", path = "../../../embassy-time", features = ["defmt"] } +embassy-nrf = { version = "0.7.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "1.0.1" defmt-rtt = "1.0.0" diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index f1f678df3..ec718022c 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -8,8 +8,8 @@ publish = false [dependencies] cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7" -embassy-stm32 = { version = "0.3.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "exti"] } -embassy-executor = { version = "0.8.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread"] } +embassy-stm32 = { version = "0.4.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "exti"] } +embassy-executor = { version = "0.9.0", path = "../../../../embassy-executor", features = ["arch-cortex-m", "executor-thread"] } defmt = "1.0.1" defmt-rtt = "1.0.0" diff --git a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml index cdfc4b850..4a0b03a83 100644 --- a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] cortex-m-rt = "0.7" cortex-m = { version = "0.7", features = ["critical-section-single-core"] } -embassy-stm32 = { version = "0.3.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x"] } +embassy-stm32 = { version = "0.4.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x"] } defmt = "1.0.1" defmt-rtt = "1.0.0" diff --git a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml index b15b228fc..3c4bf8446 100644 --- a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml @@ -10,7 +10,7 @@ publish = false [dependencies] cortex-m = { version = "0.7", features = ["critical-section-single-core"] } cortex-m-rt = { version = "0.7" } -embassy-stm32 = { version = "0.3.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "unstable-pac"] } +embassy-stm32 = { version = "0.4.0", path = "../../../../embassy-stm32", features = ["stm32l475vg", "memory-x", "unstable-pac"] } defmt = "1.0.1" defmt-rtt = "1.0.0" -- cgit From 8aec341f28a00012e1771d5c35d2647e11830755 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 9 Jul 2025 01:49:31 +0200 Subject: executor: return error when creating the spawntoken, not when spawning. --- docs/examples/basic/src/main.rs | 2 +- docs/pages/sharing_peripherals.adoc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/examples/basic/src/main.rs b/docs/examples/basic/src/main.rs index 4412712c8..6e274bacb 100644 --- a/docs/examples/basic/src/main.rs +++ b/docs/examples/basic/src/main.rs @@ -22,5 +22,5 @@ async fn main(spawner: Spawner) { let p = embassy_nrf::init(Default::default()); let led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); - unwrap!(spawner.spawn(blinker(led, Duration::from_millis(300)))); + spawner.spawn(unwrap!(blinker(led, Duration::from_millis(300)))); } diff --git a/docs/pages/sharing_peripherals.adoc b/docs/pages/sharing_peripherals.adoc index dfb8c1ffe..70b4210e6 100644 --- a/docs/pages/sharing_peripherals.adoc +++ b/docs/pages/sharing_peripherals.adoc @@ -36,8 +36,8 @@ async fn main(spawner: Spawner) { let dt = 100 * 1_000_000; let k = 1.003; - unwrap!(spawner.spawn(toggle_led(&LED, Duration::from_nanos(dt)))); - unwrap!(spawner.spawn(toggle_led(&LED, Duration::from_nanos((dt as f64 * k) as u64)))); + spawner.spawn(unwrap!(toggle_led(&LED, Duration::from_nanos(dt)))); + spawner.spawn(unwrap!(toggle_led(&LED, Duration::from_nanos((dt as f64 * k) as u64)))); } // A pool size of 2 means you can spawn two instances of this task. @@ -103,8 +103,8 @@ async fn main(spawner: Spawner) { let dt = 100 * 1_000_000; let k = 1.003; - unwrap!(spawner.spawn(toggle_led(CHANNEL.sender(), Duration::from_nanos(dt)))); - unwrap!(spawner.spawn(toggle_led(CHANNEL.sender(), Duration::from_nanos((dt as f64 * k) as u64)))); + spawner.spawn(unwrap!(toggle_led(CHANNEL.sender(), Duration::from_nanos(dt)))); + spawner.spawn(unwrap!(toggle_led(CHANNEL.sender(), Duration::from_nanos((dt as f64 * k) as u64)))); loop { match CHANNEL.receive().await { -- cgit From c101acbdc3593936f6e966cb33e8ba72698a1a31 Mon Sep 17 00:00:00 2001 From: Carl Kadie Date: Sat, 6 Sep 2025 14:05:45 -0700 Subject: Update Embassy in the Wild with no_std Raspberry Pi Pico clock demonstrating layered Embassy tasks (I also added a note that newer entries are at the top. If this isn't right, let me know or change.) --- docs/pages/embassy_in_the_wild.adoc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/pages/embassy_in_the_wild.adoc b/docs/pages/embassy_in_the_wild.adoc index 620794c31..cedbedada 100644 --- a/docs/pages/embassy_in_the_wild.adoc +++ b/docs/pages/embassy_in_the_wild.adoc @@ -2,6 +2,10 @@ Here are known examples of real-world projects which make use of Embassy. Feel free to link:https://github.com/embassy-rs/embassy/blob/main/docs/pages/embassy_in_the_wild.adoc[add more]! +_newer entries at the top_ + +* link:https://github.com/CarlKCarlK/clock[Embassy Clock: Layered, modular bare-metal clock with emulation] +** A `no_std` Raspberry Pi Pico clock demonstrating layered Embassy tasks (Display->Blinker->Clock) for clean separation of multiplexing, blinking, and UI logic. Features single-button HH:MM/MM:SS time-set UI, heapless data structures, and a Renode emulator for hardware-free testing. See link:https://medium.com/@carlmkadie/how-rust-embassy-shine-on-embedded-devices-part-2-aad1adfccf72[this article] for details. * link:https://github.com/1-rafael-1/simple-robot[A simple tracked robot based on Raspberry Pi Pico 2] ** A hobbyist project building a tracked robot with basic autonomous and manual drive mode. * link:https://github.com/1-rafael-1/pi-pico-alarmclock-rust[A Raspberry Pi Pico W Alarmclock] -- cgit From 0ba74a4127a244781fc125208a73cc51c8a0deac Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Tue, 30 Sep 2025 10:31:33 +0200 Subject: chore: prepare crate releases --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index b6dbeda2a..b90180853 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -9,7 +9,7 @@ publish = false [dependencies] embassy-executor = { version = "0.9.0", path = "../../../embassy-executor", features = ["defmt", "arch-cortex-m", "executor-thread"] } embassy-time = { version = "0.5.0", path = "../../../embassy-time", features = ["defmt"] } -embassy-nrf = { version = "0.7.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } +embassy-nrf = { version = "0.8.0", path = "../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote"] } defmt = "1.0.1" defmt-rtt = "1.0.0" -- cgit From 99ec24162aab51feb661b709a869ce64a30cfef1 Mon Sep 17 00:00:00 2001 From: 1-rafael-1 Date: Sat, 4 Oct 2025 16:19:46 +0200 Subject: Add Air Quality Monitor project to Embassy in the Wild page --- docs/pages/embassy_in_the_wild.adoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/pages/embassy_in_the_wild.adoc b/docs/pages/embassy_in_the_wild.adoc index cedbedada..3b58bb9b4 100644 --- a/docs/pages/embassy_in_the_wild.adoc +++ b/docs/pages/embassy_in_the_wild.adoc @@ -4,6 +4,8 @@ Here are known examples of real-world projects which make use of Embassy. Feel f _newer entries at the top_ +* link:https://github.com/1-rafael-1/air-quality-monitor[Air Quality Monitor] +** Air Quality Monitor based on rp2350 board, ens160 and aht21 sensors and ssd1306 display. Code and 3D printable enclosure included. * link:https://github.com/CarlKCarlK/clock[Embassy Clock: Layered, modular bare-metal clock with emulation] ** A `no_std` Raspberry Pi Pico clock demonstrating layered Embassy tasks (Display->Blinker->Clock) for clean separation of multiplexing, blinking, and UI logic. Features single-button HH:MM/MM:SS time-set UI, heapless data structures, and a Renode emulator for hardware-free testing. See link:https://medium.com/@carlmkadie/how-rust-embassy-shine-on-embedded-devices-part-2-aad1adfccf72[this article] for details. * link:https://github.com/1-rafael-1/simple-robot[A simple tracked robot based on Raspberry Pi Pico 2] @@ -11,7 +13,7 @@ _newer entries at the top_ * link:https://github.com/1-rafael-1/pi-pico-alarmclock-rust[A Raspberry Pi Pico W Alarmclock] ** A hobbyist project building an alarm clock around a Pi Pico W complete with code, components list and enclosure design files. * link:https://github.com/haobogu/rmk/[RMK: A feature-rich Rust keyboard firmware] -** RMK has built-in layer support, wireless(BLE) support, real-time key editing support using vial, and more! +** RMK has built-in layer support, wireless(BLE) support, real-time key editing support using vial, and more! ** Targets STM32, RP2040, nRF52 and ESP32 MCUs * link:https://github.com/cbruiz/printhor/[Printhor: The highly reliable but not necessarily functional 3D printer firmware] ** Targets some STM32 MCUs @@ -21,10 +23,9 @@ _newer entries at the top_ * link:https://github.com/matoushybl/air-force-one[Air force one: A simple air quality monitoring system] ** Targets nRF52 and uses nrf-softdevice -* link:https://github.com/schmettow/ylab-edge-go[YLab Edge Go] and link:https://github.com/schmettow/ylab-edge-pro[YLab Edge Pro] projects develop +* link:https://github.com/schmettow/ylab-edge-go[YLab Edge Go] and link:https://github.com/schmettow/ylab-edge-pro[YLab Edge Pro] projects develop firmware (RP2040, STM32) for capturing physiological data in behavioural science research. Included so far are: ** biopotentials (analog ports) ** motion capture (6-axis accelerometers) ** air quality (CO2, Temp, Humidity) ** comes with an app for capturing and visualizing data [link:https://github.com/schmettow/ystudio-zero[Ystudio]] - -- cgit From abc8e450f936567ad42cb34b5d2a7941b206aa5d Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 6 Oct 2025 22:55:38 +0200 Subject: Edition 2024. --- docs/examples/layer-by-layer/blinky-async/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-hal/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-irq/Cargo.toml | 2 +- docs/examples/layer-by-layer/blinky-pac/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/examples/layer-by-layer/blinky-async/Cargo.toml index ec718022c..797ae3097 100644 --- a/docs/examples/layer-by-layer/blinky-async/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-async/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "blinky-async" version = "0.1.0" -edition = "2021" +edition = "2024" license = "MIT OR Apache-2.0" publish = false diff --git a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml index 4a0b03a83..802b8b32e 100644 --- a/docs/examples/layer-by-layer/blinky-hal/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-hal/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "blinky-hal" version = "0.1.0" -edition = "2021" +edition = "2024" license = "MIT OR Apache-2.0" publish = false diff --git a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml index 3c4bf8446..d1b893a1e 100644 --- a/docs/examples/layer-by-layer/blinky-irq/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-irq/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "blinky-irq" version = "0.1.0" -edition = "2021" +edition = "2024" license = "MIT OR Apache-2.0" publish = false diff --git a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml index 0d4711da2..fa093a3af 100644 --- a/docs/examples/layer-by-layer/blinky-pac/Cargo.toml +++ b/docs/examples/layer-by-layer/blinky-pac/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "blinky-pac" version = "0.1.0" -edition = "2021" +edition = "2024" license = "MIT OR Apache-2.0" publish = false -- cgit From 8ff497e9bc2d9fa7402bc6f060ebc8909ad97a32 Mon Sep 17 00:00:00 2001 From: xoviat Date: Wed, 29 Oct 2025 17:17:39 -0500 Subject: doc: use frontpage example ref #4776 --- docs/examples/basic/src/main.rs | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/examples/basic/src/main.rs b/docs/examples/basic/src/main.rs index 6e274bacb..42797612c 100644 --- a/docs/examples/basic/src/main.rs +++ b/docs/examples/basic/src/main.rs @@ -3,24 +3,41 @@ use defmt::*; use embassy_executor::Spawner; -use embassy_nrf::gpio::{Level, Output, OutputDrive}; -use embassy_time::{Duration, Timer}; -use {defmt_rtt as _, panic_probe as _}; // global logger +use embassy_nrf::Peri; +use embassy_nrf::gpio::{AnyPin, Input, Level, Output, OutputDrive, Pull}; +use embassy_time::Timer; +use {defmt_rtt as _, panic_probe as _}; +// Declare async tasks #[embassy_executor::task] -async fn blinker(mut led: Output<'static>, interval: Duration) { +async fn blink(pin: Peri<'static, AnyPin>) { + let mut led = Output::new(pin, Level::Low, OutputDrive::Standard); + loop { + // Timekeeping is globally available, no need to mess with hardware timers. led.set_high(); - Timer::after(interval).await; + Timer::after_millis(150).await; led.set_low(); - Timer::after(interval).await; + Timer::after_millis(150).await; } } +// Main is itself an async task as well. #[embassy_executor::main] async fn main(spawner: Spawner) { + // Initialize the embassy-nrf HAL. let p = embassy_nrf::init(Default::default()); - let led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); - spawner.spawn(unwrap!(blinker(led, Duration::from_millis(300)))); + // Spawned tasks run in the background, concurrently. + spawner.spawn(blink(p.P0_13.into()).unwrap()); + + let mut button = Input::new(p.P0_11, Pull::Up); + loop { + // Asynchronously wait for GPIO events, allowing other tasks + // to run, or the core to sleep. + button.wait_for_low().await; + info!("Button pressed!"); + button.wait_for_high().await; + info!("Button released!"); + } } -- cgit From d7023ed3d1bea7929be8a6cb25597a734936276e Mon Sep 17 00:00:00 2001 From: xoviat Date: Wed, 29 Oct 2025 17:29:16 -0500 Subject: fix edition --- docs/examples/basic/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/examples/basic/Cargo.toml b/docs/examples/basic/Cargo.toml index b90180853..fadda102b 100644 --- a/docs/examples/basic/Cargo.toml +++ b/docs/examples/basic/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Dario Nieuwenhuis "] -edition = "2018" +edition = "2024" name = "embassy-basic-example" version = "0.1.0" license = "MIT OR Apache-2.0" -- cgit From 9d0fadee4ca2374376d47f82c23a42fe3d9babad Mon Sep 17 00:00:00 2001 From: Aquarel <54329158+ThatAquarel@users.noreply.github.com> Date: Sat, 8 Nov 2025 20:14:24 -0500 Subject: Add mini power supply project to Embassy in the Wild page --- docs/pages/embassy_in_the_wild.adoc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/pages/embassy_in_the_wild.adoc b/docs/pages/embassy_in_the_wild.adoc index 3b58bb9b4..b0a16fc4c 100644 --- a/docs/pages/embassy_in_the_wild.adoc +++ b/docs/pages/embassy_in_the_wild.adoc @@ -4,6 +4,8 @@ Here are known examples of real-world projects which make use of Embassy. Feel f _newer entries at the top_ +* link:https://github.com/thataquarel/protovolt[ProtoV MINI: A USB-C mini lab power supply] +** A dual-channel USB PD powered breadboard power supply based on the RP2040, running embedded graphics. Open-source schematics and firmware. * link:https://github.com/1-rafael-1/air-quality-monitor[Air Quality Monitor] ** Air Quality Monitor based on rp2350 board, ens160 and aht21 sensors and ssd1306 display. Code and 3D printable enclosure included. * link:https://github.com/CarlKCarlK/clock[Embassy Clock: Layered, modular bare-metal clock with emulation] -- cgit From 97db3cd2cd81104e1632f969d0e23df5c61e40b0 Mon Sep 17 00:00:00 2001 From: Aquarel <54329158+ThatAquarel@users.noreply.github.com> Date: Sat, 8 Nov 2025 20:40:27 -0500 Subject: Add opentrig project to Embassy in the Wild page --- docs/pages/embassy_in_the_wild.adoc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/pages/embassy_in_the_wild.adoc b/docs/pages/embassy_in_the_wild.adoc index 3b58bb9b4..9c29ff4eb 100644 --- a/docs/pages/embassy_in_the_wild.adoc +++ b/docs/pages/embassy_in_the_wild.adoc @@ -4,6 +4,8 @@ Here are known examples of real-world projects which make use of Embassy. Feel f _newer entries at the top_ +* link:https://github.com/Dawson-HEP/opentrig/[Opentrig: A particle physics trigger and data acquisition system] +** Digital event trigger with threshold, data acquisition system designed to interface with AIDA-2020 TLU systems, tested at the DESY II Test Beam Facility. Based on the RP2040, and Embassy's async event handling. * link:https://github.com/1-rafael-1/air-quality-monitor[Air Quality Monitor] ** Air Quality Monitor based on rp2350 board, ens160 and aht21 sensors and ssd1306 display. Code and 3D printable enclosure included. * link:https://github.com/CarlKCarlK/clock[Embassy Clock: Layered, modular bare-metal clock with emulation] -- cgit From 5e90c3fdb3b87970926b1ecc86cc4ad8ab260569 Mon Sep 17 00:00:00 2001 From: Steven Schulteis Date: Sun, 16 Nov 2025 09:51:38 -0600 Subject: Fix docs for embassy-boot state partition size --- docs/pages/bootloader.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/pages/bootloader.adoc b/docs/pages/bootloader.adoc index b0f0331aa..c010b0622 100644 --- a/docs/pages/bootloader.adoc +++ b/docs/pages/bootloader.adoc @@ -43,14 +43,14 @@ Partition Size~dfu~= Partition Size~active~+ Page Size~active~ + All values are specified in bytes. -* BOOTLOADER STATE - Where the bootloader stores the current state describing if the active and dfu partitions need to be swapped. When the new firmware has been written to the DFU partition, a magic field is written to instruct the bootloader that the partitions should be swapped. This partition must be able to store a magic field as well as the partition swap progress. The partition size given by: +* BOOTLOADER STATE - Where the bootloader stores the current state describing if the active and dfu partitions need to be swapped. When the new firmware has been written to the DFU partition, a magic field is written to instruct the bootloader that the partitions should be swapped. This partition must be able to store a magic field as well as the partition swap progress. The partition size is given by: + -Partition Size~state~ = Write Size~state~ + (2 × Partition Size~active~ / Page Size~active~) +Partition Size~state~ = (2 × Write Size~state~) + (4 × Write Size~state~ × Partition Size~active~ / Page Size~active~) + All values are specified in bytes. The partitions for ACTIVE (+BOOTLOADER), DFU and BOOTLOADER_STATE may be placed in separate flash. The page size used by the bootloader is determined by the lowest common multiple of the ACTIVE and DFU page sizes. -The BOOTLOADER_STATE partition must be big enough to store one word per page in the ACTIVE and DFU partitions combined. +The BOOTLOADER_STATE partition must be big enough to store two words, plus four words per page in the ACTIVE partition. The bootloader has a platform-agnostic part, which implements the power fail safe swapping algorithm given the boundaries set by the partitions. The platform-specific part is a minimal shim that provides additional functionality such as watchdogs or supporting the nRF52 softdevice. -- cgit