diff options
| author | Elias Hanelt <[email protected]> | 2025-11-25 13:18:00 -0800 |
|---|---|---|
| committer | Elias Hanelt <[email protected]> | 2025-11-25 13:18:00 -0800 |
| commit | 2b219b7cb59ec3e4370edc88538ea3ea996f37b9 (patch) | |
| tree | c602a4b7c39d50ada628f2d715c6cc59f2e35c3a /docs/pages | |
| parent | 576fb23faabf6df7f2c9ed2039e94d3586a3788f (diff) | |
| parent | 906eaee53f84381dd10583894edf2de67275f083 (diff) | |
Merge remote-tracking branch 'origin/main' into feature/spi-bidi
Diffstat (limited to 'docs/pages')
| -rw-r--r-- | docs/pages/bootloader.adoc | 6 | ||||
| -rw-r--r-- | docs/pages/faq.adoc | 6 | ||||
| -rw-r--r-- | docs/pages/layer_by_layer.adoc | 2 |
3 files changed, 9 insertions, 5 deletions
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~ | |||
| 43 | + | 43 | + |
| 44 | All values are specified in bytes. | 44 | All values are specified in bytes. |
| 45 | 45 | ||
| 46 | * 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: | 46 | * 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: |
| 47 | + | 47 | + |
| 48 | Partition Size~state~ = Write Size~state~ + (2 × Partition Size~active~ / Page Size~active~) | 48 | Partition Size~state~ = (2 × Write Size~state~) + (4 × Write Size~state~ × Partition Size~active~ / Page Size~active~) |
| 49 | + | 49 | + |
| 50 | All values are specified in bytes. | 50 | All values are specified in bytes. |
| 51 | 51 | ||
| 52 | 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. | 52 | 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. |
| 53 | The BOOTLOADER_STATE partition must be big enough to store one word per page in the ACTIVE and DFU partitions combined. | 53 | The BOOTLOADER_STATE partition must be big enough to store two words, plus four words per page in the ACTIVE partition. |
| 54 | 54 | ||
| 55 | 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. | 55 | 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. |
| 56 | 56 | ||
diff --git a/docs/pages/faq.adoc b/docs/pages/faq.adoc index 8098e12ac..e59ef7b46 100644 --- a/docs/pages/faq.adoc +++ b/docs/pages/faq.adoc | |||
| @@ -171,7 +171,11 @@ Note that the git revision should match any other embassy patches or git depende | |||
| 171 | 171 | ||
| 172 | == Can I use manual ISRs alongside Embassy? | 172 | == Can I use manual ISRs alongside Embassy? |
| 173 | 173 | ||
| 174 | 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]. | 174 | 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. |
| 175 | |||
| 176 | You may 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]. | ||
| 177 | |||
| 178 | Or you may define a struct implementing the `embassy-[family]::interrupt::typelevel::Handler` trait with an on_interrupt() method, and bind it to the interrupt vector via the `bind_interrupts!` macro, which introduces only a single indirection. This allows the mixing of manual ISRs with Embassy driver-defined ISRs; handlers will be called directly in the order they appear in the macro. | ||
| 175 | 179 | ||
| 176 | == How can I measure resource usage (CPU, RAM, etc.)? | 180 | == How can I measure resource usage (CPU, RAM, etc.)? |
| 177 | 181 | ||
diff --git a/docs/pages/layer_by_layer.adoc b/docs/pages/layer_by_layer.adoc index 0692ee4fa..f554e642a 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 | |||
| 76 | * The peripheral initialization is done by the main macro, and is handed to the main task. | 76 | * The peripheral initialization is done by the main macro, and is handed to the main task. |
| 77 | * Before checking the button state, the application is awaiting a transition in the pin state (low -> high or high -> low). | 77 | * Before checking the button state, the application is awaiting a transition in the pin state (low -> high or high -> low). |
| 78 | 78 | ||
| 79 | 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. | 79 | 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. On this chip, interrupt signals on EXTI lines 10-15 (including the button on EXTI line 13) raise the hardware interrupt EXTI15_10. This interrupt handler has been bound (using `bind_interrupts!`) to call the `InterruptHandler` provided by the exti module, so that whenever an interrupt is raised, the task awaiting the button via `wait_for_any_edge()` will be woken up. |
| 80 | 80 | ||
| 81 | 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. | 81 | 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. |
| 82 | 82 | ||
