Overview
This workspace targets both processors on the Arduino UNO Q board:
| Crate | Processor | Core | Target | OS |
|---|---|---|---|---|
mpu |
Qualcomm QRB2210 | Arm Cortex-A53 (quad-core) | aarch64-unknown-linux-gnu |
Debian Linux |
mcu |
STMicro STM32U585 | Arm Cortex-M33 | thumbv8m.main-none-eabihf |
Bare-metal (no_std) |
Project Structure
unoq-starter/
├── Cargo.toml # Workspace root
├── Makefile # Build, deploy, and run targets
├── .cargo/config.toml # Cross-compilation & cargo aliases
├── mpu/ # QRB2210 MPU — Linux userspace binary
│ ├── Cargo.toml
│ └── src/main.rs
├── mcu/ # STM32U585 MCU — Embedded bare-metal binary
│ ├── Cargo.toml
│ ├── memory.x # Linker script (Flash + SRAM layout)
│ ├── build.rs # Linker search path setup
│ └── src/main.rs
Prerequisites
Rust Toolchain
Install Rust via rustup:
|
Add the compilation targets:
Cross-Compilation Toolchain (MPU)
To cross-compile the MPU crate from a non-aarch64 host, install the GNU cross-linker:
Debian/Ubuntu:
macOS (Homebrew):
&&
Alternatively, use cross for Docker-based cross-compilation with zero setup:
ADB + OpenOCD Tooling (MCU)
The STM32U585 SWD debug pins are not externally exposed on the Arduino UNO Q. Instead, the QRB2210 MPU acts as an internal SWD debug bridge running OpenOCD, accessed via ADB over USB.
Install ADB (Android Debug Bridge):
macOS (Homebrew):
Debian/Ubuntu:
Install ARM GDB for MCU debugging (optional):
macOS (Homebrew):
Verify the board is detected via ADB:
Binary Analysis Tools (Optional)
# Binary size analysis — find what's eating your flash
# LLVM tools — objdump, size, nm, readobj, strip
Building & Deploying
Makefile Targets (Recommended)
The project includes a Makefile for the full build-deploy-run workflow:
# --- MPU (QRB2210) ---
# --- MCU (STM32U585) — requires ADB + OpenOCD ---
# --- Utilities ---
Default device settings (override via environment or command line).
unoq1 is the hostname assigned to this specific board — yours will likely be different. Update the DEVICE variable in the Makefile or pass it on the command line:
| Variable | Default | Description |
|---|---|---|
DEVICE |
unoq1.local |
Board hostname or IP |
DEVICE_USER |
arduino |
SSH user on the board |
DEVICE_DIR |
/home/arduino/bin |
Install directory |
# Example: deploy to a different board
Cargo Aliases
For build-only operations without deployment:
Manual Build Commands
# MCU — STM32U585 (Cortex-M33, bare-metal)
# MPU — QRB2210 (Cortex-A53, Linux) — cross-compile
# MPU — build for host (for local testing)
Output Binaries
target/thumbv8m.main-none-eabihf/release/mcu # MCU release
target/aarch64-unknown-linux-gnu/release/mpu # MPU release
Debugging
MCU (STM32U585)
The MCU crate uses semihosting for debug output via the OpenOCD connection. Log output appears directly in the mcu-server terminal.
Flashing and debugging goes through the QRB2210's internal OpenOCD server, accessed via ADB over USB. This requires two terminals.
Terminal 1 — Start the OpenOCD debug server (runs until stopped):
Semihosting output (hprintln!) will appear in this terminal.
Terminal 2 — Set up port forwarding (once per USB connection):
Terminal 2 — Build and flash:
This will build the firmware, push it to the board via ADB, flash it through OpenOCD, enable semihosting, and reset the MCU. Watch Terminal 1 for log output.
GDB debug session:
This launches GDB connected to the OpenOCD server, loads the firmware, and resets the MCU.
MPU (QRB2210)
The MPU crate uses env_logger for runtime-configurable structured logging.
Build, deploy, and run on the board:
Run locally (host build):
RUST_LOG=info
Log level control (on the board or locally):
RUST_LOG=debug RUST_LOG=mpu=trace # Trace-level for the mpu crate only
RUST_LOG=warn # Warnings and errors only
Remote debugging on the board:
On the QRB2210 (via SSH):
On your development machine:
()
Binary Size Analysis
# Show memory usage by section (Flash/RAM)
# Find the largest functions and crates
# Disassemble the binary
MCU Memory Map
The STM32U585 linker script (mcu/memory.x) defines:
| Region | Origin | Size | Usage |
|---|---|---|---|
| FLASH | 0x08000000 |
2048 KB | Program code and constants |
| RAM | 0x20000000 |
192 KB | Stack, heap, static variables (SRAM1) |
Additional SRAM regions (SRAM2: 64 KB, SRAM3: 512 KB, SRAM4: 16 KB) can be added to memory.x as needed.
License
See LICENSE for details.