GithubHelp home page GithubHelp logo

blink's Introduction

blink

A small Hello World Rust application for the AVR.

The program itself toggles a LED on PORTB periodically.

Designed for the ATmega328p.

The AVR-Rust Book

Prerequisites

  • A recent version of the nightly Rust compiler. Anything including or greater than rustc 1.63.0-nightly (fee3a459d 2022-06-05) can be used.
  • The rust-src rustup component - $ rustup component add rust-src
  • AVR-GCC on the system for linking
  • AVR-Libc on the system for support libraries

Usage

Now to build, run:

rustup override set nightly

# Ensure time delays are consistent with a 16MHz microcontroller.
export AVR_CPU_FREQUENCY_HZ=16000000

# Compile the crate to an ELF executable.
cargo build -Z build-std=core --target avr-atmega328p.json --release

# Note: there is work in progress to make that easier
#       peeking in .cargo/config.tom  will show that
#            cargo build --release
#       is the short version

There should now be an ELF file at target/avr-atmega328p/release/blink.elf. It can be flashed directly to an AVR microcontroller or ran inside a simulator.

Resources

blink's People

Contributors

chinoto avatar dylanmckay avatar enjoythelive1 avatar fabientregan avatar johndoneth avatar jwillikers avatar mb64 avatar pusherofbrooms avatar rockboynton avatar shepmaster avatar stappersg avatar tspmp avatar vringar avatar wez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.