NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #3522 most downloaded on crates.io
Minimal runtime / startup for Cortex-M microcontrollers
Latest stable
0.7.7
Last release 1 months ago
24 Sep 2026
Release timing varies
gaps range from 4 weeks to 1.7 years
Most releases are documented
notes for 33 of 37 stable releases
23 versions withdrawn
withdrawn after publishing
10 years old
60 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
cortex-m v0.7.7: add documentation for critical-section-single-core by @adamgreig in https://github.com/rust-embedded/cortex-m/pull/458
Full Changelog: https://github.com/rust-embedded/cortex-m/compare/v0.7.6...v0.7.7
_stext to the alignment required by the .text section. Fixesaddress (...) of section .text is not a multiple of alignment (...).
_stext is not auto-aligned if it's explicitly overridden by the user. It's their responsibility to align it, else the warning will show.syn v3.Full Changelog: v0.7.6...v0.7.7
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Mark pre_init as deprecated by @romancardenas in #598
.vector_table by @korken89 in #582#[unsafe(link_section = )] for Rust 2024 edition by @yutannihilation in #596pre_init as deprecated by @romancardenas in #598cortex-m-rt: Fix build command in docs by @mfil in #611Full Changelog: c-m-rt-v0.7.5...c-m-rt-v0.7.6
critical-section-single-core feature which provides an implementation for the critical-section crate for single-core systems, based on disabling all interrupts. (#448)pre_init as deprecatedset_msplim feature to conditionally set the MSPLIM register at device
reset ([#580]).skip-data-copy feature to prevent copying the .data section from the
load address to the virtual address. Use when the load address is inaccessible
by the time user code runs, such as when copying from flash or when booting
from an external device. Note that this relies on the bootloader to have already
copied .data to the VMA before relinquishing control.the ptr() function on all peripherals register blocks in favor of the associated constant PTR (#386).
ptr() function on all peripherals register blocks in favor of
the associated constant PTR (#386).inline-asm feature no longer requires a nightly Rust compiler, but
does require Rust 1.59 or above.singleton!() statics sometimes ending up in .data instead of .bss (#364, #380).
(Backported from upcoming 0.8 release)._stack_end symbol is added, e.g. for use with MSPLIM (#565)unsafe block and allow(static_mut_refs)
when generating the &'static mut references in entry/interrupt handlers
(#561, #558)expect attribute now permitted on entry/interrupt handlers (#557)paint-stack feature which writes a fixed value to the entire stack
during initialisation (#548)_HardFault is now placed in the .HardFault.user
linker section (#535)DWT::get_cycle_count has been deprecated in favor of DWT::cycle_count. This change was made for consistency with the [C-GETTER] convention.
DWT.set_cycle_count (#347).cm7 to enable access to these (#352).delay::Delay::with_source, a constructor that lets you specify
the SysTick clock source (#374).DWT::get_cycle_count has been deprecated in favor of DWT::cycle_count.
This change was made for consistency with the C-GETTER convention. (#349)zero-init-ram feature to initialize RAM with zeros on startup.
This can be necessary to properly initialise hardware error detection.exception argument for HardFault.
It has one option trampoline which is true by default. When set to false,
no trampoline will be created and the function will be called as the
exception handler directly.embedded-hal version 1.pre_init function.Fixed compilation for native targets on non-x86 host systems (#336, #337).
Delay struct now offers direct delay_us() and delay_ms() methods
without having to go through the embedded-hal traits (#344).Fixed a bug where calling asm::delay() with an argument of 0 or 1 would underflow, leading to a very long delay.
asm::delay() with an argument of 0 or 1 would
underflow, leading to a very long delay.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.msp::write has been deprecated in favor of asm::bootstrap. It was not possible to use msp::write without causing Undefined Behavior, so all existing u…
asm::semihosting_syscall, asm::bootstrap, and
asm::bootload.msp::write has been deprecated in favor of asm::bootstrap. It was not
possible to use msp::write without causing Undefined Behavior, so all
existing users are encouraged to migrate.asm::delay which could lead to incorrect codegen and
infinite loops.asm::delay on multiple-issue CPU cores.Peripherals struct is now non-exhaustive, so fields may be added in future non-breaking changes
InterruptNumber trait is now required on interrupt arguments to the
various NVIC functions, replacing the previous use of Nr from bare-metal.
For backwards compatibility, InterruptNumber is implemented for types
which are Nr + Copy, but this will be removed in a future version.PTR is introduced to Core Peripherals to
eventually replace the existing ptr() API.asm/lib.rs documentation for more details.inline-asm feature enabled used pre-built
objects which were built by a GCC compiler, while inline-asm enabled the
use of llvm_asm! calls. The asm system has been replaced with a new
technique which generates Rust static libs for stable calling, and uses the
new asm! macro with inline-asm. See the asm/lib.rs documentation for
more details.ptr() methods are now const.SCB::invalidate_dcache and related methods are now unsafe, see #188Peripherals struct is now non-exhaustive, so fields may be added in future
non-breaking changesaligned dependencyNVIC::clear_pendingNVIC::disableNVIC::enableNVIC::set_pendingSCB::system_resetbasepri, basepri_max, and faultmask registers from thumbv8m.basemain symbol (#278).HardFaultTrampoline and FpuTrampoline) (#294).ExceptionFrames fields private, adding setters and getters instead
(#239).Backport: Mark .bss as NOLOAD ([#265])
Backport: Allow building the crate for macOS targets ([#306], [#310]).
(ARMv6-M) Set LR value to a known value on reset (as the ARM spec requires)
HardFaultTrampoline)Fixed lint warnings getting emitted on macro-generated code.
Macros now generate a second trampoline function instead of randomizing the function's symbol name. This makes the build deterministic.
static mut resources no longer have 'static lifetime
except in the #[entry] function (this is a soundness fix; see #212).Linker template now takes and discard *(.ARM.exidx)
*(.ARM.exidx)Input .uninit.* sections are now collected into an output .uninit section. Uninitialized static variables are meant to be placed in these sections. Th
.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.Correct stack-pointer is selected on HardFault
HardFault*(.ARM.extab.*)armv8-m.mainauthorsentry / exception / interrupt: #[cfg] attributes used on static mut variables are now properly handled.
#[cfg] attributes used on static mut
variables are now properly handled.Fixed missing ITM reexport on thumbv8m.base targets.
thumbv8m.base targets.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 HardFaults.
This release is forwards-compatible with cortex-m 0.7, and depends on and re-exports many types from that version. Both 0.6.5 and 0.7 may co-exist in
This release is forwards-compatible with cortex-m 0.7, and depends on and re-exports many types from that version. Both 0.6.5 and 0.7 may co-exist in a build.
.stack_sizes by default, for use with external tooling.#[interrupt] attribute added, similar to #[exception] for
use with device-specific interrupt handlers.(macros) Improved the error message when any of the attribute is used on the wrong kind of item.
(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.
Initial Cortex-M Security Extension support for armv8m
UDF intrinsicasm::delay not updating status clobber flagsllvm_asm! to support inline assembly on new nightliesis_fifo_ready improved to support armv8Worked around a Cargo limitation that broke builds that depend on rand.
Worked around a Cargo limitation that broke builds that depend on rand.
Updated the documentation link in the README to point to working docs.
Produce a better error message if two (or more) copies of cortex-m-rt are going to be linked into a binary.
cortex-m-rt are
going to be linked into a binary.[breaking-change] the entry!, pre_init! and exception! macros have been replaced with attributes: #[entry], #[pre_init] and #[exception], respectively
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.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This crate no longer depends on arm-none-eabi-gcc.
arm-none-eabi-gcc.A pre_init! macro and related functionality to run a function immediately after reset, before memory initialisation
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 .dataA recompilation problem where this cortex-m-rt would be recompiled every time cargo build is invoked.
cortex-m-rt would be recompiled every time cargo build is
invoked.An entry! macro to set the entry point of the program.
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.
LLD support. The linker script provided by this crate has been tweaked to support both LLD and GNU LD. To use LLD as a linker change .cargo/config to
.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.
Nothing published for this version
### Fixed - Support the newest nightly
### Fixed - dev channel support
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
Fictitious .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.
### Fixed - Support for recent nightlies.
Dynamically support recent nightlies, which have the termination lang item, and nightly-2017-09-22, which doesn't. That nightly version is used by the
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.The nightly date check from build script that improved error messages for users of old, unsupported nightlies. Unfortunately the check was preventing
### Fixed - cargo doc warnings
cargo doc warningsThe start lang item to match the new signature
Termination lang itemstart lang item to match the new signatureSupport for overriding the DEBUG_MONITOR exception handler on ARMv7-M.
Builds with multiple codegen units by forcing the linker to look harder for the exceptions vector table.
Remove duplication of default exception handlers. This saves 32 bytes of Flash memory (.text).
Align 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 en
Align 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.
Updated the documentation: it's no longer necessary to use the compiler-builtins repository since that crate landed in rust-lang/rust and it's now ava
rust-src component.### Changed - Tweaked documentation
A warning when compiling for x86_64 and the "abort-on-panic" feature is enabled.
A default_handler! macro to override the default exception handler.
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).
Nothing published for this version
A non-allocatable .stlog section to support the [stlog] logging framework.
.stlog section to support the stlog logging framework.A _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
_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.A _sheap symbol where the heap can be located.
_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.Do not load the .debug_gdb_script section in flash. It's only needed for debugging.
.debug_gdb_script section in flash. It's only needed for
debugging.[breaking-change] the _stack_start symbol is now required and must be provided in the memory.x file when using the "linker-script" feature. This symbo
_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.### Fixed - A rustdoc warning
rustdoc warningUnclutter the reset_handler function for a better debugging experience.
reset_handler function for a better debugging experience.### Changed - Improved linker error messages
[Unreleased]: https://github.com/rust-embedded/cortex-m/compare/c-m-rt-v0.7.7...HEAD [v0.7.7]: https://github.com/rust-embedded/cortex-m/compare/c-m-r
Initial release
One column per quarter.