Project directory, run cargo add rp-pico, cargo add cortex-m-rt, and cargo add panic-halt. To start a basic project from scratch, create a project using cargo new project-name. Then try repeating the cargo run command above. If you get an error about not being able to find elf2uf2-rs, try: $ cargo install elf2uf2-rs USB drive exported by the RP2040 bootloader, simply boot your board intoīootloader mode and run: rp-hal-boards/boards/rp-pico $ cargo run -release -example If you want to convert the ELF file to a UF2 and automatically copy it to the You would also need to specify -target=thumbv6m-none-eabi but whenīuilding examples from this git repository, that is set as the default. target/thumbv6m-none-eabi/release/examples/, where the targetįolder is located at the top of the rp-hal-boards repository checkout. To compile an example, clone the rp-hal-boards repository and run: rp-hal-boards/boards/rp-pico $ cargo build -release -example See the examples folder for more details. This will set up all the GPIOs for any on-boardĭevices. In your program, you will need to call rp_pico :: Pins ::new to createĪ new Pins structure. toml file should contain: rp-pico = "0.7.0" RP2040 chip according to how it is connected up on the Pico. This crate includes the rp2040-hal, but also configures each pin of the You should include this crate if you are writing code that you want to run onĪ Raspberry Pi Pico - the original launch PCB for the RP2040 chip.
0 Comments
Leave a Reply. |