mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
boot/stm32: autodetect thumbv6, remove cargo feature.
This commit is contained in:
parent
962fabe5c9
commit
d13d893ff2
@ -27,7 +27,6 @@ defmt = [
|
|||||||
"embassy-stm32/defmt",
|
"embassy-stm32/defmt",
|
||||||
]
|
]
|
||||||
debug = ["defmt-rtt"]
|
debug = ["defmt-rtt"]
|
||||||
thumbv6 = []
|
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
debug = 2
|
debug = 2
|
||||||
|
@ -24,4 +24,9 @@ fn main() {
|
|||||||
if env::var("CARGO_FEATURE_DEFMT").is_ok() {
|
if env::var("CARGO_FEATURE_DEFMT").is_ok() {
|
||||||
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let target = env::var("TARGET").unwrap();
|
||||||
|
if target.starts_with("thumbv6m-") {
|
||||||
|
println!("cargo:rustc-cfg=armv6m");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ impl<const PAGE_SIZE: usize> BootLoader<PAGE_SIZE> {
|
|||||||
trace!("Loading app at 0x{:x}", start);
|
trace!("Loading app at 0x{:x}", start);
|
||||||
#[allow(unused_mut)]
|
#[allow(unused_mut)]
|
||||||
let mut p = cortex_m::Peripherals::steal();
|
let mut p = cortex_m::Peripherals::steal();
|
||||||
#[cfg(not(feature = "thumbv6"))]
|
#[cfg(not(armv6m))]
|
||||||
p.SCB.invalidate_icache();
|
p.SCB.invalidate_icache();
|
||||||
p.SCB.vtor.write(start as u32);
|
p.SCB.vtor.write(start as u32);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ version = "0.1.0"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly"] }
|
embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly"] }
|
||||||
embassy-stm32 = { version = "0.1.0", path = "../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] }
|
embassy-stm32 = { version = "0.1.0", path = "../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] }
|
||||||
embassy-boot-stm32 = { version = "0.1.0", path = "../../../embassy-boot/stm32", features = ["thumbv6"] }
|
embassy-boot-stm32 = { version = "0.1.0", path = "../../../embassy-boot/stm32" }
|
||||||
embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" }
|
embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" }
|
||||||
|
|
||||||
defmt = { version = "0.3", optional = true }
|
defmt = { version = "0.3", optional = true }
|
||||||
|
@ -15,7 +15,7 @@ application.
|
|||||||
|
|
||||||
```
|
```
|
||||||
# Flash bootloader
|
# Flash bootloader
|
||||||
cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32l072cz,thumbv6 --chip STM32L072CZTx
|
cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32l072cz --chip STM32L072CZTx
|
||||||
# Build 'b'
|
# Build 'b'
|
||||||
cargo build --release --bin b
|
cargo build --release --bin b
|
||||||
# Generate binary for 'b'
|
# Generate binary for 'b'
|
||||||
|
Loading…
Reference in New Issue
Block a user