#raspberry #pi #state #pico

rp-pico

Board support package for the Raspberry Pi Pico

4 releases

0.1.3 Feb 3, 2021
0.1.2 Jan 24, 2021
0.1.1 Jan 23, 2021
0.1.0 Jan 22, 2021

27 downloads per month

BSD-3-Clause AND MIT OR BSD-3-Clause AND Apache-2.0

34KB
397 lines

Rust board support package for the Raspberry Pi Pico

This is a board support package for the Raspberry Pi Pico.

Current state / TODO

For now, a simple blinky example can be compiled, and runs!

Prerequisites

The Rasperry Pi Pico contains a microcontroller using the Arm architecture. To cross-compile for that architecture, the matching target needs to be installed:

rustup target add thumbv6m-none-eabi

Usage

An example blinking a LED can be compiled with:

cargo build --target thumbv6m-none-eabi --example=blink  --release

To flash the program, you must convert the ELF executable to a UF2 image.

Install uf2conv and cargo-binutils:

cargo install uf2conv cargo-binutils

Convert the ELF executable to a binary image:

cargo objcopy --example blink --release -- -O binary blink.bin

Convert the binary image to a UF2 format suitable for flashing:

uf2conv blink.bin --base 0x10000000 --family 0xe48bff56 --output blink.uf2

Flash the new firmware:

  • Plug in the RP2040 while holding down the BOOTSEL button to put in in flash mode.
    • It should appear as a USB storage drive on your computer.
  • Copy blink.uf2 to the drive - it should automatically restart and the LED will blink!

License

The stage2 boot loader code in src/bs2_default_padded_checksummed.S was compiled from the pico-sdk. It is Copyright 2020 (c) 2020 Raspberry Pi (Trading) Ltd. and is licensed under the BSD-3-Clause License.

The rest of this repository is licensed under the terms of both the MIT license and the Apache License (Version 2.0), at your option.

Dependencies

~6MB
~161K SLoC