aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-boot/stm32/Cargo.toml1
-rw-r--r--embassy-boot/stm32/build.rs5
-rw-r--r--embassy-boot/stm32/src/lib.rs2
-rw-r--r--examples/boot/stm32l0/Cargo.toml2
-rw-r--r--examples/boot/stm32l0/README.md2
5 files changed, 8 insertions, 4 deletions
diff --git a/embassy-boot/stm32/Cargo.toml b/embassy-boot/stm32/Cargo.toml
index 78339b0a2..a31717ff3 100644
--- a/embassy-boot/stm32/Cargo.toml
+++ b/embassy-boot/stm32/Cargo.toml
@@ -27,7 +27,6 @@ defmt = [
27 "embassy-stm32/defmt", 27 "embassy-stm32/defmt",
28] 28]
29debug = ["defmt-rtt"] 29debug = ["defmt-rtt"]
30thumbv6 = []
31 30
32[profile.dev] 31[profile.dev]
33debug = 2 32debug = 2
diff --git a/embassy-boot/stm32/build.rs b/embassy-boot/stm32/build.rs
index fd605991f..3997702f6 100644
--- a/embassy-boot/stm32/build.rs
+++ b/embassy-boot/stm32/build.rs
@@ -24,4 +24,9 @@ fn main() {
24 if env::var("CARGO_FEATURE_DEFMT").is_ok() { 24 if env::var("CARGO_FEATURE_DEFMT").is_ok() {
25 println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); 25 println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
26 } 26 }
27
28 let target = env::var("TARGET").unwrap();
29 if target.starts_with("thumbv6m-") {
30 println!("cargo:rustc-cfg=armv6m");
31 }
27} 32}
diff --git a/embassy-boot/stm32/src/lib.rs b/embassy-boot/stm32/src/lib.rs
index 48512534b..8c6e65507 100644
--- a/embassy-boot/stm32/src/lib.rs
+++ b/embassy-boot/stm32/src/lib.rs
@@ -76,7 +76,7 @@ impl<const PAGE_SIZE: usize> BootLoader<PAGE_SIZE> {
76 trace!("Loading app at 0x{:x}", start); 76 trace!("Loading app at 0x{:x}", start);
77 #[allow(unused_mut)] 77 #[allow(unused_mut)]
78 let mut p = cortex_m::Peripherals::steal(); 78 let mut p = cortex_m::Peripherals::steal();
79 #[cfg(not(feature = "thumbv6"))] 79 #[cfg(not(armv6m))]
80 p.SCB.invalidate_icache(); 80 p.SCB.invalidate_icache();
81 p.SCB.vtor.write(start as u32); 81 p.SCB.vtor.write(start as u32);
82 82
diff --git a/examples/boot/stm32l0/Cargo.toml b/examples/boot/stm32l0/Cargo.toml
index 13ca84367..a9e031555 100644
--- a/examples/boot/stm32l0/Cargo.toml
+++ b/examples/boot/stm32l0/Cargo.toml
@@ -7,7 +7,7 @@ version = "0.1.0"
7[dependencies] 7[dependencies]
8embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly"] } 8embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly"] }
9embassy-stm32 = { version = "0.1.0", path = "../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } 9embassy-stm32 = { version = "0.1.0", path = "../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] }
10embassy-boot-stm32 = { version = "0.1.0", path = "../../../embassy-boot/stm32", features = ["thumbv6"] } 10embassy-boot-stm32 = { version = "0.1.0", path = "../../../embassy-boot/stm32" }
11embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" } 11embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" }
12 12
13defmt = { version = "0.3", optional = true } 13defmt = { version = "0.3", optional = true }
diff --git a/examples/boot/stm32l0/README.md b/examples/boot/stm32l0/README.md
index b498fdc2d..a0e8021fc 100644
--- a/examples/boot/stm32l0/README.md
+++ b/examples/boot/stm32l0/README.md
@@ -15,7 +15,7 @@ application.
15 15
16``` 16```
17# Flash bootloader 17# Flash bootloader
18cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32l072cz,thumbv6 --chip STM32L072CZTx 18cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32l072cz --chip STM32L072CZTx
19# Build 'b' 19# Build 'b'
20cargo build --release --bin b 20cargo build --release --bin b
21# Generate binary for 'b' 21# Generate binary for 'b'