Linker symbol access from within Rust code clarification #634
-
|
Hello, I am writing a preemptive scheduler using this crate and have set up memory.x accordingly. For the scheduler to work I need to know some of the memory layout details, e.g. _stack_start and possibly some other info such as the heap start location. Per google's advice I have also written some code to access these symbols e.g. However, when reading the developer note in memory.x it states that symbols that start with a single underscore should not be accessed in this manner. I was wondering what is the intended way to access this information if not by the underscored symbols? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
For the heap start, see https://docs.rs/cortex-m-rt/latest/cortex_m_rt/fn.heap_start.html. For |
Beta Was this translation helpful? Give feedback.
For the heap start, see https://docs.rs/cortex-m-rt/latest/cortex_m_rt/fn.heap_start.html.
For
_stack_end, you can either ignore the advice and just refer to them anyway (but note they may change between cortex-m-rt revisions, so you should pin your version of cortex-m-rt); or you can just copy-and-paste our linker script into your project and make changes to export any symbols you require.