liveBook · Manning

Target triple

As explained in Embedded Software with Rust

A target triple is a standardized identifier describing the processor architecture, vendor, operating system, and binary environment for which software is built.

A target triple identifies the architecture, optional vendor, system, and ABI for which Rust software is built. Embedded targets commonly use “none” for the system because they run bare metal. section 2.1.4

<architecture>-<vendor>-<system>-<abi>

Read the identifier as architecture-vendor-system-ABI; some embedded targets omit meaningful vendor or system values. section 2.1.4

Match the target to the microcontroller before building:

  • Choose the architecture for the MCU family and an ABI that matches its floating-point hardware; check the datasheet or reference manual. section 2.1.5
  • Set the target in the [build] section of .cargo/config.toml so Cargo builds for that hardware by default. section 2.4.3

Embedded targets

thumbv7em-none-eabihf targets Cortex-M4 or Cortex-M7 devices with hardware floating-point; thumbv7m-none-eabi is used for a Cortex-M3 build. section 2.1.4 section 2.4.3

How Embedded Software with Rust covers it

How deep it goes
Explains the identifier's fields, hardware-matching pitfalls, and use in Cargo configuration through concrete MCU targets.
Examples
Compares thumbv7em-none-eabihf for Cortex-M4/M7 hardware with thumbv7m-none-eabi for Cortex-M3.
What it assumes
Uses the MCU's architecture and floating-point capabilities, which should be checked against its datasheet or reference manual.
What you can do after
Configure Cargo's embedded build target and select an ABI that matches the microcontroller's floating-point capabilities.
How it connects
Links architecture, ABI, cross-compilation, Cargo configuration, and linker scripts.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Embedded Software with Rust. The section links point to the parts of the book it draws on.