Giter Club home page Giter Club logo

rs-arduino-uno-r4-wifi-rt's Introduction

arduino_uno_r4_wifi_rt

About

This is a toy project to build a Rust runtime for the Arduino Uno R4 Wifi "from scratch", using only the core library. It currently exposes the GPIO pins and the Systick timer feature.

I don't have plans to expand this to a comprehensive library, and it is not intended for production use. Nevertheless, if anything here seems useful, feel free to take it under the MIT license. No warranties though!

Building

Use rustup target add thumbv7em-none-eabi to install the compiler for the AMD Cortex M4 CPU. The .cargo/config file in this repository is set up to compile for this architecture by default, so you can just use cargo build.

Using

Since this isn't a serious library, I'm not putting it on crates.io. If you clone this repository, you can use the crate by adding the following to your Cargo.toml:

[dependencies]
arduino_uno_wifi_rt = { /path/to/arduino_uno_r4_wifi_rt }

Copy the .cargo/config from this crate to yours. This is to ensure that the linker script from this crate is used.

In your application, write

#[no_std]
#[no_main]

extern crate arduino_uno_wifi_rt;

use arduino_uno_wifi_rt::entry;

entry!(main);

fn main() -> ! {
    // Your code here.
    ...
}

Check the doc comments and examples for how to access the GPIO pins.

To get your code onto your Arduino, you first need to make a raw binary from the ELF file and then upload it using arduino-cli:

cargo objcopy -- -O binary test.bin
arduino-cli upload --input-file test.bin -p /dev/ttyACM0

Further reading

The following resources were very helpful with this project. If you're interested in embedded Rust for this platform or in general, I recommend checking them out.

General embedded Rust on Arm:

Documentation for the Armv7-M architecture:

Documentation for the Renesas RA4M1 microcontroller:

rs-arduino-uno-r4-wifi-rt's People

Contributors

mfil avatar

Watchers

 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.