What you will learn in Embedded Software with Rust
Chapter by chapter
Chapter 1: The Foundations of embedded Rust development
Introduces embedded systems and explains why Rust’s safety guarantees matter for dependable firmware on constrained hardware.
What you learn in chapter 1 →Chapter 2: Setting up your Rust tool-chain
This chapter introduction previews the tools and workflows for setting up an embedded Rust development environment.
What you learn in chapter 2 →Chapter 3: Project structure and configuration
The introduction explains why developers need to understand embedded Rust project structure beyond what a generated template provides.
What you learn in chapter 3 →Chapter 4: Startup and Initialization in Bare-Metal Rust
This chapter introduction previews how Chapter 4 will build on project and build-system foundations to cover bare-metal startup, memory layout, runtime setup, and interrupt handling in no_std Rust.
What you learn in chapter 4 →Chapter 5: Memory-Mapped I/O, Register Abstractions, and Low-Level Control on Cortex-M
The chapter shifts from firmware startup to correctness-sensitive, day-to-day hardware interaction on Cortex-M.
What you learn in chapter 5 →Chapter 6: Debugging, observability, and profiling
The introduction explains why observing a bare-metal Rust program requires an explicit path for information to reach the developer.
What you learn in chapter 6 →Chapter 7: Managing stack and heap in resource-constrained systems
The chapter introduction explains why embedded Rust programmers must make deliberate memory-placement choices despite Rust’s ownership guarantees.
What you learn in chapter 7 →Chapter 8: Rust-C Integration and Migration
The chapter introduction explains why integrating embedded Rust with existing C code requires care at the language boundary.
What you learn in chapter 8 →Concepts explained in this book
- hardware abstraction layerA hardware abstraction layer is a software interface that represents hardware peripherals while hiding device-specific implementation details.
- no_std programno_std is a Rust crate configuration that excludes the standard library.
- semihostingSemihosting is a development technique in which code on a target device requests services such as text output from a host debugger through a debug connection.
- interrupt vector tableA table of memory addresses that supplies the initial stack pointer and exception or interrupt handler addresses used by a processor.
- HardFaultHardFault is a Cortex-M processor exception raised when a fault cannot be handled by a more specific enabled fault handler or escalates to HardFault.
- peripheral access crateA peripheral access crate is a typically auto-generated Rust library that exposes fine-grained access to the registers and bit fields of a specific microcontroller family.
- reset handlerA reset handler is the startup routine executed after a processor reset to initialize execution and transfer control to application code.
- Arm Cortex-MArm Cortex-M is a family of energy-efficient processor cores designed primarily for microcontrollers and embedded systems.
- embedded-halembedded-hal is a Rust crate defining standardized traits for accessing common embedded peripherals and services independently of specific hardware.
- memory layoutA memory layout specifies the placement of a program's code, data, stack, and other regions in memory.
- raw pointerRaw pointer dereferencing accesses memory through a Rust raw pointer without the safety guarantees of an ordinary reference.
- stack overflowStack overflow is the exhaustion of a thread's stack space by nested calls, local data, or other stack allocation.
- RTT loggingReal-Time Transfer is a low-intrusion mechanism for exchanging data between a running embedded target and a host through target-memory buffers.
- bss sectionThe .bss section represents zero-initialized or uninitialized static storage that is cleared during startup.
- data sectionThe .data section contains initialized writable data whose initial values are copied to writable memory during startup.
- DSBdsb is a Cortex-M data synchronization barrier instruction that waits for preceding memory operations to complete before subsequent instruction execution.
- stackA stack is a last-in, first-out memory structure used for nested execution state and temporary data.
- memory barrierA barrier instruction is a processor instruction that constrains the ordering or completion of memory operations.
- flash memoryFlash memory is nonvolatile semiconductor memory that retains data without power and can be electrically erased and rewritten.
- application binary interfaceAn application binary interface specifies binary-level conventions for calling functions, representing data, and interoperating between compiled software components.
- alloc crateRust’s allocation library, providing heap-allocated collections and related types when an allocator is available.
- DMBDMB is an Arm Data Memory Barrier instruction that enforces ordering of relevant memory accesses without necessarily waiting for them to complete.
- global allocatorThe program-wide provider used to allocate and release heap memory.
- initial stack pointerThe initial stack pointer is the stack address loaded by a processor when it begins executing an image.
- linker scriptA linker script is a script that directs a linker when arranging input sections and assigning addresses in an output image.
- embedded RustEmbedded Rust is the practice of developing firmware for embedded or bare-metal targets using Rust.
- ISBISB is an Arm Instruction Synchronization Barrier that flushes the processor pipeline and causes subsequent instructions to be fetched under preceding configuration changes.
- probe-rsThe probe-rs crate is a Rust library for communicating with debug probes, flashing embedded targets, and capturing RTT data.
- heapA heap is a region of dynamically managed memory used for runtime allocation.
- panic handlerA panic handler is the Rust-defined function that determines how a panic is handled in a target without the hosted panic runtime.
- cargo-embedcargo-embed is a Cargo subcommand for flashing and debugging embedded targets with project-file-based configuration and RTT output streaming.
- cargo featureA Cargo feature is a named compile-time option that conditionally enables code or dependencies in a Rust package.
- flip-linkflip-link is a linker wrapper that rearranges embedded memory layouts to place the main stack below other RAM sections and detect downward stack overflow.
- defmtdefmt is a binary logging framework for no_std firmware that stores format strings in the binary and defers message reconstruction to a host decoder.
- link_section attributeThe Rust link_section attribute places an item in a named object-file section.
- rust bindgenbindgen is a tool that generates Rust foreign-function interface declarations from C and C++ headers.
- cargo.tomlCargo.toml is the TOML-formatted manifest file that declares a Rust package's metadata, dependencies, and build configuration.
- c-style enumA C type whose values are named enumerators.
- exact-width integer typeA fixed-width integer type is an integer type whose bit width is specified rather than selected by implementation defaults.
- repr(transparent)repr(transparent) is a Rust representation attribute that gives a single-field wrapper the same memory representation as its field.
- repr(u8)repr(u8) is a Rust representation attribute that gives an enum an unsigned 8-bit integer representation.
- volatile accessA volatile memory access is a read or write that the compiler must preserve as an observable memory operation.
- RustRust is a systems programming language designed for memory safety, concurrency, and low-level control without requiring garbage collection.
- heaplessheapless is a Rust library providing statically allocated, fixed-capacity collections and related data structures for environments where heap allocation is unavailable or undesirable.
- memory-mapped register blockA memory-mapped register block is a structured set of hardware control and status registers exposed at memory addresses for programmatic access.
- static libraryAn archive of compiled object code that a linker incorporates into an executable during linking.
- dynamic allocationHeap allocation is the dynamic reservation of memory from a program's heap.
- static storageMemory whose allocation persists for the entire execution of a program.
- device driverA device driver is software that presents an interface for controlling and communicating with a hardware device.
- NOLOADNOLOAD is a linker-script directive that reserves runtime memory for a section without storing its contents in the loadable image.
- sections blockA SECTIONS block is a linker-script construct that maps output sections to declared memory regions and controls their placement.
- C representation`repr(C)` is a Rust representation attribute that applies C-compatible layout rules to a type.
- core libraryRust's core crate provides fundamental types, traits, and APIs without depending on an operating system or heap.
- alignmentAlignment is the placement of a data object at an address satisfying the boundary requirements of its representation or hardware access.
- memory.xmemory.x is a conventional linker-script fragment that declares embedded memory regions for a Rust firmware build.
- BKPT instructionBKPT is an Arm breakpoint instruction that generates a debug breakpoint event.
- unsafe RustUnsafe Rust is Rust code that uses operations requiring the programmer to uphold safety invariants the compiler cannot verify.
- alignmentMemory alignment is the placement of data or code at addresses satisfying the alignment requirements of the target architecture.
- memory-mapped I/OMemory-mapped I/O exposes hardware registers in a processor's address space so software can access them through memory operations.
- OpenOCDOpen On-Chip Debugger is open-source software that provides debugging, in-system programming, and boundary-scan access through hardware probes.
- ITMThe Instrumentation Trace Macrocell is an Arm trace component that emits instrumentation data through trace interfaces such as SWO.
- no_mangleThe Rust no_mangle attribute preserves an item's externally visible symbol name instead of applying name mangling.
- unsafe blockAn unsafe block is a Rust construct in which operations requiring explicit programmer verification, such as raw-pointer dereferencing, are permitted.
- asm!asm! is Rust's inline assembly macro for embedding target-specific instructions with explicit operands and options.
- write_volatilewrite_volatile is a Rust operation that writes a value to a memory location using volatile semantics, preventing the compiler from eliding or merging the access.
- MemManage FaultA memory management fault is a processor exception raised when an access violates a memory protection region's permissions.
- UsageFaultUsageFault is a configurable Cortex-M fault exception raised for prohibited or undefined processor usage such as certain instructions, alignment violations, or trapped division by zero.
- memory locationA memory region is a contiguous address range with a defined role or access behavior in a processor's address space.
- emulationEmulation is the reproduction of a target system's behavior so software can run or be tested without the original hardware.
- fixed-capacity structureA fixed-capacity container is a container whose maximum number of stored elements is bounded in advance and whose storage can be provided without dynamic allocation.
- smallvecA Rust crate providing vector-like collections that store a limited number of elements inline before spilling to the heap.
- tinyvecA Rust crate providing vector-like collections with inline storage and optional heap-backed growth.
- read-only data sectionThe .rodata section contains read-only static data in a program image.
- text sectionThe .text section is an executable program section containing machine code.
- foreign function interfaceA mechanism for declaring and calling functions across programming-language boundaries using compatible binary conventions.
- cortex-m-rtcortex-m-rt is a Rust runtime crate that provides startup and exception-handling support for Cortex-M microcontrollers.
- safe wrapperA safe wrapper is an interface that encapsulates operations requiring unsafe interaction behind safe-to-call abstractions.
- interrupt handlerAn interrupt handler is a routine invoked asynchronously in response to a hardware or software interrupt.
- QEMUQEMU is an open-source machine emulator and virtualizer capable of emulating processors and complete computer systems.
- peripheralA peripheral is a hardware component connected to a processor that provides a specialized input, output, communication, timing, or control function.
- Embed.tomlEmbed.toml is a project configuration file used by cargo-embed to specify embedded-target settings such as the chip, probe protocol, and enabled features.
- runner configurationA Cargo runner is a target-specific setting that specifies the command used to launch or flash a built program.
- microcontrollerA microcontroller is an integrated computing device that combines a processor, memory, and peripherals for dedicated embedded control tasks.
- compiler intrinsicAn intrinsic function is a compiler- or architecture-provided function that exposes a low-level operation with direct correspondence to machine instructions.
- execution environmentA runtime environment is the collection of execution support, hardware state, and software facilities available to a running program.
- guard regionAn MPU guard region is a memory-protection boundary configured to make accesses beyond a permitted region fault.
- BSRRBSRR is an STM32 GPIO bit set/reset register that atomically sets or clears individual output bits without reading the current port state.
- read-modify-write operationRead-modify-write reads a value, changes selected parts, and writes the result back to the same location.
- GDB serverA GDB server is a program that mediates between GDB's remote protocol and a target debug probe, translating debugger requests into probe-specific operations.
- portabilityPortability is the ability of software or development methods to operate across different hardware architectures or platforms with limited adaptation.
- profilingProfiling is the measurement of a program's execution behavior to characterize its performance.
- unaligned accessAn unaligned access is a processor memory access whose address does not satisfy the alignment required by the accessed value or instruction.
- repr(align)`repr(align)` is a Rust representation attribute that raises a type's minimum alignment to a specified boundary.
- cargo-call-stackcargo-call-stack is a Rust analysis tool that estimates program stack usage from compiler-emitted per-function stack-size metadata and call paths.
- Memory Protection UnitA Memory Protection Unit (MPU) is processor hardware that enforces access permissions for configured memory regions without providing virtual-memory translation.
- outputpinOutputPin is an embedded-hal trait defining operations for driving a digital output pin high or low.
- arrayvecarrayvec is a Rust library providing vector-like collections backed by fixed-capacity inline arrays and supporting no_std environments.
- vector table sectionA linker output section containing the processor’s vector table.
- output sectionAn output section is a linker-generated memory-image section formed by collecting selected input sections and assigning them an address and region.
- load memory addressA load memory address (LMA) is the address where a program section's contents are stored in the loadable image.
- virtual addressA virtual address is the runtime address at which a program section or object is located and accessed.
- typed register overlayA struct overlay represents a hardware register block as a typed structure whose fields correspond to registers at fixed memory offsets.
- build scriptA Cargo build script is a Rust program, conventionally named build.rs, that Cargo runs before compiling a package to perform build-time tasks.
- memory fragmentationThe division of free memory into separated regions that can make allocation requests harder to satisfy.
- memory safetyMemory safety is the property that software accesses memory only in valid ways, preventing errors such as use-after-free and out-of-bounds access.
- entry pointThe function or location at which execution begins for a program or runtime path.
- cargo-generatecargo-generate is a Cargo subcommand that creates projects from templates.
- callbackA callback is a function supplied to another component so that component can invoke it later in response to a particular condition or event.
- context pointerA generic pointer passed alongside a callback function pointer so a library can return associated caller-provided data when invoking the callback.
- embedded-allocembedded-alloc is a Rust crate providing heap allocators for resource-constrained embedded targets, including Cortex-M systems.
- stringA string is a sequence of characters represented as data.
- type stateThe typestate pattern represents an object's state in its type so that operations can be restricted to valid states at compile time.
- bindingA declaration describing a foreign-language function or data type so code in another language can interact with it.
- memory placementMemory-region placement is the assignment of an object or section to a specific address range in a program's memory layout.
- memory allocatorA memory-management component that reserves and releases dynamically managed storage.
- linker sectionA linker section is a named region of an object or executable image containing input or output data such as code, initialized data, or uninitialized data.
- target tripleA target triple is a standardized identifier describing the processor architecture, vendor, operating system, and binary environment for which software is built.
- vectorA vector is Rust's owned, growable vector type for storing elements contiguously on dynamically allocated storage.
- wfiWFI is a processor instruction that puts the core into a low-power wait state until an interrupt or other wake-up event occurs.
- critical-sectionA Rust crate that provides a portable abstraction for entering and executing code within critical sections.
- PRIMASKPRIMASK is a Cortex-M processor register that controls whether most configurable interrupts are permitted.
- svd2rustsvd2rust is a code-generation tool that converts a microcontroller SVD description into Rust peripheral-access source code.
- main stack pointerMSP is the Cortex-M Main Stack Pointer system register holding the active main-stack address.
- static analysisStatic analysis is the examination of program properties from source or compiled artifacts without executing the program.
- interruptAn interrupt is a hardware or software event that requests processor attention and can trigger execution of an associated handler.
- cbindgencbindgen is a tool that generates C and C++ header files from Rust source code.
- control and status registerA system register is a processor register in the architectural system-register file that controls or reports execution state and core configuration.
- Peripherals::take()Peripherals::take() is a singleton-acquisition function that returns exclusive access to a device's peripheral handles when they have not already been taken.
- global_asm!global_asm! is a Rust macro that emits module-level assembler text as standalone symbols in the resulting object or executable.
- GDBGDB is the GNU source-level debugger for controlling and inspecting program execution.
- assembly operand constraintA register operand constraint directs inline assembly to bind an operand to a compiler-selected register for input, output, or read-modify-write access.
- binutilsGNU Binutils is a collection of command-line utilities for inspecting, manipulating, assembling, and linking binary program files.
- bare-metal targetA bare-metal target is an execution platform on which software runs directly on hardware without an operating system.
- peripheral handleA peripheral handle is an owning value that grants exclusive software control over a peripheral's memory-mapped registers.
- stack sizeStack usage is the amount of stack memory required by a program or execution path, including nested calls and interrupt handling.
- hardware registerA processor register is a small storage location directly accessible to the processor for holding values during execution.
- process stack pointerThe process stack pointer is a processor register that identifies the stack used by process or unprivileged execution contexts.
- runtime crateA runtime crate supplies target-specific startup and exception-handling support for an embedded application.
- cycle-accurate timingCycle-accurate timing is timing behavior that matches the precise processor-cycle execution of the real hardware.
- trampolineA small intermediary function that adapts a generic callback interface to the specific function and data types expected by the implementation.
- .cargo/config.toml.cargo/config.toml is Cargo's project configuration file for specifying build targets, linker arguments, and runner commands.
- CargoCargo is Rust's package manager and build system, providing dependency management, compilation, testing, and related project workflows.
- Knurling workflowKnurling is an ecosystem of tools and libraries for embedded Rust development, including flashing, logging, testing, and debugging workflows.
- stm32f1xx-halstm32f1xx-hal is a Rust hardware abstraction layer crate for STM32F1 microcontrollers.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
