Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To write “Hello, world!” in embedded Rust, build a no_std firmware project for a specific microcontroller, give the linker that chip’s flash and RAM layout, then flash and debug the program using board-compatible tools. The official Embedded Rust Book’s STM32F3DISCOVERY example is a concrete route through those steps: it targets an STM32F303VCT6 and uses OpenOCD and GDB to run the firmware and observe its debug output.

What “Hello, world!” means on a microcontroller

On a desktop, a Rust program can use the operating system and standard library. Bare-metal firmware starts without an operating system already loaded. The Embedded Rust Book puts it plainly: “In a bare metal environment no code has been loaded before your program.” For this reason, the example uses #![no_std] rather than Rust’s standard library. That means it links against core; it does not provide the OS integration or standard heap a typical std program expects. A heap can be added when needed by using alloc together with an allocator, but a first firmware example generally does not require one. Read the Embedded Rust Book’s explanation of no_std.

A firmware “print” also needs a destination. A microcontroller does not automatically have a terminal: output might be routed through a debugger, serial connection, or another board-specific interface. In the walkthrough below, the example’s debug-output mechanism sends “Hello, world!” to the OpenOCD console while GDB is attached. Programming the chip and viewing text are related but distinct jobs: the probe and OpenOCD handle the debug transport, while the example configuration determines where its output goes.

Choose the board and target before creating the project

Reference path: STM32F3DISCOVERY

The Embedded Rust Book’s reproducible walkthrough uses the STM32F3DISCOVERY board, which has an STM32F303VCT6 Cortex-M4F microcontroller. The book documents 256 KiB of flash and 40 KiB of RAM for this board. Those memory figures are specific to the named chip and board; they are not safe defaults for a different STM32 or another manufacturer’s MCU. See the book’s board and hardware setup.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Select the Rust target triple for the chip

A target triple encodes the processor and relevant compilation assumptions, so it is part of the hardware contract rather than a generic setting to copy between projects. For this STM32F3 example, use thumbv7em-none-eabihf. Other Cortex-M families require different triples; floating-point support also affects the suffix. Confirm the correct target for the actual MCU before compiling. The Embedded Rust Book lists target installation guidance.

Create and configure the firmware project

The classic book workflow uses the cortex-m-quickstart template. A template is useful because bare-metal firmware needs more than a Rust source file: it supplies or organizes target configuration, startup/runtime integration, and linker settings. The book also documents cargo-generate for creating a project and cargo-binutils as part of the embedded tooling ecosystem. Review the book’s tooling overview.

  1. Install Rust with rustup, then add the target for this board: rustup target add thumbv7em-none-eabihf. If you choose a different MCU, substitute its documented Rust target instead. The installation chapter covers target selection.

    Rank #2
    Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
    • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
    • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
    • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
    • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
    • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
  2. Generate or create a project from cortex-m-quickstart (or an equivalent embedded template), then retain its runtime and linker integration rather than treating it as an ordinary host application. The template is a starting point, not proof that its memory settings match every board.

    What’s actually slowing this PC down?

    Pick the symptom - the matching free tool is one click away.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Set the build target in .cargo/config.toml to thumbv7em-none-eabihf for the STM32F3DISCOVERY example. This ensures Cargo builds for the microcontroller rather than for the computer running the command.

  4. Configure memory.x with the chip’s actual flash and RAM regions. For the documented STM32F303VCT6 board, the book’s memory map corresponds to 256 KiB flash and 40 KiB RAM. If using another board, consult its MCU datasheet or reference manual and update the addresses and sizes: a project can compile with an incorrect map yet fail to run because the linker placed code or data in nonexistent memory.

    Rank #3
    Sale
    Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
    • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
    • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
    • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
    • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
    • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
  5. Use the example’s embedded entry point and debug-output mechanism to emit “Hello, world!” once, then leave the firmware in loop {}. For physical hardware, remove or comment out the QEMU-only debug::exit call: the book warns that it should not be run on hardware. The hardware chapter contains the hello example and board-specific cautions.

Build, flash, and see the message

For the book’s STM32F3DISCOVERY setup, the high-level sequence is to build the hello example, connect to the board through its ST-LINK interface using OpenOCD, then use GDB to load and run the firmware. The exact probe configuration and GDB commands depend on the project and installed versions of the tooling, so use the configuration provided by the selected template and the board walkthrough rather than assuming one universal command line.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. From the project directory, build the example with cargo build --example hello. Resolve target or linker errors before attempting to flash; in particular, check the configured target and the flash/RAM values in memory.x.

    Rank #4
    Sale
    UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
    • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
    • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
    • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
    • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
    • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
  2. Connect the STM32F3DISCOVERY board to the computer through its ST-LINK interface and start OpenOCD with the board-compatible configuration described by the project and tooling instructions.

  3. Start GDB with the firmware artifact, connect it to the OpenOCD server, load the program, and continue execution using the commands for the template’s debug setup. The hardware walkthrough demonstrates this OpenOCD/GDB flow.

  4. Read the OpenOCD console for “Hello, world!” The example then remains in loop {}, so it prints once rather than repeatedly. If the firmware runs but the console stays blank, check that the expected debug-output configuration is enabled and that output is directed to the console you are watching; successful flashing alone does not guarantee visible text.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    Best Value
    Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
    • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
    • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
    • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
    • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
    • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose between the classic book workflow and Embassy

The classic Embedded Rust Book route is useful when the goal is to understand how target selection, startup support, linker scripts, memory maps, flashing, and debugging fit together. Embassy is a framework-oriented route with board examples and async support; its getting-started guidance recommends rustup and either probe-run or OpenOCD, and names STM32 Nucleo, STM32 Discovery, and nRF kits among possible hardware. Explore the Embassy Book and its getting-started guidance.

Decision point Classic Embedded Rust Book path Embassy path
What you learn first More direct exposure to target triples, startup/runtime setup, linker scripts, memory maps, OpenOCD, and GDB. Framework-oriented setup, board examples, and async support.
Board choice The cited hello walkthrough is specifically for STM32F3DISCOVERY and its STM32F303VCT6. The getting-started page names STM32 Nucleo, STM32 Discovery, and nRF kits; check its examples for support for the exact board and MCU you own.
First “hello” style A bare-metal debug-output example that emits text through the configured debug path. The Embassy Book calls blinky “the embedded world’s equivalent of ‘Hello World’,” reflecting the common LED-first approach.
Flashing/debug tools The cited walkthrough uses OpenOCD and GDB with the board’s ST-LINK interface. The getting-started guidance recommends probe-run or OpenOCD; follow the instructions for the selected board.

Choose the classic route if you want the mechanics of bare-metal startup and memory placement to be visible. Choose Embassy when you want to begin with its framework and board examples, especially if an async application is your next step. Either way, verify target and board support for the exact MCU rather than assuming all Cortex-M devices share one setup.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.