Code Monkey home page Code Monkey logo

mcu-rust's Introduction

Programming microcontrollers with Rust

Plan

  • Set up a Rust environment for embedded development.
  • Run Blinky on RaspberryPi Pico.
  • Control a SPI device from the Pico.

Goals

  • Evaluate how the Rust ecosystem compares against traditional embedded development tools.
  • Evaluate Just against tradtional Make.
  • Evaluate DevEnv as depencency management.

One-time setup

  1. Make sure that you have libudev-dev, eg. sudo apt install libudev-dev.
  2. Install DevEnv so that you have a Nix package management infrastructure. See notes.

Daily use

Run devenv shell to switch into the development environment where all the needed tools and dependencies are installed, sort of like with Python virtual environments.

Run just to see the available project-specific commands.

Run exit to exit the development environment.

Notes

Have not found out how to actually make devenv control to the rust eco system, so not using the devenv setup for rust. Had to do this instead:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo apt install libudev-dev
cargo install elf2uf2-rs flip-link --locked

On NixOS, do nix-shell -p pkg-config udev instead of installing libudev, and then run cargo install flip-link & elf2uf2-rs --locked.

Finally do

rustup target add thumbv6m-none-eabi

For Just:

wget -qO - 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
echo "deb [arch=all,$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list
sudo apt update
sudo apt install just

Reading list

mcu-rust's People

Contributors

jpsecher avatar

Watchers

 avatar  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.