-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1d3e02
commit 90da4e3
Showing
3 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,33 @@ | ||
# Running the program | ||
Before we explore further examples, let’s cover the general steps to build and run any program on the Raspberry Pi Pico 2. | ||
|
||
|
||
## Build and Run for ARM | ||
```sh | ||
# build the program | ||
cargo build --target=thumbv8m.main-none-eabihf | ||
``` | ||
|
||
To Flash your application onto the Pico 2, press and hold the BOOTSEL button. While holding it, connect the Pico 2 to your computer using a micro USB cable. You can release the button once the USB is plugged in. | ||
|
||
<img style="display: block; margin: auto;" alt="bootsel" src="./images/bootsel.png"/> | ||
|
||
```sh | ||
# Run the program | ||
cargo run --bin blinky --target=thumbv8m.main-none-eabihf | ||
cargo run --target=thumbv8m.main-none-eabihf | ||
``` | ||
**Note:** The example codes include a runner configuration in the `.cargo/config.toml` file, defined as: | ||
`runner = "picotool load -u -v -x -t elf"`. This means that when you execute `cargo run`, it actually invokes the `picotool` with the `load` subcommand to flash the program. | ||
|
||
|
||
## Build and Run for RISC-V | ||
```sh | ||
# build the program | ||
cargo build --target=riscv32imac-unknown-none-elf | ||
``` | ||
|
||
Follow the same BOOTSEL steps as described above. | ||
```sh | ||
# Run the program | ||
cargo run --bin blinky --target=riscv32imac-unknown-none-elf | ||
cargo run --target=riscv32imac-unknown-none-elf | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters