aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-rp/Cargo.toml10
-rw-r--r--embassy-rp/src/boot2.binbin256 -> 0 bytes
-rw-r--r--embassy-rp/src/lib.rs29
3 files changed, 36 insertions, 3 deletions
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml
index b2b7fb083..836dca28e 100644
--- a/embassy-rp/Cargo.toml
+++ b/embassy-rp/Cargo.toml
@@ -30,6 +30,15 @@ rom-func-cache = []
30intrinsics = [] 30intrinsics = []
31rom-v2-intrinsics = [] 31rom-v2-intrinsics = []
32 32
33# boot2 flash chip support. if none of these is enabled we'll default to w25q080 (used on the pico)
34boot2-at25sf128a = []
35boot2-gd25q64cs = []
36boot2-generic-03h = []
37boot2-is25lp080 = []
38boot2-ram-memcpy = []
39boot2-w25q080 = []
40boot2-w25x10cl = []
41
33# Enable nightly-only features 42# Enable nightly-only features
34nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly", "dep:embassy-usb-driver", "dep:embedded-io"] 43nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly", "dep:embassy-usb-driver", "dep:embedded-io"]
35 44
@@ -71,3 +80,4 @@ embedded-hal-nb = { version = "=1.0.0-alpha.2", optional = true}
71paste = "1.0" 80paste = "1.0"
72pio-proc = {version= "0.2" } 81pio-proc = {version= "0.2" }
73pio = {version= "0.2.1" } 82pio = {version= "0.2.1" }
83rp2040-boot2 = "0.3"
diff --git a/embassy-rp/src/boot2.bin b/embassy-rp/src/boot2.bin
deleted file mode 100644
index fdc1fc756..000000000
--- a/embassy-rp/src/boot2.bin
+++ /dev/null
Binary files differ
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs
index cba7559df..99f62738d 100644
--- a/embassy-rp/src/lib.rs
+++ b/embassy-rp/src/lib.rs
@@ -131,9 +131,32 @@ embassy_hal_common::peripherals! {
131 WATCHDOG, 131 WATCHDOG,
132} 132}
133 133
134#[link_section = ".boot2"] 134macro_rules! select_bootloader {
135#[used] 135 ( $( $feature:literal => $loader:ident, )+ default => $default:ident ) => {
136static BOOT2: [u8; 256] = *include_bytes!("boot2.bin"); 136 $(
137 #[cfg(feature = $feature)]
138 #[link_section = ".boot2"]
139 #[used]
140 static BOOT2: [u8; 256] = rp2040_boot2::$loader;
141 )*
142
143 #[cfg(not(any( $( feature = $feature),* )))]
144 #[link_section = ".boot2"]
145 #[used]
146 static BOOT2: [u8; 256] = rp2040_boot2::$default;
147 }
148}
149
150select_bootloader! {
151 "boot2-at25sf128a" => BOOT_LOADER_AT25SF128A,
152 "boot2-gd25q64cs" => BOOT_LOADER_GD25Q64CS,
153 "boot2-generic-03h" => BOOT_LOADER_GENERIC_03H,
154 "boot2-is25lp080" => BOOT_LOADER_IS25LP080,
155 "boot2-ram-memcpy" => BOOT_LOADER_RAM_MEMCPY,
156 "boot2-w25q080" => BOOT_LOADER_W25Q080,
157 "boot2-w25x10cl" => BOOT_LOADER_W25X10CL,
158 default => BOOT_LOADER_W25Q080
159}
137 160
138pub mod config { 161pub mod config {
139 #[non_exhaustive] 162 #[non_exhaustive]