All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
global_asm!
, requiring Rust 1.59.set_vtor
and set-sp
features to conditionally set the VTOR and SP registers at device reset (#423).naked
attribute on interrupt handlers and pre_init
.cortex_m_rt::exception
macro no longer being usable fully-qualified (#414)Reset
function (#337)main
symbol (#278).HardFaultTrampoline
and FpuTrampoline
) (#294).ExceptionFrame
s fields private, adding setters and getters instead (#239).pre_init
in documentation (#248).links
in Cargo.toml to prevent multiple linking of cortex-m-rt (#276).links
in Cargo.toml to prevent multiple linking of cortex-m-rt (#276)HardFaultTrampoline
)static mut
resources no longer have 'static
lifetime except in the #[entry]
function (this is a soundness fix; see #212).*(.ARM.exidx)
.uninit.*
sections are now collected into an output .uninit
section. Uninitialized static variables are meant to be placed in these sections. The output .uninit
section is not initialized by the runtime.HardFault
*(.ARM.extab.*)
armv8-m.main
authors
#[cfg]
attributes used on static mut
variables are now properly handled.Misuse of attributes now produce compiler errors with proper spans instead of panicking messages.
The HardFault
symbol has been renamed to HardFaultTrampoline
; likewise the UserHardFault
symbol has been renamed to HardFault
. If you were using breakpoints on UserHardFault
to detect hard fault you should now put those breakpoints on the HardFault
symbol.
Attributes on local static mut
variables (declared at the beginning of entry
/ interrupt
/ exception
) are now respected.
The “GDB can now unwind HardFault callstacks” fix from the previous release broke HardFault
‘s’ &ExceptionFrame
argument (the pointer was off by 8 bytes). This release fixes that problem without compromising GDB's ability to unwind HardFault
s.
.stack_sizes
by default, for use with external tooling.#[interrupt]
attribute added, similar to #[exception]
for use with device-specific interrupt handlers.(macros) The expansion of the exception
attribute now uses the extern "C"
ABI which is what the hardware expects.
(macros) entry
and exception
now respect the declared unsafety. That is #[entry] unsafe main() -> !
won't require unsafe
blocks to use unsafe
API.
rand
problem for real.Worked around a Cargo limitation that broke builds that depend on rand
.
Updated the documentation link in the README to point to working docs.
cortex-m-rt
are going to be linked into a binary.entry!
, pre_init!
and exception!
macros have been replaced with attributes: #[entry]
, #[pre_init]
and #[exception]
, respectively. This also changes the toolchain requirement to 1.30-beta or newer.arm-none-eabi-gcc
.pre_init!
macro and related functionality to run a function immediately after reset, before memory initialisationThe entry!
and exception!
macros now also accept a closure instead of a path.
DefaultHandler
and UserHardFault
now default to an infinite loop if left undefined.
FLASH
overflow caused by .data
cortex-m-rt
would be recompiled every time cargo build
is invoked.An entry!
macro to set the entry point of the program.
A heap_start
function that returns a pointer into the start of the heap region.
A device
feature. When disabled this crate provides the interrupt vectors; when enabled the interrupt vectors are expected to be provided by another crate. Read the documentation for details.
This crate now compiles on the beta and stable channels.
[breaking-change] this crate now requires arm-none-eabi-gcc
to be installed and available in $PATH
to compile.
[breaking-change] the start
lang item has been removed. The standard main
interface won't work. Instead use #![no_main]
and the entry!
macro. See documentation for details.
[breaking-change] the default_handler!
macro has been merged into the exception!
macro. Use exception!(*, ..)
to set the default exception handler.
[breaking-change] there's no weak default handler so a default handler must be defined by the application, or one of its dependencies.
[breaking-change] the syntax of the third argument of the exception!
handler has changed. See the documentation of the macro for details.
[breaking-change] the exception names that the exception!
macro accepts has changed to match the CMSIS specification. See the documentation of the macro for the list of names it accepts.
[breaking-change] The number of symbol interfaces has been reduced. Check the advanced section of the documentation for details.
.cargo/config
to look like this:[target.thumbv7m-none-eabi] rustflags = [ "-C", "link-arg=-Tlink.x", - "-C", "linker=arm-none-eabi-ld", - "-Z", "linker-flavor=ld", + "-C", "linker=lld", + "-Z", "linker-flavor=ld.lld", ]
[breaking-change] Stack overflow protection has been removed. Unfortunately, supporting this feature produces totally wrong arm-none-eabi-size
reports when LLD is used to link the program. If you need the stack overflow protection feature you can continue to use version v0.3.13+.
[breaking-change] The “abort-on-panic” Cargo feature, which provided a panic_fmt
implementation, has been removed. If you were using this feature you can instead use a panic implementation crate.
dev
channel supportFictitious .stack
and .heap
linker sections that represent the locations of the stack and the heap in RAM. You can visualize these linker sections by running arm-none-eabi-size -Ax
over your binary.
Zero cost stack overflow protection when you use the cortex-m-rt-ld
linker. Check documentation for details.
A _heap_size
symbol that indicates how large the heap is. This symbol is only used when cortex-m-rt-ld
is used as a linker.
termination
lang item, and nightly-2017-09-22, which doesn't. That nightly version is used by the docs.rs builder. Supporting that version instead of rejecting it ensures this crate and its reverse-dependencies will get their documentation built by the docs.rs service.cargo doc
warningsTermination
lang itemstart
lang item to match the new signatureAlign the end of .rodata to a 4-byte boundary. With this the sections that will go into Flash memory will be 4 byte aligned at the start and at the end. Which seems to be required (?) by Cortex-M0 devices.
.bss and .data are now padded so their sizes are multiple of 4 bytes. This improves the output of objdump
; before, the output showed “Address 0x20000004 is out of bounds”.
Linking now aborts if any of the input files contains a .got section. Dynamic relocations are not supported and Rust code is not relocatable by default. This error only occurs if C code that was compiled with the -fPIC flag is linked in. The error message will tell the user how to compile their C code without -fPIC.
rust-src
component.A default_handler!
macro to override the default exception handler.
An exception!
macro to override the handler for a particular exception.
The FPU will now be enabled before main
if the target has FPU support.
[breaking-change] the features “panic-over-itm” and “panic-over-semihosting” has been removed. the panic_fmt
language item is now not included by default. An opt-in feature named “abort-on-panic” can be enabled to make this crate provide a panic_fmt
implementation that simply aborts.
[breaking-change] The sections .rodata.{exceptions,interrupts}
have been renamed to .vector_table.{exceptions,interrupts}
. This break the old mechanism for registering exceptions (static EXCEPTIONS
); use the new ones: default_handler!
and exception!
.
The _stack_start
is now optional in the memory.x
file. If unspecified its value will be set to ORIGIN(RAM) + LENGTH(RAM)
.
.stlog
section to support the stlog
logging framework._stext
symbol which can be specified in the linker script to customize the location of the .text
section. If not specified the .text
section will be placed right after the .vector_table
section._sheap
symbol where the heap can be located.arm-none-eabi-size -A
more useful. You'll now see something like this:$ arm-none-eabi-size -A hello hello : section size addr .vector_table 1024 134217728 .text 288 134218752 .rodata 14 134219040
cortex-m-rt::reset_handler
is now the entry point of all programs that link to cortex-m-rt
. This makes GDB‘s load
command work correctly. It will now set the Program Counter to reset_handler
after flashing the program so there’s no need to reset the microcontroller after flashing.
Renamed __exceptions
and __interrupts
symbols, which are only used internally, to _eexceptions
and _einterrupts
respectively for consistency.
.text
and .rodata
sections (note: no suffix as in .text.foo
) in the output file. (C) Code compiled without the equivalent -ffunction-sections
/ -fdata-sections
may place stuff in those unsuffixed sections..debug_gdb_script
section in flash. It's only needed for debugging._stack_start
symbol is now required and must be provided in the memory.x
file when using the “linker-script” feature. This symbol indicates where in memory the call stack will be allocated.rustdoc
warningreset_handler
function for a better debugging experience.Initial release