Compilation of Rust for AVR Microcontrollers (narrowed down.)

⚓ Rust    📅 2025-10-15    👤 surdeus    👁️ 1      

surdeus

I checked this post Avr-hal on Arduino-Uno about running rust code on an AVR microcontroller. HAL just means Hardware Abstraction Layer and simplifies our process.

Steps are simple, I have it running, but I do not understand a few parts.

  1. Are we compiling from Rust to Assembly code for the AVR with standard rustc (just nigthly)? Using cargo run --verbose this seemsthe case.
  2. Why do we need the package avr-gcc exactly ?

3rd Party Requirements are here:

A number of third party tools are required to use AVR Rust.

  • avr-gcc (only used as a linker frontend)
  • avr-binutils (for linker support)
  • avr-libc (for device-specific runtime libraries)
  • avrdude (for flashing a real AVR chip)

These should be installed by the operating system package manager.

  1. So this linker is somehow needed to link what shared objects to what other shared objects. Just each crate's shared object file to its dependencies —maybe to the avr-libc? Why not just ldd ?

3 posts - 1 participant

Read full topic

🏷️ Rust_feed