Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
Previously we always emitted link_section, even though it only had an
effect when our linker script was being used (and only made sense on
cortex-m targets). This breaks building the code for a MacOS target,
which is occasionally useful for running `cargo check` etc.
In the macros crate we don't have the target information available, so
instead we continue to emit link_section except specifically on MacOS.
|
|
|
|
* Use arm-none-eabi-gcc to assemble, allowing use of preprocessor to
conditionally enable the FPU for eabihf targets.
* Remove has_fpu configuration from build.rs.
* Remove FpuTrampoline as no longer required.
* Remove the Rust Reset method entirely, since the asm Reset can now
enable FPU and jump to user main.
|
|
|
|
the ARMv6-M Architecture Reference Manual (ARM DDI 0419D) indicates in section
B1.5.5 "Reset behavior" that the LR (Link Register) starts in an unknown state
when the Reset handler is taken and that its "Value must be initialised by
software"
So this PR does that: it initializes the LR register to 0xFFFF_FFFF (-1) first
thing in the Reset handler (only for v6). The manual doesn't say which value to
use so I decided to use the value used by the ARMv7-M (v7 sets LR to 0xFFFF_FFFF
before invoking the Reset handler; see its Architecture Manual for details).
The values of LR (these are pushed onto the stack in function preludes) are used
to unwind the stack (e.g. GDB's `backtrace` or a future `cortex_m_panic_unwind`
handler). Having the initial stack frame use a known value on all Cortex-M
variants makes it easier to implement `panic_unwind` and avoids virtual
unwinders like GDB `backtrace` trying to unwind beyond the `Reset` handler
Note that this implementation uses a trampoline that runs before `Reset` to set
LR on v6. This is required because the prelude of the `Reset` routine will push
LR onto the stack; we want that LR value to be -1. Calling `register::lr::write`
from `Reset` would perform the write after LR has been pushed onto the stack and
that's too late
|
|
|
|
280: Make Vector public in interrupt example r=adamgreig a=Tiwalun
If the `Vector`union is not public, the example code leads to a compilation error because `pub static __INTERRUPTS` leaks the private type `Vector`.
Co-authored-by: Dominik Boehi <dominik.boehi@gmail.com>
|
|
This is unsound unless you control the panic handler implementation.
|
|
|
|
panic"
This reverts commit ffffb7b3aaef1d9bb4e4b81347ed8f1d50e50ea4.
|
|
|
|
|
|
|
|
If the `Vector`union is not public, the example code leads to a compilation error because `pub static __INTERRUPTS` leaks the private type `Vector`.
|
|
|
|
276: Replace __ONCE__ with Cargo links key r=jonas-schievink a=adamgreig
This would fix #275. We use the links key in cortex-m already [here](https://github.com/rust-embedded/cortex-m/blob/master/Cargo.toml#L16). See also https://github.com/rust-embedded/wg/issues/467.
Co-authored-by: Adam Greig <adam@adamgreig.com>
|
|
|
|
The documentation says that main() should have a C ABI. Additionally,
the #[entry] macro will create a main() function that has a C ABI.
Marking main() as 'extern "Rust"' is inconsistent with its calling
convention.
|
|
|
|
This is considered harmful as the warnings may change with any compiler
release.
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
|
|
257: Changed Hardfault's and DefaultHander's default implementations to panic r=adamgreig a=korken89
From the discussions in #253 I started a PR with the proposed change.
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
|
|
|
|
|
|
|
|
|
|
249: Ignore a doctest again r=adamgreig a=jonas-schievink
I accidentally typoed `no_run`, but compiling the test fails since the
`device.x` path is wrong. I don't think this can be fixed, so ignore the
test instead.
The effect is the same as before but now the block gets highlighted again.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
|
|
I accidentally typoed `no_run`, but compiling the test fails since the
`device.x` path is wrong. I don't think this can be fixed, so ignore the
test instead.
|
|
|
|
|
|
|
|
|
|
|
|
Otherwise this would be a regression in functionality
|
|
|
|
See justification on 519d46a. Using 'extern crate cortex_m_rt'
inside of the macros limits our ability to use the macros
crate in other contexts. As long as another crate publicly
exports an enumeration of `interrupt` and an enumeration
of `exception`, the macros crate may be used in other
cortex-m-rt-like systems.
|
|
|
|
that contains static variables that will not be initialized by the runtime
this implements only the linker section described in RFC #116 so that downstream
libraries / framework can leverage it without (a) forking this crate or (b)
requiring the end user to pass additional linker scripts to the linker when
building their crate.
This commit doesn't add the user interface described in RFC #116; instead it
documents how to use this linker section in the advanced section of the crate
level documentation
|
|
instead of __EXCEPTIONS
|
|
|
|
so it matches the exception name (`#[exception] fn HardFault(..`)
|
|
|
|
to point to the "Reexports" section. The older links don't work correctly on
docs.rs. The "Reexports" section always has valid links to the documentation of
each attribute.
|
|
Fixes #137
|
|
this commit replaces the `bl UserHardFault` instruction in HardFault with `b
UserHardFault`. This lets us drop the prologue (`push {r0,lr}`) while preserving
the ability to unwind the stack using GDB.
To prevent linker errors about relocations when UserHardFault and HardFault end
up far away from each other and the target is ARMv6-M (where the `b` instruction
only supports offsets of +/- 2KB) we use two *input* sections: .HardFault and
.UserHardFault. HardFault is placed in the .HardFault section and UserHardFault
is placed in the .UserHardFault section. The .HardFault input section is placed
in the output .text section after all the input .text sections, and the
.UserHardFault input section is placed after the .HardFault section. This
causes the two symbols to always appear next to each other in the output binary,
furthermore UserHardFault *always* appears after HardFault so the branch offset
of `b UserHardFault` is always a few bytes.
It should be noted that neither .HardFault or .UserHardFault will appear in the
output of the `size -A` command as they are input sections that get merged into
the output .text section. IOW, the sizes of HardFault and UserHardFault will
continue to be reported under the .text section.
|