liveBook · Manning

QEMU

As explained in Embedded Software with Rust

QEMU is an open-source machine emulator and virtualizer capable of emulating processors and complete computer systems.

QEMU runs embedded firmware in a simulated computer system, letting you test and iterate without depending on physical hardware. Its system mode can model a CPU, memory, and some board peripherals. section 1.7.2 section 2.7.2

For bare-metal Rust, QEMU can run application logic, startup code, and semihosting-based output. Peripheral support is incomplete, and RTT is unsupported in the described setup, so emulation is a useful first step—not a substitute for checking firmware on real hardware. section 2.7.2

A basic embedded Rust workflow adapts the target project to a modeled board:

  • Select the STM32F100 device used by the modeled STM32VLDISCOVERY board instead of the STM32F103 target. section 2.7.2
  • Update the memory map, build the firmware, and launch it with QEMU’s ARM system emulator. section 2.7.2
  • Use semihosting for output; the described QEMU setup does not support RTT. section 2.7.2
qemu-system-arm -machine stm32vldiscovery \
                -cpu cortex-m3 \
                -nographic \
                -semihosting-config enable=on,target=native \
                -kernel target/thumbv7m-none-eabi/release/bluepill-blinky

Example command for running a Cortex-M3 firmware image on the STM32VLDISCOVERY model with semihosting enabled. section 2.7.2

How Embedded Software with Rust covers it

How deep it goes
Explains system-mode board emulation and a bare-metal run setup, while noting incomplete peripheral modeling and unsupported RTT.
Examples
Demonstrates adapting STM32F103-targeted firmware to STM32VLDISCOVERY and using semihosting for output.
What it assumes
Assumes an existing embedded Rust project and toolchain, then adapts its device target and memory map for emulation.
What you can do after
Operate QEMU to run bare-metal Rust firmware on a modeled Cortex-M board and produce semihosted output.
How it connects
Connects embedded Rust with firmware testing, ARM Cortex-M, STM32 boards, and semihosting.

Also explained in

Compare how 2 books explain QEMU →

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.