The Rust compiler supports the Cortex-M architecture but this doesn't work out of the box:
$ cargo build --target thumbv6m-none-eabi
for two reasons:
thumbv6m-none-eabi is not a "built-in" target so you have to supply your own target definition.
cargo build doesn't compile the standard crates and there's no binary release of the standard
crates for this target.
The upstream solution is to either:
- Add the thumb targets to the compiler and also provide binary releases of the standard crates
for them. Or,
- Just add the targets and teach Cargo how to build the standard libraries "on the fly".
This is being worked on. Seems like the Rust team is leaning towards the second solution. You can
track the upstream status in:
The Rust compiler supports the Cortex-M architecture but this doesn't work out of the box:
for two reasons:
thumbv6m-none-eabiis not a "built-in" target so you have to supply your own target definition.cargo builddoesn't compile the standard crates and there's no binary release of the standardcrates for this target.
The upstream solution is to either:
for them. Or,
This is being worked on. Seems like the Rust team is leaning towards the second solution. You can
track the upstream status in:
corerust-lang/rfcs#1645 Add the thumb targets