aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJames Munns <[email protected]>2024-01-30 10:34:09 +0100
committerJames Munns <[email protected]>2024-01-30 10:34:09 +0100
commitf38807433882374fe4ccf3510070abb42639c1cb (patch)
tree4ce06dd59c2a7b763a404b3359dcdd8c030cc8f3 /docs
parent99265ffea4f8b86b10a7afa549daec82f83d0ffe (diff)
Add some comments from chat
Diffstat (limited to 'docs')
-rw-r--r--docs/modules/ROOT/pages/faq.adoc18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/modules/ROOT/pages/faq.adoc b/docs/modules/ROOT/pages/faq.adoc
index bf061d978..254c0aa97 100644
--- a/docs/modules/ROOT/pages/faq.adoc
+++ b/docs/modules/ROOT/pages/faq.adoc
@@ -181,3 +181,21 @@ Check out link:https://docs.embassy.dev/embassy-executor/git/cortex-m/index.html
181== Can I use manual ISRs alongside Embassy? 181== Can I use manual ISRs alongside Embassy?
182 182
183Yes! 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]. 183Yes! 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].
184
185== How can I measure resource usage (CPU, RAM, etc.)?
186
187=== For CPU Usage:
188
189There are a couple techniques that have been documented, generally you want to measure how long you are spending in the idle or low priority loop.
190
191We need to document specifically how to do this in embassy, but link:https://blog.japaric.io/cpu-monitor/[this older post] describes the general process.
192
193If you end up doing this, please update this section with more specific examples!
194
195=== For Static Memory Usage
196
197Tools like `cargo size` and `cargo nm` can tell you the size of any globals or other static usage. Specifically you will want to see the size of the `.data` and `.bss` sections, which together make up the total global/static memory usage.
198
199=== For Max Stack Usage
200
201Check out link:https://github.com/Dirbaio/cargo-call-stack/[`cargo-call-stack`] for statically calculating worst-case stack usage. There are some caveats and inaccuracies possible with this, but this is a good way to get the general idea.