cortex-m-rt
Minimal runtime / startup for Cortex-M microcontrollers
0.7.6
8.4M downloads/mo
#3416 most downloaded on crates.io
rust-embedded/cortex-m
What this package is like to depend on
Last release 25 days ago
29 Jul 2026
Release timing varies
gaps range from 4 weeks to 1.7 years
Most releases are documented
notes for 29 of 36 stable releases
23 versions withdrawn
withdrawn after publishing
9 years old
59 releases · first in 2017
1 release in the last 12 months
see the full history below
Release timeline
59 releases · Apr 2017 to Jul 2026Releases
latest 59-
0.7.629 Jul 2026Release notes
Open source →v0.7.6 - 2022-08-12
- Added
critical-section-single-corefeature which provides an implementation for thecritical-sectioncrate for single-core systems, based on disabling all interrupts. (#448)
Release notes
Open source →What's Changed
- cortex-m-rt: fix off-by-one in .text in FLASH section assert by @9names in #573
- Fix _stack_end usage and doc by @tlevora in #577
- cortex-m-rt: Add optional MSPLIM initialization, fix vector table size on armv8m by @decaday in #580
- cortex-m-rt: Add alignment check for the
.vector_tableby @korken89 in #582 - Fix stack end placement by @tlevora in #578
- fix(coretex-m-rt-macros): Allow
#[unsafe(link_section = )]for Rust 2024 edition by @yutannihilation in #596 - Mark
pre_initas deprecated by @romancardenas in #598 - Fix __pre_init example by @eulerdisk in #600
cortex-m-rt: Fix build command in docs by @mfil in #611- Add skip-data-copy feature for when the .data LMA isn't initialized after boot. by @BenChung in #615
- Rename Cortex-M Team to Arm Team by @thejpster in #622
- Update remaining crates to edition 2021. by @wt in #621
- doc: add missing ; in _stext example by @ericu07 in #624
- Update msrv by @wt in #628
- Remove deprecated Cargo.toml authors. by @wt in #631
- Add cortex-m-rt/macros to the workspace members. by @wt in #635
- docs(msrv): unify rust-version to 1.85 across workspace by @reubenueben in #669
- Remove cortex-m deps by @thejpster in #667
- Update to checkout action v7 by @thejpster in #668
- Release cortex-m-rt by @jonathanpallant in #675
New Contributors
- @9names made their first contribution in #573
- @tlevora made their first contribution in #577
- @decaday made their first contribution in #580
- @jonathanpallant made their first contribution in #588
- @yutannihilation made their first contribution in #596
- @romancardenas made their first contribution in #598
- @eulerdisk made their first contribution in #600
- @mfil made their first contribution in #611
- @BenChung made their first contribution in #615
- @wt made their first contribution in #621
- @ericu07 made their first contribution in #624
- @jakobjung10 made their first contribution in #664
- @robamu made their first contribution in #657
- @leftger made their first contribution in #647
- @reubenueben made their first contribution in #669
Full Changelog: c-m-rt-v0.7.5...c-m-rt-v0.7.6
- Added
-
0.7.505 Nov 2024Nothing published for this version
-
0.7.416 Apr 2024 withdrawnNothing published for this version
-
0.7.314 Feb 2023Nothing published for this version
-
0.7.208 Nov 2022 withdrawnNothing published for this version
-
0.7.125 Nov 2021 withdrawnNothing published for this version
-
0.7.017 Aug 2021Nothing published for this version
-
0.6.1522 Jul 2021Release notes
Open source →Fixed
- Backport: Mark .bss as NOLOAD (#265)
- Backport: Fix possible overflow of .data region (#286)
- Backport: Perform volatile reads of ICSR in DefaultHandler (#315)
Other
-
0.6.1419 May 2021 withdrawnRelease notes
Open source → -
0.6.1307 Sep 2020 withdrawnRelease notes
Open source →Fixed
- (ARMv6-M) Set LR value to a known value on reset (as the ARM spec requires)
- Added CFI and size info to external assembly subroutines (
HardFaultTrampoline)
-
0.6.1226 Jan 2020 withdrawn -
0.6.1104 Dec 2019 withdrawnRelease notes
Open source →Changed
- Macros now generate a second trampoline function instead of randomizing the function's symbol name. This makes the build deterministic.
- [breaking-change]
static mutresources no longer have'staticlifetime except in the#[entry]function (this is a soundness fix; see #212).
-
0.6.1027 Jul 2019 withdrawn -
0.6.911 Jul 2019 withdrawnRelease notes
Open source →Added
- Input
.uninit.*sections are now collected into an output.uninitsection. Uninitialized static variables are meant to be placed in these sections. The output.uninitsection is not initialized by the runtime.
- Input
-
0.6.803 Apr 2019 withdrawnRelease notes
Open source →Fixed
- Correct stack-pointer is selected on
HardFault - Linker template now takes and discard
*(.ARM.extab.*) - Misc. documentation fixes
Changed
- Architecture added:
armv8-m.main - Cortex-M team added to
authors - The nightly build is allowed to fail in CI
- Correct stack-pointer is selected on
-
0.6.715 Dec 2018 withdrawnRelease notes
Open source →Fixed
- entry / exception / interrupt:
#[cfg]attributes used onstatic mutvariables are now properly handled.
- entry / exception / interrupt:
-
0.6.607 Dec 2018 withdrawnRelease notes
Open source →Changed
-
Misuse of attributes now produce compiler errors with proper spans instead of panicking messages.
-
The
HardFaultsymbol has been renamed toHardFaultTrampoline; likewise theUserHardFaultsymbol has been renamed toHardFault. If you were using breakpoints onUserHardFaultto detect hard fault you should now put those breakpoints on theHardFaultsymbol.
Fixed
-
Attributes on local
static mutvariables (declared at the beginning ofentry/interrupt/exception) are now respected. -
The "GDB can now unwind HardFault callstacks" fix from the previous release broke
HardFault's'&ExceptionFrameargument (the pointer was off by 8 bytes). This release fixes that problem without compromising GDB's ability to unwindHardFaults.
-
-
0.6.523 Oct 2018 withdrawnRelease notes
Open source →Changed
- We now keep
.stack_sizesby default, for use with external tooling. - (macros) New
#[interrupt]attribute added, similar to#[exception]for use with device-specific interrupt handlers.
Fixed
- GDB can now unwind HardFault callstacks
- We now keep
-
0.6.424 Sep 2018 withdrawnRelease notes
Open source →Changed
- (macros) Improved the error message when any of the attribute is used on the wrong kind of item.
Fixed
-
(macros) The expansion of the
exceptionattribute now uses theextern "C"ABI which is what the hardware expects. -
(macros)
entryandexceptionnow respect the declared unsafety. That is#[entry] unsafe main() -> !won't requireunsafeblocks to useunsafeAPI.
-
0.6.309 Sep 2018 withdrawn -
0.6.208 Sep 2018 withdrawnRelease notes
Open source →Fixed
-
Worked around a Cargo limitation that broke builds that depend on
rand. -
Updated the documentation link in the README to point to working docs.
-
-
0.6.106 Sep 2018 withdrawnRelease notes
Open source →Changed
- Produce a better error message if two (or more) copies of
cortex-m-rtare going to be linked into a binary.
- Produce a better error message if two (or more) copies of
-
0.6.006 Sep 2018 withdrawnRelease notes
Open source →Changed
- [breaking-change] the
entry!,pre_init!andexception!macros have been replaced with attributes:#[entry],#[pre_init]and#[exception], respectively. This also changes the toolchain requirement to 1.30-beta or newer.
- [breaking-change] the
-
0.5.708 Sep 2018Nothing published for this version
-
0.5.607 Sep 2018 withdrawnNothing published for this version
-
0.5.507 Sep 2018 withdrawnNothing published for this version
-
0.5.406 Sep 2018Nothing published for this version
-
0.5.327 Aug 2018 -
0.5.215 Aug 2018Release notes
Open source →Added
- A
pre_init!macro and related functionality to run a function immediately after reset, before memory initialisation
Changed
-
The
entry!andexception!macros now also accept a closure instead of a path. -
DefaultHandlerandUserHardFaultnow default to an infinite loop if left undefined.
Fixed
- Linked script modified to correctly detect
FLASHoverflow caused by.data
- A
-
0.5.114 May 2018Release notes
Open source →Fixed
- A recompilation problem where this
cortex-m-rtwould be recompiled every timecargo buildis invoked.
- A recompilation problem where this
-
0.5.012 May 2018 withdrawnRelease notes
Open source →Added
-
An
entry!macro to set the entry point of the program. -
A
heap_startfunction that returns a pointer into the start of the heap region. -
A
devicefeature. 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.
Changed
-
This crate now compiles on the beta and stable channels.
-
[breaking-change] this crate now requires
arm-none-eabi-gccto be installed and available in$PATHto compile. -
[breaking-change] the
startlang item has been removed. The standardmaininterface won't work. Instead use#![no_main]and theentry!macro. See documentation for details. -
[breaking-change] the
default_handler!macro has been merged into theexception!macro. Useexception!(*, ..)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.
-
-
0.4.009 Apr 2018Release notes
Open source →Added
- 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/configto 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", ]Removed
-
[breaking-change] Stack overflow protection has been removed. Unfortunately, supporting this feature produces totally wrong
arm-none-eabi-sizereports 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_fmtimplementation, has been removed. If you were using this feature you can instead use a panic implementation crate.
- 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
-
0.3.1624 Aug 2018Nothing published for this version
-
0.3.1508 Apr 2018 -
0.3.1401 Apr 2018 -
0.3.1317 Feb 2018Release notes
Open source →Added
-
Fictitious
.stackand.heaplinker sections that represent the locations of the stack and the heap in RAM. You can visualize these linker sections by runningarm-none-eabi-size -Axover your binary. -
Zero cost stack overflow protection when you use the
cortex-m-rt-ldlinker. Check documentation for details. -
A
_heap_sizesymbol that indicates how large the heap is. This symbol is only used whencortex-m-rt-ldis used as a linker.
-
-
0.3.1217 Jan 2018 -
0.3.1117 Jan 2018 withdrawnRelease notes
Open source →Changed
- Dynamically support recent nightlies, which have the
terminationlang 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.
- Dynamically support recent nightlies, which have the
-
0.3.1017 Jan 2018 withdrawnRelease notes
Open source →Removed
- The nightly date check from build script that improved error messages for users of old, unsupported nightlies. Unfortunately the check was preventing this crate and reverse-dependencies from getting their documentation build on docs.rs
-
0.3.907 Jan 2018 -
0.3.829 Dec 2017Release notes
Open source →Added
Terminationlang item
Changed
- The
startlang item to match the new signature
-
0.3.723 Dec 2017Release notes
Open source →Added
- Support for overriding the DEBUG_MONITOR exception handler on ARMv7-M.
-
0.3.603 Oct 2017Release notes
Open source →Fixed
- Builds with multiple codegen units by forcing the linker to look harder for the exceptions vector table.
-
0.3.522 Jul 2017Release notes
Open source →Fixed
- Remove duplication of default exception handlers. This saves 32 bytes of Flash memory (.text).
-
0.3.420 Jul 2017Release notes
Open source →Changed
-
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.
-
-
0.3.315 Jul 2017Release notes
Open source →Changed
- 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 available in the
rust-srccomponent.
- 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 available in the
-
0.3.207 Jul 2017 -
0.3.107 Jul 2017Release notes
Open source →Fixed
- A warning when compiling for x86_64 and the "abort-on-panic" feature is enabled.
-
0.3.007 Jul 2017Release notes
Open source →Added
-
A
default_handler!macro to override the default exception handler. -
An
exception!macro to override the handler for a particular exception.
Changed
-
The FPU will now be enabled before
mainif the target has FPU support. -
[breaking-change] the features "panic-over-itm" and "panic-over-semihosting" has been removed. the
panic_fmtlanguage item is now not included by default. An opt-in feature named "abort-on-panic" can be enabled to make this crate provide apanic_fmtimplementation 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!andexception!. -
The
_stack_startis now optional in thememory.xfile. If unspecified its value will be set toORIGIN(RAM) + LENGTH(RAM).
-
-
0.2.504 Jul 2017Nothing published for this version
-
0.2.404 Jun 2017Release notes
Open source →Added
- A non-allocatable
.stlogsection to support thestloglogging framework.
- A non-allocatable
-
0.2.331 May 2017Release notes
Open source →Added
- A
_stextsymbol which can be specified in the linker script to customize the location of the.textsection. If not specified the.textsection will be placed right after the.vector_tablesection.
- A
-
0.2.227 May 2017Release notes
Open source →Added
- A
_sheapsymbol where the heap can be located.
Changed
- The linker sections have renamed / reorder to make
arm-none-eabi-size -Amore 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_handleris now the entry point of all programs that link tocortex-m-rt. This makes GDB'sloadcommand work correctly. It will now set the Program Counter toreset_handlerafter flashing the program so there's no need to reset the microcontroller after flashing. -
Renamed
__exceptionsand__interruptssymbols, which are only used internally, to_eexceptionsand_einterruptsrespectively for consistency.
Fixed
- Include input
.textand.rodatasections (note: no suffix as in.text.foo) in the output file. (C) Code compiled without the equivalent-ffunction-sections/-fdata-sectionsmay place stuff in those unsuffixed sections.
- A
-
0.2.107 May 2017Release notes
Open source →Fixed
- Do not load the
.debug_gdb_scriptsection in flash. It's only needed for debugging.
- Do not load the
-
0.2.027 Apr 2017Release notes
Open source →Changed
- [breaking-change] the
_stack_startsymbol is now required and must be provided in thememory.xfile when using the "linker-script" feature. This symbol indicates where in memory the call stack will be allocated.
- [breaking-change] the
-
0.1.326 Apr 2017 -
0.1.222 Apr 2017Release notes
Open source →Changed
- Unclutter the
reset_handlerfunction for a better debugging experience.
- Unclutter the
-
0.1.115 Apr 2017 -
0.1.012 Apr 2017