pineapplehunter / arduino_simple_io

A blinking LED program written in Rust for the AVR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

blink

An small Hello World Rust application for the AVR.

The program itself toggles a LED on PORTB periodically.

Designed for the ATmega328p.

How to set up a cross compiler

Usage

There are a few environment variables that need to be set first:

# Needed until https://github.com/japaric/xargo/pull/205 goes through,
# to tell it where to find avr-atmega328p.json:
export RUST_TARGET_PATH=`pwd`

# Likely needed if you've just compiled avr-rust from source:
export XARGO_RUST_SRC=/path_to_avr_rust/src
# (e.g. :if you built from sources and typed `git clone https://github.com/avr-rust/rust.git` in `~/avr-rust`, this would be `~/avr-rust/rust/src)

Now to build, run:

rustup run avr-toolchain xargo build --target avr-atmega328p --release

There should now be an ELF file at target/atmega328p/release/blink.elf.

About

A blinking LED program written in Rust for the AVR

License:MIT License


Languages

Language:Rust 100.0%