10
10
//! - The memory layout of the program. In particular, it populates the vector table so the device
11
11
//! can boot correctly, and properly dispatch exceptions and interrupts.
12
12
//!
13
- //! - Initializing `static` variables before the user entry point.
13
+ //! - Initializing `static` variables before the program entry point.
14
14
//!
15
- //! - Enabling the FPU before the user entry point if the target is `thumbv7em-none-eabihf`.
15
+ //! - Enabling the FPU before the program entry point if the target is `thumbv7em-none-eabihf`.
16
16
//!
17
17
//! This crate also provides a mechanism to set exception handlers: see the [`exception!`] macro.
18
18
//!
215
215
//! - `UserHardFault`. This is the user defined hard fault handler. This function will contain, or
216
216
//! call, the function you declared in the second argument of `exception!(HardFault, ..)`
217
217
//!
218
+ //! - `__STACK_START`. This is the first entry in the `.vector_table` section. This symbol contains
219
+ //! the initial value of the stack pointer; this is where the stack will be located -- the stack
220
+ //! grows downwards towards smaller addresses.
221
+ //!
222
+ //! - `__RESET_VECTOR`. This is the reset vector, a pointer into the `Reset` handler. This vector is
223
+ //! located in the `.vector_table` section after `__STACK_START`.
224
+ //!
225
+ //! - `__EXCEPTIONS`. This is the core exceptions portion of the vector table; it's an array of 14
226
+ //! exception vectors, which includes exceptions like `HardFault` and `SysTick`. This array is
227
+ //! located after `__RESET_VECTOR` in the `.vector_table` section.
228
+ //!
229
+ //! - `__EXCEPTIONS`. This is the device specific interrupt portion of the vector table; its exact
230
+ //! size depends on the target device but if the `"device"` feature has not been enabled it will
231
+ //! have a size of 32 vectors (on ARMv6-M) or 240 vectors (on ARMv7-M). This array is located after
232
+ //! `__EXCEPTIONS` in the `.vector_table` section.
233
+ //!
218
234
//! If you override any exception handler you'll find it as an unmangled symbol, e.g. `SysTick` or
219
235
//! `SVCall`, in the output of `objdump`,
220
236
//!
@@ -669,6 +685,8 @@ pub static __INTERRUPTS: [unsafe extern "C" fn(); 32] = [{
669
685
///
670
686
/// (b) Only available on ARMv8-M
671
687
///
688
+ /// # Usage
689
+ ///
672
690
/// `exception!(HardFault, ..)` sets the hard fault handler. The handler must have signature
673
691
/// `fn(&ExceptionFrame) -> !`. This handler is not allowed to return as that can cause undefined
674
692
/// behavior. It's mandatory to set the `HardFault` handler somewhere in the dependency graph of an
@@ -686,7 +704,7 @@ pub static __INTERRUPTS: [unsafe extern "C" fn(); 32] = [{
686
704
///
687
705
/// # Examples
688
706
///
689
- /// Setting the `HardFault` handler
707
+ /// - Setting the `HardFault` handler
690
708
///
691
709
/// ```
692
710
/// #[macro_use(exception)]
@@ -704,7 +722,7 @@ pub static __INTERRUPTS: [unsafe extern "C" fn(); 32] = [{
704
722
/// # fn main() {}
705
723
/// ```
706
724
///
707
- /// Setting the default handler
725
+ /// - Setting the default handler
708
726
///
709
727
/// ```
710
728
/// #[macro_use(exception)]
@@ -719,7 +737,7 @@ pub static __INTERRUPTS: [unsafe extern "C" fn(); 32] = [{
719
737
/// # fn main() {}
720
738
/// ```
721
739
///
722
- /// Overriding the `SysTick` handler
740
+ /// - Overriding the `SysTick` handler
723
741
///
724
742
/// ```
725
743
/// #[macro_use(exception)]
0 commit comments