diff options
| author | JuliDi <[email protected]> | 2023-12-04 20:59:08 +0100 |
|---|---|---|
| committer | JuliDi <[email protected]> | 2023-12-04 20:59:08 +0100 |
| commit | 0b0ca62a95cd2dabbc7e160dc5d0fcfc1a7a76e8 (patch) | |
| tree | 9d442d02d7ab6845aea30952ebe1e0f7d7c87137 /docs/modules | |
| parent | 85d5f42562ca9374e3200d652616af9533346c5e (diff) | |
add speed optimization
Diffstat (limited to 'docs/modules')
| -rw-r--r-- | docs/modules/ROOT/pages/faq.adoc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/modules/ROOT/pages/faq.adoc b/docs/modules/ROOT/pages/faq.adoc index df3f66658..8ac1febc2 100644 --- a/docs/modules/ROOT/pages/faq.adoc +++ b/docs/modules/ROOT/pages/faq.adoc | |||
| @@ -135,3 +135,19 @@ embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "e5fdd | |||
| 135 | ---- | 135 | ---- |
| 136 | 136 | ||
| 137 | Note that the git revision should match any other embassy patches or git dependencies that you are using! | 137 | Note that the git revision should match any other embassy patches or git dependencies that you are using! |
| 138 | |||
| 139 | == How can I optimize the speed of my embassy-stm32 program? | ||
| 140 | |||
| 141 | * Make sure RCC is set up to go as fast as possible | ||
| 142 | * Make sure link:https://docs.rs/cortex-m/latest/cortex_m/peripheral/struct.SCB.html[flash cache] is enabled | ||
| 143 | * build with `--release` | ||
| 144 | * Set the following keys for the release profile in your `Cargo.toml``: | ||
| 145 | ** `opt-level=s` | ||
| 146 | ** `lto=fat` | ||
| 147 | ** `build-std=core` | ||
| 148 | ** `build-std-features=panic_immediate_abort` | ||
| 149 | * Enable feature `embassy-time/generic-queue`, disable feature `embassy-executor/integrated-timers` | ||
| 150 | * When using `InterruptExecutor`: | ||
| 151 | ** disable `executor-thread` | ||
| 152 | ** 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() }` | ||
| 153 | ** *Note:* If you need 2 priority levels, using 2 interrupt executors is better than 1 thread executor + 1 interrupt executor. \ No newline at end of file | ||
