This template is intended as a starting point for developing your own firmware based on the rp2040-hal.
It includes all of the knurling-rs
tooling as showcased in https://github.com/knurling-rs/app-template (defmt
, defmt-rtt
, panic-probe
, flip-link
) to make development as easy as possible.
probe-run
is configured as the default runner, so you can start your program as easy as
DEFMT_LOG=trace cargo run --release
-
The standard Rust tooling (cargo, rustup) which you can install from https://rustup.rs/
-
Toolchain support for the cortex-m0+ processors in the rp2040 (thumbv6m-none-eabi)
-
flip-link - this allows you to detect stack-overflows on the first core, which is the only supported target for now.
-
probe-run. Upstream support for RP2040 was added with version 0.3.1.
-
A CMSIS-DAP probe. (JLink probes sort of work but are very unstable. Other probes won't work at all)
You can use a second Pico as a CMSIS-DAP debug probe by installing the following firmware on it: https://github.com/majbthrd/DapperMime/releases/download/20210225/raspberry_pi_pico-DapperMime.uf2
More details on supported debug probes can be found in debug_probes.md
rustup target install thumbv6m-none-eabi
cargo install flip-link
# This is our suggested default 'runner'
cargo install probe-run
# If you want to use elf2uf2-rs instead of probe-run, instead do...
cargo install elf2uf2-rs
For a debug build
DEFMT_LOG=trace cargo run
For a release build
DEFMT_LOG=trace cargo run --release
To load firmware directly into RP2040, for example you don't have a probe, comment and uncomment following lines in .cargo/config.toml
:
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# runner = "probe-run --chip RP2040"
runner = "elf2uf2-rs -d"
NOTE These packages are under active development. As such, it is likely to remain volatile until a 1.0.0 release.
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
The steps are:
- Fork the Project by clicking the 'Fork' button at the top of the page.
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Make some changes to the code or documentation.
- Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Feature Branch (
git push origin feature/AmazingFeature
) - Create a New Pull Request
- An admin will review the Pull Request and discuss any changes that may be required.
- Once everyone is happy, the Pull Request can be merged by an admin, and your work is part of our project!
Contribution to this crate is organized under the terms of the Rust Code of Conduct, and the maintainer of this crate, the rp-rs team, promises to intervene to uphold that code of conduct.
The contents of this repository are dual-licensed under the MIT OR Apache
2.0 License. That means you can chose either the MIT licence or the
Apache-2.0 licence when you re-use this code. See MIT
or APACHE2.0
for more
information on each specific licence.
Any submissions to this project (e.g. as Pull Requests) must be made available under these terms.
Raise an issue: https://github.com/rp-rs/rp2040-project-template/issues Chat to us on Matrix: #rp-rs:matrix.org