This course is targeted at developers experienced in other procedural or object-oriented programming languages.
- Day 1: Rust foundations and the concept of ownership
- Day 2: Type system and error handling
- Day 3: Systems programming & concurrency
- Transfer day: other languages to Rust
Each day is a mix of theory and exercises. day 1 and 2 feature exercises in a std environment (building cli applications on desktop). day 3 and transfer day feature no_std and building embedded applications on an ESP32C3 microcontroller.
Contains the course slides/script as an mdbook and solutions to the exercises in the solutions directory. Will be updated before and during the course.
Please ensure the following software is installed on the device you bring to the course.
If there are any questions or difficulties during the installation please don't hesitate to contact the instructor (rolandbrand11@gmail.com).
Install Rust using rustup (Rust's official installer)
- Visit rust-lang.org and follow the installation instructions for your operating system.
- Verify installation with:
rustc --versionandcargo --version
Git for version control: git-scm.com
- Make sure you can access it through the command line:
git --version
Download from zed.dev
During the course the trainer will use Zed - participants are recommended to use the same editor, but are free to choose any other editor or IDE. The trainer will not be able to provide setup or configuration support for other editors or IDEs during the course.
Create a new Rust project and build it:
cargo new hello-rust
cd hello-rust
cargo buildExecute the project to verify your Rust installation:
cargo runYou should see "Hello, world!" printed to your terminal.
If you encounter any issues:
- On Unix-like systems, you might need to install build essentials:
sudo apt install build-essential(Ubuntu/Debian) - On Windows, you might need to install Visual Studio C++ Build Tools
- Try clearing the cargo cache:
cargo clean - Update rust:
rustup update
To remove the test project:
cd
rm -rf hello-rustIf you can complete all these steps successfully, your environment is ready for the first two days of the Rust course!
From day 3, we will be using ESP32-C3 boards. Please install the following tooling in advance:
This downloads the rust source code. Needed to build the std or core library, no pre-compiled provided:
rustup component add rust-srcThe toolchain for the ESP32-C3 (RISC-V architecture):
rustup target add riscv32imc-unknown-none-elfcargo-espflash is the recommended tool for flashing ESP32-C3 boards across all platforms.
Installation:
# Install cargo-espflash
cargo install cargo-espflashprobe-rs provides debugging capabilities and works best on Linux and macOS.
Installation (Optional):
# Install probe-rs (optional, primarily for debugging)
cargo install probe-rs --features cliTool for creating no_std projects targeting ESP32 chips:
cargo install esp-generate- Connect your ESP32-C3 board via USB cable
- Generate a test project:
esp-generate --chip esp32c3 test-esp32c3 cd test-esp32c3 - Build the project:
cargo build --release
- Flash to the board:
cargo run --release
If using Zed editor:
- Install probe-rs extension in Zed: https://zed.dev/extensions/probe-rs
- probe-rs integrates seamlessly with Zed for debugging ESP32-C3 projects
- Use PowerShell or Command Prompt
- Consider adding Windows Defender exclusions for Cargo directories
- Ensure you have the latest USB drivers
- Installation should work out of the box
- Use Terminal for all commands
- May need to add user to dialout group on Linux:
sudo usermod -a -G dialout $USER
Flashing Issues:
- If cargo-espflash fails to detect the board, ensure the ESP32-C3 is connected via USB and the correct port is being used
Port Detection Issues:
- On Windows: Check Device Manager for COM port assignments
- On Linux: Ensure user is in dialout group (see below)
- On macOS: Look for
/dev/cu.usbserial-*or/dev/cu.usbmodem*devices
ESP32-C3 Chip Revision:
- Most ESP32-C3 boards work with cargo-espflash regardless of revision
- Check revision during flashing: Look for "Chip is ESP32-C3 (revision 3)" message
Permission Issues (Linux):
- Add user to dialout group:
sudo usermod -a -G dialout $USER - Log out and back in for changes to take effect
For advanced debugging beyond cargo-espflash:
- probe-rs: Best on Linux/macOS for hardware debugging
- ESP-IDF monitor: Traditional ESP toolchain option
- Serial monitor: Use any serial terminal for basic output monitoring
→ Regularly pull updates to the repo. There will also be additional setup instructions for days 3 and 4.