VideoLibrary

Intro to Embedded Rust - Part 2: Blink and LED | DigiKey

We explore how to create a simple embedded Rust application for the Raspberry Pi Pico 2. We'll walk through building a blinking LED program from scratch, covering essential embedded systems concepts including bare-metal programming, hardware abstraction layers (HAL), and the no_std environment. This tutorial is perfect for developers who want to understand embedded Rust development beyond high-level frameworks like Arduino or MicroPython. The written guide for this episode can be found here: https://www.digikey.com/en/maker/tutorials/2026/intro-to-embedded-rust-part-2-blinking-an-led The GitHub repository containing the Docker image and example code for this series can be found here: https://github.com/ShawnHymel/introduction-to-embedded-rust In this tutorial, you'll learn how to set up an embedded Rust project using Cargo, configure cross-compilation for the ARM Cortex-M33 processor (thumbv8m architecture), and work with the rp235x-hal crate for RP2350 hardware control. We cover the essential project files including Cargo.toml for dependency management, .cargo/config.toml for build configuration, memory.x for defining the linker memory map, and main.rs where we write the actual embedded application. You'll understand how the cortex-m-rt crate handles startup code and memory layout, how the RP2350's Boot ROM initializes your program, and how Rust's type system provides compile-time safety for GPIO operations. This hands-on embedded systems programming tutorial demonstrates key Rust concepts in action, including ownership, type safety, and zero-cost abstractions applied to microcontroller development. We explain why embedded Rust uses #![no_std] and #![no_main] attributes, how to create custom panic handlers for bare-metal environments, and how to control hardware peripherals safely through Rust's ownership system. You'll see how the Pin struct uses generic type parameters to enforce correct GPIO usage at compile time, preventing common embedded programming errors before your code ever runs on the hardware. By the end of this tutorial, you'll have a working blinky LED program running on your Raspberry Pi Pico 2 and a solid foundation for more advanced embedded Rust projects. This example serves as a template for future projects where we'll add USB serial communication, interrupts, and more complex peripheral interactions. Whether you're coming from C/C++ embedded development or from higher-level Rust programming, this tutorial bridges the gap and shows you how to leverage Rust's powerful features in resource-constrained embedded systems.

1/26/2026 7:14:15 PM

Part List

画像メーカー品番商品概要入手可能な数量料金詳細を表示
RASPBERRY PI PICO 2 RP2350SC1631RASPBERRY PI PICO 2 RP235025969 - 即時$829.00詳細を表示
RASPBERRY PI PICO 2 W RP2350SC1633RASPBERRY PI PICO 2 W RP23505961 - 即時$1,161.00詳細を表示
RASPBERRY PI PICO 2 WH RP2350SC1634RASPBERRY PI PICO 2 WH RP23502210 - 即時$1,327.00詳細を表示
RASPBERRY PI PICO 2 H RP2350SC1632RASPBERRY PI PICO 2 H RP23502614 - 即時$995.00詳細を表示
LED RED CLEAR T-1 3/4 T/HLTL-4224LED RED CLEAR T-1 3/4 T/H72310 - 即時$23.00詳細を表示
TMP102 DIGITAL TEMP SENSOR BOARD13314TMP102 DIGITAL TEMP SENSOR BOARD248 - 即時$987.00詳細を表示
RES 220 OHM 5% 1/4W AXIALCF14JT220RRES 220 OHM 5% 1/4W AXIAL109234 - 即時
30000 - 工場在庫品
$17.00詳細を表示
SWITCH TACTILE SPST-NO 0.05A 24V1825910-6SWITCH TACTILE SPST-NO 0.05A 24V42567 - 即時$22.00詳細を表示
JUMPER WIRE M TO M 6" 28AWG1957JUMPER WIRE M TO M 6" 28AWG3608 - 即時$323.00詳細を表示
BREADBRD TERM STRIP 3.20X2.00"FIT0096BREADBRD TERM STRIP 3.20X2.00"3452 - 即時$481.00詳細を表示
USB AM TO USB MICRO, USB 2.0 - 1DH-20M50055USB AM TO USB MICRO, USB 2.0 - 110945 - 即時$257.00詳細を表示