Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for pro micro rp2040 #78

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Choose a default "cargo run" tool (see README for more info)
# - `probe-rs` provides flashing and defmt via a hardware debugger, and stack unwind on panic
# - elf2uf2-rs loads firmware over USB when the rp2040 is in boot mode
runner = "probe-rs run --chip RP2040 --protocol swd"
# runner = "elf2uf2-rs -d"
# runner = "probe-rs run --chip RP2040 --protocol swd"
runner = "elf2uf2-rs -d"

rustflags = [
"-C", "linker=flip-link",
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@ debug-assertions = false
incremental = false
lto = 'fat'
opt-level = 3

[features]
default = ["pro_micro_rp2040"]
rp2040 = []
pro_micro_rp2040 = []
35 changes: 4 additions & 31 deletions Embed.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,12 @@
[default.probe]
protocol = "Swd"
speed = 20000
# If you only have one probe cargo embed will pick automatically
# Otherwise: add your probe's VID/PID/serial to filter

## rust-dap
# usb_vid = "6666"
# usb_pid = "4444"
# serial = "test"


[default.flashing]
enabled = true
[default.general]
chip = "RP2040"

[default.reset]
enabled = true
halt_afterwards = false

[default.general]
chip = "RP2040"
log_level = "WARN"
# RP2040 does not support connect_under_reset
connect_under_reset = false

[default.rtt]
enabled = true
up_mode = "NoBlockSkip"
channels = [
{ up = 0, down = 0, name = "name", up_mode = "NoBlockSkip", format = "Defmt" },
]
timeout = 3000
show_timestamps = true
log_enabled = false
log_path = "./logs"
# channels = [{ up = 0, down = 0, name = "debug", format = "Defmt" }]

[default.gdb]
enabled = false
gdb_connection_string = "127.0.0.1:2345"
enabled = true
Binary file added rp2040-project-template.uf2
Binary file not shown.
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ fn main() -> ! {
// If you have a Pico W and want to toggle a LED with a simple GPIO output pin, you can connect an external
// LED to one of the GPIO pins, and reference that pin here. Don't forget adding an appropriate resistor
// in series with the LED.
#[cfg(feature = "rp2040")]
let mut led_pin = pins.led.into_push_pull_output();
// In this case gpio17 is the led pin(for Pro Micro RP2040 16MB)
#[cfg(feature = "pro_micro_rp2040")]
let mut led_pin = pins.gpio17.into_push_pull_output();

loop {
info!("on!");
Expand Down
Loading