World's first, but possibly worst, blinky for the pico in Rust

Overview

pico-blink-rs

Running Rust code on the Raspberry Pi Pico

Booting

The RP2040 has external QSPI flash. There is an internal mask-ROM bootloader which can read the first 256 bytes of external flash and copy it to the top of SRAM (0x2004_1f00). This 256 byte block is the 'second stage bootloader'. Its job is to reconfigure the XIP_SSI interface to the right values for the attached QSPI flash chip (the mask ROM has some very conservative defaults which should work with all chips), and configure the XIP so that the QSPI flash appears at address 0x1000_0000 upwards.

The second stage bootloader then loads the user application once the XIP_SSI configuration is complete. It does this by reading a vector table at 0x1000_0100, which is 256 bytes into the QSPI flash contents (or immediately after the 256 byte second stage bootloader), and jumping to the reset vector.

We should also write a BSP for the pico, and a HAL for the RP2040. Basically, don't do any of what I did here. But hey, it blinks!

Licence

This work is licenced under CC0. Binaries may include material Copyright Raspberry Pi Trading - see other crates for details.

You might also like...
Middleware/ios shortcut to setup alarms automatically based on the first class

Webuntis alarm This is a small little "middleware" / web server intended to connect to a webuntis timetable used in german schools which i wrote when

Bolik Timeline is local-first software for keeping notes and files.

Bolik monorepo Bolik Timeline is local-first software for keeping notes and files. This repo contains alpha-quality software. This means that we are e

Local-first high performance codebase index engine designed for AI

CodeIndex CodeIndex is a local-first high performance codebase index engine designed for AI. It helps your LLM understand the structure and semantics

epNFTs, the first partial program-owned NFT Standard powered by Instruction Introspection and Transfer Hooks!

epNFT Standard: A Comprehensive Guide Introduction to epNFTs Welcome to the epNFT-standard repository, where we explore the first program-owned NFT st

Local-first task manager/bug tracker that stores everything right in the git repository and can sync issues from/to GitHub.
Local-first task manager/bug tracker that stores everything right in the git repository and can sync issues from/to GitHub.

git-task Local-first task manager/bug tracker within your git repository which can import issues from GitHub. Installation Build a binary, then add it

du + rust = dust. Like du but more intuitive.
du + rust = dust. Like du but more intuitive.

Dust du + rust = dust. Like du but more intuitive. Why Because I want an easy way to see where my disk is being used. Demo Install Cargo cargo install

Rmatrix is similar to the cmatrix, but it wrote it in Rust.
Rmatrix is similar to the cmatrix, but it wrote it in Rust.

Rmatrix is similar to the cmatrix, but it wrote it in Rust. Get up to 75% performance improvement compared to cmatrix.

A cli based pastebin in Rust, but very insecure

pasta A cli based pastebin in Rust, but very insecure Use nightly toolchain to build rustup override set nightly When this program is running, you can

A trash-cli copy, but this time in Rust.

trash-rs A trash-cli copy, but this time in Rust. TODO Deletion Relative paths * functionality List files Include in Metadata: Original directory Date

Comments
  • no field `gpio25`

    no field `gpio25`

    Issuing cargo build

    results in the output:

      Compiling pico-blink-rs v0.2.0 (/home/pi/pico-blink-rs)
    error[E0609]: no field `gpio25` on type `PADS_BANK0`
       --> src/main.rs:126:18
        |
    126 |     p.PADS_BANK0.gpio25.write(|w| {
        |                  ^^^^^^ unknown field
    
    error[E0609]: no field `gpio25_ctrl` on type `IO_BANK0`
       --> src/main.rs:133:16
        |
    133 |     p.IO_BANK0.gpio25_ctrl.write(|w| {
        |                ^^^^^^^^^^^ unknown field
    
    error: aborting due to 2 previous errors
    
    For more information about this error, try `rustc --explain E0609`.
    error: could not compile `pico-blink-rs`
    
    To learn more, run the command again with --verbose.
    
    
    opened by blippy 2
  • RAM size is 264k

    RAM size is 264k

    Maybe there is some context I am missing here and you have other plans for the 2x 4kiB banks, but the total memory is 264 kiB. Raising this because I saw someone link to the memory.x here :)

    opened by Wren6991 1
  • Fix gpio to use array

    Fix gpio to use array

    https://github.com/rp-rs/rp2040-pac/pull/12 https://github.com/rp-rs/rp2040-pac/commit/56198b7d7f795c1bf3b7c5040f3724bf6683186f

    Changes made to this dependency means PADS_BANK0 and IO_BANK0 reference gpio as arrays.

    opened by sirris-bat 0
Owner
rp-rs
Rust on the RP series of microcontrollers. https://matrix.to/#/#rp-rs:matrix.org
rp-rs
AI-powered game engine for dynamic, personalized experiences in evolving worlds. Ethical, accessible, inclusive.

ARCADIA: Advanced and Responsive Computational Architecture for Dynamic Interactive Ai: A Whitepaper By Reuven Cohen (rUv) Introduction Imagine a futu

rUv 10 Apr 18, 2023
A Raspberry Pi Pico-based sequencer for Eurorack

A Raspberry Pi Pico-based sequencer for Eurorack.

Pedro Ferreira 5 Oct 20, 2022
a crate to swap values between possibly-overlapping references

omniswap: a crate to swap values between possibly-overlapping references Motivating Example You cannot simply use std::mem::swap to replace values wit

Masaki Hara 21 Nov 30, 2022
Periodically download a youtube playlist, extract audio, convert to mp3, move to directory (possibly synced using syncthing).

auto-dl Periodically download a youtube playlist, extract audio, convert to mp3, move to directory (possibly synced using syncthing). drop https://git

Paul Adenot 10 Jan 12, 2023
Baby's first Rust CLI project. Basic implementation of grep. Written in about 100 SLOC.

minigrep Coding project from Chapter 12 of the The Rust Programming Language book. Usage Compile and run as so minigrep QUERY FILENAME QUERY being the

Anis 2 Oct 2, 2021
I'm currently learning Rust and these are my first programs with this language

learning-Rust I follow the Rust by example official doc for learning That is also available in 'doc pdf' alongside another great rust learning sheet I

null 3 Dec 30, 2022
First project in rust which will be to make an accounts system & Leaderboard/Score system

rust-backend this is my first project in rust which will be to make a backend for compsci project it will include: Accounts, Player Achievements (if I

NaughtyDog6000 2 Jul 13, 2023
The first web framework in Rust to adopt the Model-View-Controller (MVC) architecture

Integra Web Framework Integra is a sleek, performant web framework for Rust, harnessing the power of the hyper library. Will become the first highly p

null 3 Sep 11, 2023
First class, scalable rust project generator with batteries included.

amble First class, scalable rust project generator with batteries included. Amble is in beta ??. Install | User Docs | Crate Docs | Reference | Contri

refcell.eth 13 Oct 23, 2023
try to find the correct word with only first letter and unknown letter count.

MOTUS Current dictionaries are provided in french and can contain some words not included in the official Motus dictionary. Additionally, dictionaries

Alexandre 6 Apr 11, 2022