aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-12-08 19:35:32 +0000
committerGitHub <[email protected]>2023-12-08 19:35:32 +0000
commit3f30e87cb579a21afa57efcd50e279070994265d (patch)
tree902a9d2cbe6f078dcc4cdcd77302dbe578458f07 /docs
parenta9ec623622de294478506630c02bb003a9e15734 (diff)
parent1f6ffdcdd2e760d91ed10fa63f6819b71579b2b4 (diff)
Merge pull request #2251 from JuliDi/faq-performance-tweaks
[FAQ] Add section about speed optimization
Diffstat (limited to 'docs')
-rw-r--r--docs/modules/ROOT/pages/faq.adoc17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/modules/ROOT/pages/faq.adoc b/docs/modules/ROOT/pages/faq.adoc
index df3f66658..cab9fb9d8 100644
--- a/docs/modules/ROOT/pages/faq.adoc
+++ b/docs/modules/ROOT/pages/faq.adoc
@@ -135,3 +135,20 @@ embassy-time = { git = "https://github.com/embassy-rs/embassy.git", rev = "e5fdd
135---- 135----
136 136
137Note that the git revision should match any other embassy patches or git dependencies that you are using! 137Note 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* Set the following keys in the `[unstable]` section of your `.cargo/config.toml`
148 ** `build-std = ["core"]`
149 ** `build-std-features = ["panic_immediate_abort"]`
150* Enable feature `embassy-time/generic-queue`, disable feature `embassy-executor/integrated-timers`
151* When using `InterruptExecutor`:
152 ** disable `executor-thread`
153 ** 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() }`
154 ** *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