diff options
author | Ulf Lilleengen <ulf.lilleengen@gmail.com> | 2022-06-24 19:56:15 +0200 |
---|---|---|
committer | Ulf Lilleengen <ulf.lilleengen@gmail.com> | 2022-06-24 19:56:15 +0200 |
commit | 776be79f7bb10b09e795e2ea93bb795a653c9b4c (patch) | |
tree | 269046d330ee503c84049bb8fc47baf0297ecb80 | |
parent | 84628d36cf743193cbf0e7d47ef1cfa9fb590890 (diff) | |
download | embassy-776be79f7bb10b09e795e2ea93bb795a653c9b4c.zip |
Move bootloader main to examples
This should remove some confusion around embassy-boot-* being a library
vs. a binary. The binary is now an example bootloader instead.
-rwxr-xr-x | ci.sh | 18 | ||||
-rw-r--r-- | embassy-boot/nrf/Cargo.toml | 37 | ||||
-rw-r--r-- | embassy-boot/stm32/Cargo.toml | 4 | ||||
-rw-r--r-- | examples/boot/application/nrf/.cargo/config.toml (renamed from examples/boot/nrf/.cargo/config.toml) | 0 | ||||
-rw-r--r-- | examples/boot/application/nrf/Cargo.toml | 18 | ||||
-rw-r--r-- | examples/boot/application/nrf/README.md (renamed from examples/boot/nrf/README.md) | 4 | ||||
-rw-r--r-- | examples/boot/application/nrf/build.rs (renamed from examples/boot/nrf/build.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/nrf/memory-bl.x (renamed from examples/boot/nrf/memory-bl.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/nrf/memory.x (renamed from examples/boot/nrf/memory.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/nrf/src/bin/a.rs (renamed from examples/boot/nrf/src/bin/a.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/nrf/src/bin/b.rs (renamed from examples/boot/nrf/src/bin/b.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f3/.cargo/config.toml (renamed from examples/boot/stm32f3/.cargo/config.toml) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f3/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/application/stm32f3/README.md (renamed from examples/boot/stm32f3/README.md) | 2 | ||||
-rw-r--r-- | examples/boot/application/stm32f3/build.rs (renamed from embassy-boot/nrf/build.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f3/memory.x (renamed from examples/boot/stm32f3/memory.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f3/src/bin/a.rs (renamed from examples/boot/stm32f3/src/bin/a.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f3/src/bin/b.rs (renamed from examples/boot/stm32f3/src/bin/b.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f7/.cargo/config.toml (renamed from examples/boot/stm32f7/.cargo/config.toml) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f7/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/application/stm32f7/README.md (renamed from examples/boot/stm32f7/README.md) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f7/build.rs (renamed from examples/boot/stm32f3/build.rs) | 0 | ||||
-rwxr-xr-x | examples/boot/application/stm32f7/flash-boot.sh | 8 | ||||
-rw-r--r-- | examples/boot/application/stm32f7/memory-bl.x (renamed from examples/boot/stm32f7/memory-bl.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f7/memory.x (renamed from examples/boot/stm32f7/memory.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f7/src/bin/a.rs (renamed from examples/boot/stm32f7/src/bin/a.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32f7/src/bin/b.rs (renamed from examples/boot/stm32f7/src/bin/b.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32h7/.cargo/config.toml (renamed from examples/boot/stm32h7/.cargo/config.toml) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32h7/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/application/stm32h7/README.md (renamed from examples/boot/stm32h7/README.md) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32h7/build.rs (renamed from examples/boot/stm32f7/build.rs) | 0 | ||||
-rwxr-xr-x | examples/boot/application/stm32h7/flash-boot.sh | 8 | ||||
-rw-r--r-- | examples/boot/application/stm32h7/memory-bl.x (renamed from examples/boot/stm32h7/memory-bl.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32h7/memory.x (renamed from examples/boot/stm32h7/memory.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32h7/src/bin/a.rs (renamed from examples/boot/stm32h7/src/bin/a.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32h7/src/bin/b.rs (renamed from examples/boot/stm32h7/src/bin/b.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l0/.cargo/config.toml (renamed from examples/boot/stm32l0/.cargo/config.toml) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l0/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/application/stm32l0/README.md (renamed from examples/boot/stm32l0/README.md) | 2 | ||||
-rw-r--r-- | examples/boot/application/stm32l0/build.rs (renamed from examples/boot/stm32h7/build.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l0/memory.x (renamed from examples/boot/stm32l0/memory.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l0/src/bin/a.rs (renamed from examples/boot/stm32l0/src/bin/a.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l0/src/bin/b.rs (renamed from examples/boot/stm32l0/src/bin/b.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l1/.cargo/config.toml (renamed from examples/boot/stm32l1/.cargo/config.toml) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l1/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/application/stm32l1/README.md (renamed from examples/boot/stm32l1/README.md) | 2 | ||||
-rw-r--r-- | examples/boot/application/stm32l1/build.rs (renamed from examples/boot/stm32l0/build.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l1/memory.x (renamed from examples/boot/stm32l1/memory.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l1/src/bin/a.rs (renamed from examples/boot/stm32l1/src/bin/a.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l1/src/bin/b.rs (renamed from examples/boot/stm32l1/src/bin/b.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l4/.cargo/config.toml (renamed from examples/boot/stm32l4/.cargo/config.toml) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l4/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/application/stm32l4/README.md (renamed from examples/boot/stm32l4/README.md) | 2 | ||||
-rw-r--r-- | examples/boot/application/stm32l4/build.rs (renamed from examples/boot/stm32l1/build.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l4/memory.x (renamed from examples/boot/stm32l4/memory.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l4/src/bin/a.rs (renamed from examples/boot/stm32l4/src/bin/a.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32l4/src/bin/b.rs (renamed from examples/boot/stm32l4/src/bin/b.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32wl/.cargo/config.toml (renamed from examples/boot/stm32wl/.cargo/config.toml) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32wl/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/application/stm32wl/README.md (renamed from examples/boot/stm32wl/README.md) | 2 | ||||
-rw-r--r-- | examples/boot/application/stm32wl/build.rs (renamed from examples/boot/stm32l4/build.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32wl/memory.x (renamed from examples/boot/stm32wl/memory.x) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32wl/src/bin/a.rs (renamed from examples/boot/stm32wl/src/bin/a.rs) | 0 | ||||
-rw-r--r-- | examples/boot/application/stm32wl/src/bin/b.rs (renamed from examples/boot/stm32wl/src/bin/b.rs) | 0 | ||||
-rw-r--r-- | examples/boot/bootloader/nrf/.cargo/config.toml (renamed from embassy-boot/nrf/.cargo/config.toml) | 0 | ||||
-rw-r--r-- | examples/boot/bootloader/nrf/Cargo.toml | 58 | ||||
-rw-r--r-- | examples/boot/bootloader/nrf/README.md (renamed from embassy-boot/nrf/README.md) | 0 | ||||
-rw-r--r-- | examples/boot/bootloader/nrf/build.rs (renamed from examples/boot/stm32wl/build.rs) | 0 | ||||
-rw-r--r-- | examples/boot/bootloader/nrf/memory-bm.x (renamed from embassy-boot/nrf/memory-bm.x) | 0 | ||||
-rw-r--r-- | examples/boot/bootloader/nrf/memory-s140.x (renamed from embassy-boot/nrf/memory-s140.x) | 0 | ||||
-rw-r--r-- | examples/boot/bootloader/nrf/memory.x (renamed from embassy-boot/nrf/memory.x) | 0 | ||||
-rw-r--r-- | examples/boot/bootloader/nrf/src/main.rs (renamed from embassy-boot/nrf/src/main.rs) | 0 | ||||
-rw-r--r-- | examples/boot/bootloader/stm32/Cargo.toml | 57 | ||||
-rw-r--r-- | examples/boot/bootloader/stm32/README.md | 11 | ||||
-rw-r--r-- | examples/boot/bootloader/stm32/build.rs (renamed from embassy-boot/stm32/build.rs) | 0 | ||||
-rw-r--r-- | examples/boot/bootloader/stm32/memory.x (renamed from embassy-boot/stm32/memory.x) | 0 | ||||
-rw-r--r-- | examples/boot/bootloader/stm32/src/main.rs (renamed from embassy-boot/stm32/src/main.rs) | 0 | ||||
-rw-r--r-- | examples/boot/nrf/Cargo.toml | 18 | ||||
-rw-r--r-- | examples/boot/stm32f3/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/stm32f7/Cargo.toml | 25 | ||||
-rwxr-xr-x | examples/boot/stm32f7/flash-boot.sh | 8 | ||||
-rw-r--r-- | examples/boot/stm32h7/Cargo.toml | 25 | ||||
-rwxr-xr-x | examples/boot/stm32h7/flash-boot.sh | 8 | ||||
-rw-r--r-- | examples/boot/stm32l0/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/stm32l1/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/stm32l4/Cargo.toml | 25 | ||||
-rw-r--r-- | examples/boot/stm32wl/Cargo.toml | 25 |
87 files changed, 358 insertions, 259 deletions
@@ -85,14 +85,16 @@ cargo batch \ --- build --release --manifest-path examples/stm32u5/Cargo.toml --target thumbv8m.main-none-eabihf --out-dir out/examples/stm32u5 \ --- build --release --manifest-path examples/stm32wb/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wb \ --- build --release --manifest-path examples/stm32wl/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/stm32wl \ - --- build --release --manifest-path examples/boot/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/nrf --bin b \ - --- build --release --manifest-path examples/boot/stm32f3/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/stm32f3 --bin b \ - --- build --release --manifest-path examples/boot/stm32f7/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/stm32f7 --bin b \ - --- build --release --manifest-path examples/boot/stm32h7/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/stm32h7 --bin b \ - --- build --release --manifest-path examples/boot/stm32l0/Cargo.toml --target thumbv6m-none-eabi --out-dir out/examples/boot/stm32l0 --bin b \ - --- build --release --manifest-path examples/boot/stm32l1/Cargo.toml --target thumbv7m-none-eabi --out-dir out/examples/boot/stm32l1 --bin b \ - --- build --release --manifest-path examples/boot/stm32l4/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/stm32l4 --bin b \ - --- build --release --manifest-path examples/boot/stm32wl/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/boot/stm32wl --bin b \ + --- build --release --manifest-path examples/boot/application/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/nrf --bin b \ + --- build --release --manifest-path examples/boot/application/stm32f3/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/stm32f3 --bin b \ + --- build --release --manifest-path examples/boot/application/stm32f7/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/stm32f7 --bin b \ + --- build --release --manifest-path examples/boot/application/stm32h7/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/stm32h7 --bin b \ + --- build --release --manifest-path examples/boot/application/stm32l0/Cargo.toml --target thumbv6m-none-eabi --out-dir out/examples/boot/stm32l0 --bin b \ + --- build --release --manifest-path examples/boot/application/stm32l1/Cargo.toml --target thumbv7m-none-eabi --out-dir out/examples/boot/stm32l1 --bin b \ + --- build --release --manifest-path examples/boot/application/stm32l4/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/stm32l4 --bin b \ + --- build --release --manifest-path examples/boot/application/stm32wl/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/boot/stm32wl --bin b \ + --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \ + --- build --release --manifest-path examples/boot/bootloader/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wl55jc-cm4,embassy/time-tick-32768hz \ --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --out-dir out/examples/wasm \ --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103c8 --out-dir out/tests/bluepill-stm32f103c8 \ --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi --out-dir out/tests/nucleo-stm32f429zi \ diff --git a/embassy-boot/nrf/Cargo.toml b/embassy-boot/nrf/Cargo.toml index b5cc9c4f..ea579483 100644 --- a/embassy-boot/nrf/Cargo.toml +++ b/embassy-boot/nrf/Cargo.toml @@ -2,11 +2,12 @@ edition = "2021" name = "embassy-boot-nrf" version = "0.1.0" -description = "Bootloader for nRF chips" +description = "Bootloader lib for nRF chips" + +[lib] [dependencies] defmt = { version = "0.3", optional = true } -defmt-rtt = { version = "0.3", optional = true } embassy = { path = "../../embassy", default-features = false } embassy-nrf = { path = "../../embassy-nrf", default-features = false, features = ["nightly"] } @@ -28,35 +29,3 @@ defmt = [ softdevice = [ "nrf-softdevice-mbr", ] -debug = ["defmt-rtt"] - -[profile.dev] -debug = 2 -debug-assertions = true -incremental = false -opt-level = 'z' -overflow-checks = true - -[profile.release] -codegen-units = 1 -debug = 2 -debug-assertions = false -incremental = false -lto = 'fat' -opt-level = 'z' -overflow-checks = false - -# do not optimize proc-macro crates = faster builds from scratch -[profile.dev.build-override] -codegen-units = 8 -debug = false -debug-assertions = false -opt-level = 0 -overflow-checks = false - -[profile.release.build-override] -codegen-units = 8 -debug = false -debug-assertions = false -opt-level = 0 -overflow-checks = false diff --git a/embassy-boot/stm32/Cargo.toml b/embassy-boot/stm32/Cargo.toml index 3f198c11..1b6eeef9 100644 --- a/embassy-boot/stm32/Cargo.toml +++ b/embassy-boot/stm32/Cargo.toml @@ -2,7 +2,9 @@ edition = "2021" name = "embassy-boot-stm32" version = "0.1.0" -description = "Bootloader for STM32 chips" +description = "Bootloader lib for STM32 chips" + +[lib] [dependencies] defmt = { version = "0.3", optional = true } diff --git a/examples/boot/nrf/.cargo/config.toml b/examples/boot/application/nrf/.cargo/config.toml index 8ca28df3..8ca28df3 100644 --- a/examples/boot/nrf/.cargo/config.toml +++ b/examples/boot/application/nrf/.cargo/config.toml diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml new file mode 100644 index 00000000..0ae7163c --- /dev/null +++ b/examples/boot/application/nrf/Cargo.toml @@ -0,0 +1,18 @@ +[package] +edition = "2021" +name = "embassy-boot-nrf-examples" +version = "0.1.0" + +[dependencies] +embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly"] } +embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly", "nrf52840"] } +embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf" } +embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } + +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.3", optional = true } +panic-reset = { version = "0.1.1" } +embedded-hal = { version = "0.2.6" } + +cortex-m = "0.7.3" +cortex-m-rt = "0.7.0" diff --git a/examples/boot/nrf/README.md b/examples/boot/application/nrf/README.md index 1f25ffc0..703377a2 100644 --- a/examples/boot/nrf/README.md +++ b/examples/boot/application/nrf/README.md @@ -17,10 +17,10 @@ application. ``` # Use bare metal linker script -cp memory-bl.x ../../../embassy-boot/nrf/memory.x +cp memory-bl.x ../../bootloader/nrf/memory.x # Flash bootloader -cargo flash --manifest-path ../../../embassy-boot/nrf/Cargo.toml --features embassy-nrf/nrf52840 --release --chip nRF52840_xxAA +cargo flash --manifest-path ../../bootloader/nrf/Cargo.toml --features embassy-nrf/nrf52840 --release --chip nRF52840_xxAA # Build 'b' cargo build --release --bin b # Generate binary for 'b' diff --git a/examples/boot/nrf/build.rs b/examples/boot/application/nrf/build.rs index cd1a264c..cd1a264c 100644 --- a/examples/boot/nrf/build.rs +++ b/examples/boot/application/nrf/build.rs diff --git a/examples/boot/nrf/memory-bl.x b/examples/boot/application/nrf/memory-bl.x index 8a32b905..8a32b905 100644 --- a/examples/boot/nrf/memory-bl.x +++ b/examples/boot/application/nrf/memory-bl.x diff --git a/examples/boot/nrf/memory.x b/examples/boot/application/nrf/memory.x index 3a54ca46..3a54ca46 100644 --- a/examples/boot/nrf/memory.x +++ b/examples/boot/application/nrf/memory.x diff --git a/examples/boot/nrf/src/bin/a.rs b/examples/boot/application/nrf/src/bin/a.rs index 0b9715e4..0b9715e4 100644 --- a/examples/boot/nrf/src/bin/a.rs +++ b/examples/boot/application/nrf/src/bin/a.rs diff --git a/examples/boot/nrf/src/bin/b.rs b/examples/boot/application/nrf/src/bin/b.rs index a06c20f8..a06c20f8 100644 --- a/examples/boot/nrf/src/bin/b.rs +++ b/examples/boot/application/nrf/src/bin/b.rs diff --git a/examples/boot/stm32f3/.cargo/config.toml b/examples/boot/application/stm32f3/.cargo/config.toml index a76d6cab..a76d6cab 100644 --- a/examples/boot/stm32f3/.cargo/config.toml +++ b/examples/boot/application/stm32f3/.cargo/config.toml diff --git a/examples/boot/application/stm32f3/Cargo.toml b/examples/boot/application/stm32f3/Cargo.toml new file mode 100644 index 00000000..36fc135f --- /dev/null +++ b/examples/boot/application/stm32f3/Cargo.toml @@ -0,0 +1,25 @@ +[package] +edition = "2021" +name = "embassy-boot-stm32f3-examples" +version = "0.1.0" + +[dependencies] +embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } +embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] } +embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } +embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } + +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.3", optional = true } +panic-reset = { version = "0.1.1" } +embedded-hal = { version = "0.2.6" } + +cortex-m = "0.7.3" +cortex-m-rt = "0.7.0" + +[features] +defmt = [ + "dep:defmt", + "embassy-stm32/defmt", + "embassy-boot-stm32/defmt", +] diff --git a/examples/boot/stm32f3/README.md b/examples/boot/application/stm32f3/README.md index e92ffb69..46f033d5 100644 --- a/examples/boot/stm32f3/README.md +++ b/examples/boot/application/stm32f3/README.md @@ -15,7 +15,7 @@ application. ``` # Flash bootloader -cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32f303re --chip STM32F303RETx +cargo flash --manifest-path ../../bootloader/stm32/Cargo.toml --release --features embassy-stm32/stm32f303re --chip STM32F303RETx # Build 'b' cargo build --release --bin b # Generate binary for 'b' diff --git a/embassy-boot/nrf/build.rs b/examples/boot/application/stm32f3/build.rs index e1da6932..e1da6932 100644 --- a/embassy-boot/nrf/build.rs +++ b/examples/boot/application/stm32f3/build.rs diff --git a/examples/boot/stm32f3/memory.x b/examples/boot/application/stm32f3/memory.x index 14b2a2c9..14b2a2c9 100644 --- a/examples/boot/stm32f3/memory.x +++ b/examples/boot/application/stm32f3/memory.x diff --git a/examples/boot/stm32f3/src/bin/a.rs b/examples/boot/application/stm32f3/src/bin/a.rs index 4ff18d7c..4ff18d7c 100644 --- a/examples/boot/stm32f3/src/bin/a.rs +++ b/examples/boot/application/stm32f3/src/bin/a.rs diff --git a/examples/boot/stm32f3/src/bin/b.rs b/examples/boot/application/stm32f3/src/bin/b.rs index 4487e586..4487e586 100644 --- a/examples/boot/stm32f3/src/bin/b.rs +++ b/examples/boot/application/stm32f3/src/bin/b.rs diff --git a/examples/boot/stm32f7/.cargo/config.toml b/examples/boot/application/stm32f7/.cargo/config.toml index a90e1ccb..a90e1ccb 100644 --- a/examples/boot/stm32f7/.cargo/config.toml +++ b/examples/boot/application/stm32f7/.cargo/config.toml diff --git a/examples/boot/application/stm32f7/Cargo.toml b/examples/boot/application/stm32f7/Cargo.toml new file mode 100644 index 00000000..ad4a6fa7 --- /dev/null +++ b/examples/boot/application/stm32f7/Cargo.toml @@ -0,0 +1,25 @@ +[package] +edition = "2021" +name = "embassy-boot-stm32f7-examples" +version = "0.1.0" + +[dependencies] +embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } +embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] } +embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } +embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } + +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.3", optional = true } +panic-reset = { version = "0.1.1" } +embedded-hal = { version = "0.2.6" } + +cortex-m = "0.7.3" +cortex-m-rt = "0.7.0" + +[features] +defmt = [ + "dep:defmt", + "embassy-stm32/defmt", + "embassy-boot-stm32/defmt", +] diff --git a/examples/boot/stm32f7/README.md b/examples/boot/application/stm32f7/README.md index bf9142a1..bf9142a1 100644 --- a/examples/boot/stm32f7/README.md +++ b/examples/boot/application/stm32f7/README.md diff --git a/examples/boot/stm32f3/build.rs b/examples/boot/application/stm32f7/build.rs index e1da6932..e1da6932 100644 --- a/examples/boot/stm32f3/build.rs +++ b/examples/boot/application/stm32f7/build.rs diff --git a/examples/boot/application/stm32f7/flash-boot.sh b/examples/boot/application/stm32f7/flash-boot.sh new file mode 100755 index 00000000..debdb17a --- /dev/null +++ b/examples/boot/application/stm32f7/flash-boot.sh @@ -0,0 +1,8 @@ +#!/bin/bash +mv ../../bootloader/stm32/memory.x ../../bootloader/stm32/memory-old.x +cp memory-bl.x ../../bootloader/stm32/memory.x + +cargo flash --manifest-path ../../bootloader/stm32/Cargo.toml --release --features embassy-stm32/stm32f767zi --chip STM32F767ZITx --target thumbv7em-none-eabihf + +rm ../../bootloader/stm32/memory.x +mv ../../bootloader/stm32/memory-old.x ../../bootloader/stm32/memory.x diff --git a/examples/boot/stm32f7/memory-bl.x b/examples/boot/application/stm32f7/memory-bl.x index 47f3f4d9..47f3f4d9 100644 --- a/examples/boot/stm32f7/memory-bl.x +++ b/examples/boot/application/stm32f7/memory-bl.x diff --git a/examples/boot/stm32f7/memory.x b/examples/boot/application/stm32f7/memory.x index 1c5537d1..1c5537d1 100644 --- a/examples/boot/stm32f7/memory.x +++ b/examples/boot/application/stm32f7/memory.x diff --git a/examples/boot/stm32f7/src/bin/a.rs b/examples/boot/application/stm32f7/src/bin/a.rs index 9c7921a1..9c7921a1 100644 --- a/examples/boot/stm32f7/src/bin/a.rs +++ b/examples/boot/application/stm32f7/src/bin/a.rs diff --git a/examples/boot/stm32f7/src/bin/b.rs b/examples/boot/application/stm32f7/src/bin/b.rs index aa05bbcd..aa05bbcd 100644 --- a/examples/boot/stm32f7/src/bin/b.rs +++ b/examples/boot/application/stm32f7/src/bin/b.rs diff --git a/examples/boot/stm32h7/.cargo/config.toml b/examples/boot/application/stm32h7/.cargo/config.toml index fefdd370..fefdd370 100644 --- a/examples/boot/stm32h7/.cargo/config.toml +++ b/examples/boot/application/stm32h7/.cargo/config.toml diff --git a/examples/boot/application/stm32h7/Cargo.toml b/examples/boot/application/stm32h7/Cargo.toml new file mode 100644 index 00000000..54530cc5 --- /dev/null +++ b/examples/boot/application/stm32h7/Cargo.toml @@ -0,0 +1,25 @@ +[package] +edition = "2021" +name = "embassy-boot-stm32f7-examples" +version = "0.1.0" + +[dependencies] +embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } +embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] } +embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } +embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } + +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.3", optional = true } +panic-reset = { version = "0.1.1" } +embedded-hal = { version = "0.2.6" } + +cortex-m = "0.7.3" +cortex-m-rt = "0.7.0" + +[features] +defmt = [ + "dep:defmt", + "embassy-stm32/defmt", + "embassy-boot-stm32/defmt", +] diff --git a/examples/boot/stm32h7/README.md b/examples/boot/application/stm32h7/README.md index 1fdc305e..1fdc305e 100644 --- a/examples/boot/stm32h7/README.md +++ b/examples/boot/application/stm32h7/README.md diff --git a/examples/boot/stm32f7/build.rs b/examples/boot/application/stm32h7/build.rs index e1da6932..e1da6932 100644 --- a/examples/boot/stm32f7/build.rs +++ b/examples/boot/application/stm32h7/build.rs diff --git a/examples/boot/application/stm32h7/flash-boot.sh b/examples/boot/application/stm32h7/flash-boot.sh new file mode 100755 index 00000000..debdb17a --- /dev/null +++ b/examples/boot/application/stm32h7/flash-boot.sh @@ -0,0 +1,8 @@ +#!/bin/bash +mv ../../bootloader/stm32/memory.x ../../bootloader/stm32/memory-old.x +cp memory-bl.x ../../bootloader/stm32/memory.x + +cargo flash --manifest-path ../../bootloader/stm32/Cargo.toml --release --features embassy-stm32/stm32f767zi --chip STM32F767ZITx --target thumbv7em-none-eabihf + +rm ../../bootloader/stm32/memory.x +mv ../../bootloader/stm32/memory-old.x ../../bootloader/stm32/memory.x diff --git a/examples/boot/stm32h7/memory-bl.x b/examples/boot/application/stm32h7/memory-bl.x index c6f447d8..c6f447d8 100644 --- a/examples/boot/stm32h7/memory-bl.x +++ b/examples/boot/application/stm32h7/memory-bl.x diff --git a/examples/boot/stm32h7/memory.x b/examples/boot/application/stm32h7/memory.x index 497a09e4..497a09e4 100644 --- a/examples/boot/stm32h7/memory.x +++ b/examples/boot/application/stm32h7/memory.x diff --git a/examples/boot/stm32h7/src/bin/a.rs b/examples/boot/application/stm32h7/src/bin/a.rs index 704979db..704979db 100644 --- a/examples/boot/stm32h7/src/bin/a.rs +++ b/examples/boot/application/stm32h7/src/bin/a.rs diff --git a/examples/boot/stm32h7/src/bin/b.rs b/examples/boot/application/stm32h7/src/bin/b.rs index ea014025..ea014025 100644 --- a/examples/boot/stm32h7/src/bin/b.rs +++ b/examples/boot/application/stm32h7/src/bin/b.rs diff --git a/examples/boot/stm32l0/.cargo/config.toml b/examples/boot/application/stm32l0/.cargo/config.toml index 2627967a..2627967a 100644 --- a/examples/boot/stm32l0/.cargo/config.toml +++ b/examples/boot/application/stm32l0/.cargo/config.toml diff --git a/examples/boot/application/stm32l0/Cargo.toml b/examples/boot/application/stm32l0/Cargo.toml new file mode 100644 index 00000000..de7bea47 --- /dev/null +++ b/examples/boot/application/stm32l0/Cargo.toml @@ -0,0 +1,25 @@ +[package] +edition = "2021" +name = "embassy-boot-stm32l0-examples" +version = "0.1.0" + +[dependencies] +embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } +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" } +embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } + +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.3", optional = true } +panic-reset = { version = "0.1.1" } +embedded-hal = { version = "0.2.6" } + +cortex-m = "0.7.3" +cortex-m-rt = "0.7.0" + +[features] +defmt = [ + "dep:defmt", + "embassy-stm32/defmt", + "embassy-boot-stm32/defmt", +] diff --git a/examples/boot/stm32l0/README.md b/examples/boot/application/stm32l0/README.md index a0e8021f..762bdfe7 100644 --- a/examples/boot/stm32l0/README.md +++ b/examples/boot/application/stm32l0/README.md @@ -15,7 +15,7 @@ application. ``` # Flash bootloader -cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32l072cz --chip STM32L072CZTx +cargo flash --manifest-path ../../bootloader/stm32/Cargo.toml --release --features embassy-stm32/stm32l072cz --chip STM32L072CZTx # Build 'b' cargo build --release --bin b # Generate binary for 'b' diff --git a/examples/boot/stm32h7/build.rs b/examples/boot/application/stm32l0/build.rs index e1da6932..e1da6932 100644 --- a/examples/boot/stm32h7/build.rs +++ b/examples/boot/application/stm32l0/build.rs diff --git a/examples/boot/stm32l0/memory.x b/examples/boot/application/stm32l0/memory.x index d0d2bd7b..d0d2bd7b 100644 --- a/examples/boot/stm32l0/memory.x +++ b/examples/boot/application/stm32l0/memory.x diff --git a/examples/boot/stm32l0/src/bin/a.rs b/examples/boot/application/stm32l0/src/bin/a.rs index ce620347..ce620347 100644 --- a/examples/boot/stm32l0/src/bin/a.rs +++ b/examples/boot/application/stm32l0/src/bin/a.rs diff --git a/examples/boot/stm32l0/src/bin/b.rs b/examples/boot/application/stm32l0/src/bin/b.rs index 0b585a14..0b585a14 100644 --- a/examples/boot/stm32l0/src/bin/b.rs +++ b/examples/boot/application/stm32l0/src/bin/b.rs diff --git a/examples/boot/stm32l1/.cargo/config.toml b/examples/boot/application/stm32l1/.cargo/config.toml index 404b6b55..404b6b55 100644 --- a/examples/boot/stm32l1/.cargo/config.toml +++ b/examples/boot/application/stm32l1/.cargo/config.toml diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml new file mode 100644 index 00000000..3fd6f639 --- /dev/null +++ b/examples/boot/application/stm32l1/Cargo.toml @@ -0,0 +1,25 @@ +[package] +edition = "2021" +name = "embassy-boot-stm32l1-examples" +version = "0.1.0" + +[dependencies] +embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } +embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] } +embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } +embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } + +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.3", optional = true } +panic-reset = { version = "0.1.1" } +embedded-hal = { version = "0.2.6" } + +cortex-m = "0.7.3" +cortex-m-rt = "0.7.0" + +[features] +defmt = [ + "dep:defmt", + "embassy-stm32/defmt", + "embassy-boot-stm32/defmt", +] diff --git a/examples/boot/stm32l1/README.md b/examples/boot/application/stm32l1/README.md index 0d4accbf..428dde7b 100644 --- a/examples/boot/stm32l1/README.md +++ b/examples/boot/application/stm32l1/README.md @@ -15,7 +15,7 @@ application. ``` # Flash bootloader -cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32l151cb-a --chip STM32L151CBxxA +cargo flash --manifest-path ../../bootloader/stm32/Cargo.toml --release --features embassy-stm32/stm32l151cb-a --chip STM32L151CBxxA # Build 'b' cargo build --release --bin b # Generate binary for 'b' diff --git a/examples/boot/stm32l0/build.rs b/examples/boot/application/stm32l1/build.rs index e1da6932..e1da6932 100644 --- a/examples/boot/stm32l0/build.rs +++ b/examples/boot/application/stm32l1/build.rs diff --git a/examples/boot/stm32l1/memory.x b/examples/boot/application/stm32l1/memory.x index d0d2bd7b..d0d2bd7b 100644 --- a/examples/boot/stm32l1/memory.x +++ b/examples/boot/application/stm32l1/memory.x diff --git a/examples/boot/stm32l1/src/bin/a.rs b/examples/boot/application/stm32l1/src/bin/a.rs index ce620347..ce620347 100644 --- a/examples/boot/stm32l1/src/bin/a.rs +++ b/examples/boot/application/stm32l1/src/bin/a.rs diff --git a/examples/boot/stm32l1/src/bin/b.rs b/examples/boot/application/stm32l1/src/bin/b.rs index 0b585a14..0b585a14 100644 --- a/examples/boot/stm32l1/src/bin/b.rs +++ b/examples/boot/application/stm32l1/src/bin/b.rs diff --git a/examples/boot/stm32l4/.cargo/config.toml b/examples/boot/application/stm32l4/.cargo/config.toml index 43520e32..43520e32 100644 --- a/examples/boot/stm32l4/.cargo/config.toml +++ b/examples/boot/application/stm32l4/.cargo/config.toml diff --git a/examples/boot/application/stm32l4/Cargo.toml b/examples/boot/application/stm32l4/Cargo.toml new file mode 100644 index 00000000..7284af66 --- /dev/null +++ b/examples/boot/application/stm32l4/Cargo.toml @@ -0,0 +1,25 @@ +[package] +edition = "2021" +name = "embassy-boot-stm32l4-examples" +version = "0.1.0" + +[dependencies] +embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } +embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] } +embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } +embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } + +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.3", optional = true } +panic-reset = { version = "0.1.1" } +embedded-hal = { version = "0.2.6" } + +cortex-m = "0.7.3" +cortex-m-rt = "0.7.0" + +[features] +defmt = [ + "dep:defmt", + "embassy-stm32/defmt", + "embassy-boot-stm32/defmt", +] diff --git a/examples/boot/stm32l4/README.md b/examples/boot/application/stm32l4/README.md index 8966c2fb..83f50748 100644 --- a/examples/boot/stm32l4/README.md +++ b/examples/boot/application/stm32l4/README.md @@ -15,7 +15,7 @@ application. ``` # Flash bootloader -cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32l475vg --chip STM32L475VG +cargo flash --manifest-path ../../bootloader/stm32/Cargo.toml --release --features embassy-stm32/stm32l475vg --chip STM32L475VG # Build 'b' cargo build --release --bin b # Generate binary for 'b' diff --git a/examples/boot/stm32l1/build.rs b/examples/boot/application/stm32l4/build.rs index e1da6932..e1da6932 100644 --- a/examples/boot/stm32l1/build.rs +++ b/examples/boot/application/stm32l4/build.rs diff --git a/examples/boot/stm32l4/memory.x b/examples/boot/application/stm32l4/memory.x index 14b2a2c9..14b2a2c9 100644 --- a/examples/boot/stm32l4/memory.x +++ b/examples/boot/application/stm32l4/memory.x diff --git a/examples/boot/stm32l4/src/bin/a.rs b/examples/boot/application/stm32l4/src/bin/a.rs index bf609935..bf609935 100644 --- a/examples/boot/stm32l4/src/bin/a.rs +++ b/examples/boot/application/stm32l4/src/bin/a.rs diff --git a/examples/boot/stm32l4/src/bin/b.rs b/examples/boot/application/stm32l4/src/bin/b.rs index 4487e586..4487e586 100644 --- a/examples/boot/stm32l4/src/bin/b.rs +++ b/examples/boot/application/stm32l4/src/bin/b.rs diff --git a/examples/boot/stm32wl/.cargo/config.toml b/examples/boot/application/stm32wl/.cargo/config.toml index e395d75b..e395d75b 100644 --- a/examples/boot/stm32wl/.cargo/config.toml +++ b/examples/boot/application/stm32wl/.cargo/config.toml diff --git a/examples/boot/application/stm32wl/Cargo.toml b/examples/boot/application/stm32wl/Cargo.toml new file mode 100644 index 00000000..ca22e613 --- /dev/null +++ b/examples/boot/application/stm32wl/Cargo.toml @@ -0,0 +1,25 @@ +[package] +edition = "2021" +name = "embassy-boot-stm32wl-examples" +version = "0.1.0" + +[dependencies] +embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } +embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] } +embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } +embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } + +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.3", optional = true } +panic-reset = { version = "0.1.1" } +embedded-hal = { version = "0.2.6" } + +cortex-m = "0.7.3" +cortex-m-rt = "0.7.0" + +[features] +defmt = [ + "dep:defmt", + "embassy-stm32/defmt", + "embassy-boot-stm32/defmt", +] diff --git a/examples/boot/stm32wl/README.md b/examples/boot/application/stm32wl/README.md index edcdacf9..c8dce038 100644 --- a/examples/boot/stm32wl/README.md +++ b/examples/boot/application/stm32wl/README.md @@ -15,7 +15,7 @@ application. ``` # Flash bootloader -cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32wl55jc-cm4 --chip STM32WLE5JCIx +cargo flash --manifest-path ../../bootloader/stm32/Cargo.toml --release --features embassy-stm32/stm32wl55jc-cm4 --chip STM32WLE5JCIx # Build 'b' cargo build --release --bin b # Generate binary for 'b' diff --git a/examples/boot/stm32l4/build.rs b/examples/boot/application/stm32wl/build.rs index e1da6932..e1da6932 100644 --- a/examples/boot/stm32l4/build.rs +++ b/examples/boot/application/stm32wl/build.rs diff --git a/examples/boot/stm32wl/memory.x b/examples/boot/application/stm32wl/memory.x index 14b2a2c9..14b2a2c9 100644 --- a/examples/boot/stm32wl/memory.x +++ b/examples/boot/application/stm32wl/memory.x diff --git a/examples/boot/stm32wl/src/bin/a.rs b/examples/boot/application/stm32wl/src/bin/a.rs index dc1eb9be..dc1eb9be 100644 --- a/examples/boot/stm32wl/src/bin/a.rs +++ b/examples/boot/application/stm32wl/src/bin/a.rs diff --git a/examples/boot/stm32wl/src/bin/b.rs b/examples/boot/application/stm32wl/src/bin/b.rs index f2344bd5..f2344bd5 100644 --- a/examples/boot/stm32wl/src/bin/b.rs +++ b/examples/boot/application/stm32wl/src/bin/b.rs diff --git a/embassy-boot/nrf/.cargo/config.toml b/examples/boot/bootloader/nrf/.cargo/config.toml index 1060800a..1060800a 100644 --- a/embassy-boot/nrf/.cargo/config.toml +++ b/examples/boot/bootloader/nrf/.cargo/config.toml diff --git a/examples/boot/bootloader/nrf/Cargo.toml b/examples/boot/bootloader/nrf/Cargo.toml new file mode 100644 index 00000000..8eb98623 --- /dev/null +++ b/examples/boot/bootloader/nrf/Cargo.toml @@ -0,0 +1,58 @@ +[package] +edition = "2021" +name = "nrf-bootloader-example" +version = "0.1.0" +description = "Bootloader for nRF chips" + +[dependencies] +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.3", optional = true } + +embassy = { path = "../../../../embassy", default-features = false } +embassy-nrf = { path = "../../../../embassy-nrf", default-features = false, features = ["nightly"] } +embassy-boot-nrf = { path = "../../../../embassy-boot/nrf", default-features = false } +cortex-m = { version = "0.7" } +cortex-m-rt = { version = "0.7" } +cfg-if = "1.0.0" + +[features] +defmt = [ + "dep:defmt", + "embassy-boot-nrf/defmt", + "embassy-nrf/defmt", +] +softdevice = [ + "embassy-boot-nrf/softdevice", +] +debug = ["defmt-rtt"] + +[profile.dev] +debug = 2 +debug-assertions = true +incremental = false +opt-level = 'z' +overflow-checks = true + +[profile.release] +codegen-units = 1 +debug = 2 +debug-assertions = false +incremental = false +lto = 'fat' +opt-level = 'z' +overflow-checks = false + +# do not optimize proc-macro crates = faster builds from scratch +[profile.dev.build-override] +codegen-units = 8 +debug = false +debug-assertions = false +opt-level = 0 +overflow-checks = false + +[profile.release.build-override] +codegen-units = 8 +debug = false +debug-assertions = false +opt-level = 0 +overflow-checks = false diff --git a/embassy-boot/nrf/README.md b/examples/boot/bootloader/nrf/README.md index 23497a03..23497a03 100644 --- a/embassy-boot/nrf/README.md +++ b/examples/boot/bootloader/nrf/README.md diff --git a/examples/boot/stm32wl/build.rs b/examples/boot/bootloader/nrf/build.rs index e1da6932..e1da6932 100644 --- a/examples/boot/stm32wl/build.rs +++ b/examples/boot/bootloader/nrf/build.rs diff --git a/embassy-boot/nrf/memory-bm.x b/examples/boot/bootloader/nrf/memory-bm.x index 8a32b905..8a32b905 100644 --- a/embassy-boot/nrf/memory-bm.x +++ b/examples/boot/bootloader/nrf/memory-bm.x diff --git a/embassy-boot/nrf/memory-s140.x b/examples/boot/bootloader/nrf/memory-s140.x index 105db997..105db997 100644 --- a/embassy-boot/nrf/memory-s140.x +++ b/examples/boot/bootloader/nrf/memory-s140.x diff --git a/embassy-boot/nrf/memory.x b/examples/boot/bootloader/nrf/memory.x index 8a32b905..8a32b905 100644 --- a/embassy-boot/nrf/memory.x +++ b/examples/boot/bootloader/nrf/memory.x diff --git a/embassy-boot/nrf/src/main.rs b/examples/boot/bootloader/nrf/src/main.rs index bc7e0755..bc7e0755 100644 --- a/embassy-boot/nrf/src/main.rs +++ b/examples/boot/bootloader/nrf/src/main.rs diff --git a/examples/boot/bootloader/stm32/Cargo.toml b/examples/boot/bootloader/stm32/Cargo.toml new file mode 100644 index 00000000..b99a8fbc --- /dev/null +++ b/examples/boot/bootloader/stm32/Cargo.toml @@ -0,0 +1,57 @@ +[package] +edition = "2021" +name = "stm32-bootloader-example" +version = "0.1.0" +description = "Example bootloader for STM32 chips" + +[dependencies] +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.3", optional = true } + +embassy = { path = "../../../../embassy", default-features = false } +embassy-stm32 = { path = "../../../../embassy-stm32", default-features = false, features = ["nightly"] } +embassy-boot-stm32 = { path = "../../../../embassy-boot/stm32", default-features = false } +cortex-m = { version = "0.7" } +cortex-m-rt = { version = "0.7" } +embedded-storage = "0.3.0" +embedded-storage-async = "0.3.0" +cfg-if = "1.0.0" + +[features] +defmt = [ + "dep:defmt", + "embassy-boot-stm32/defmt", + "embassy-stm32/defmt", +] +debug = ["defmt-rtt"] + +[profile.dev] +debug = 2 +debug-assertions = true +incremental = false +opt-level = 'z' +overflow-checks = true + +[profile.release] +codegen-units = 1 +debug = 2 +debug-assertions = false +incremental = false +lto = 'fat' +opt-level = 'z' +overflow-checks = false + +# do not optimize proc-macro crates = faster builds from scratch +[profile.dev.build-override] +codegen-units = 8 +debug = false +debug-assertions = false +opt-level = 0 +overflow-checks = false + +[profile.release.build-override] +codegen-units = 8 +debug = false +debug-assertions = false +opt-level = 0 +overflow-checks = false diff --git a/examples/boot/bootloader/stm32/README.md b/examples/boot/bootloader/stm32/README.md new file mode 100644 index 00000000..a82b730b --- /dev/null +++ b/examples/boot/bootloader/stm32/README.md @@ -0,0 +1,11 @@ +# Bootloader for STM32 + +The bootloader uses `embassy-boot` to interact with the flash. + +# Usage + +Flash the bootloader + +``` +cargo flash --features embassy-stm32/stm32wl55jc-cm4 --release --chip STM32WLE5JCIx +``` diff --git a/embassy-boot/stm32/build.rs b/examples/boot/bootloader/stm32/build.rs index 3997702f..3997702f 100644 --- a/embassy-boot/stm32/build.rs +++ b/examples/boot/bootloader/stm32/build.rs diff --git a/embassy-boot/stm32/memory.x b/examples/boot/bootloader/stm32/memory.x index 110c2325..110c2325 100644 --- a/embassy-boot/stm32/memory.x +++ b/examples/boot/bootloader/stm32/memory.x diff --git a/embassy-boot/stm32/src/main.rs b/examples/boot/bootloader/stm32/src/main.rs index 45c511ce..45c511ce 100644 --- a/embassy-boot/stm32/src/main.rs +++ b/examples/boot/bootloader/stm32/src/main.rs diff --git a/examples/boot/nrf/Cargo.toml b/examples/boot/nrf/Cargo.toml deleted file mode 100644 index 0a0b76e6..00000000 --- a/examples/boot/nrf/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -edition = "2021" -name = "embassy-boot-nrf-examples" -version = "0.1.0" - -[dependencies] -embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly"] } -embassy-nrf = { version = "0.1.0", path = "../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly", "nrf52840"] } -embassy-boot-nrf = { version = "0.1.0", path = "../../../embassy-boot/nrf" } -embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" } - -defmt = { version = "0.3", optional = true } -defmt-rtt = { version = "0.3", optional = true } -panic-reset = { version = "0.1.1" } -embedded-hal = { version = "0.2.6" } - -cortex-m = "0.7.3" -cortex-m-rt = "0.7.0" diff --git a/examples/boot/stm32f3/Cargo.toml b/examples/boot/stm32f3/Cargo.toml deleted file mode 100644 index 01781369..00000000 --- a/examples/boot/stm32f3/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -edition = "2021" -name = "embassy-boot-stm32f3-examples" -version = "0.1.0" - -[dependencies] -embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly", "time-tick-32768hz"] } -embassy-stm32 = { version = "0.1.0", path = "../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] } -embassy-boot-stm32 = { version = "0.1.0", path = "../../../embassy-boot/stm32" } -embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" } - -defmt = { version = "0.3", optional = true } -defmt-rtt = { version = "0.3", optional = true } -panic-reset = { version = "0.1.1" } -embedded-hal = { version = "0.2.6" } - -cortex-m = "0.7.3" -cortex-m-rt = "0.7.0" - -[features] -defmt = [ - "dep:defmt", - "embassy-stm32/defmt", - "embassy-boot-stm32/defmt", -] diff --git a/examples/boot/stm32f7/Cargo.toml b/examples/boot/stm32f7/Cargo.toml deleted file mode 100644 index 07aa7389..00000000 --- a/examples/boot/stm32f7/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -edition = "2021" -name = "embassy-boot-stm32f7-examples" -version = "0.1.0" - -[dependencies] -embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly", "time-tick-32768hz"] } -embassy-stm32 = { version = "0.1.0", path = "../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] } -embassy-boot-stm32 = { version = "0.1.0", path = "../../../embassy-boot/stm32" } -embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" } - -defmt = { version = "0.3", optional = true } -defmt-rtt = { version = "0.3", optional = true } -panic-reset = { version = "0.1.1" } -embedded-hal = { version = "0.2.6" } - -cortex-m = "0.7.3" -cortex-m-rt = "0.7.0" - -[features] -defmt = [ - "dep:defmt", - "embassy-stm32/defmt", - "embassy-boot-stm32/defmt", -] diff --git a/examples/boot/stm32f7/flash-boot.sh b/examples/boot/stm32f7/flash-boot.sh deleted file mode 100755 index 86074ffa..00000000 --- a/examples/boot/stm32f7/flash-boot.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -mv ../../../embassy-boot/stm32/memory.x ../../../embassy-boot/stm32/memory-old.x -cp memory-bl.x ../../../embassy-boot/stm32/memory.x - -cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32f767zi --chip STM32F767ZITx --target thumbv7em-none-eabihf - -rm ../../../embassy-boot/stm32/memory.x -mv ../../../embassy-boot/stm32/memory-old.x ../../../embassy-boot/stm32/memory.x diff --git a/examples/boot/stm32h7/Cargo.toml b/examples/boot/stm32h7/Cargo.toml deleted file mode 100644 index d47cb65c..00000000 --- a/examples/boot/stm32h7/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -edition = "2021" -name = "embassy-boot-stm32f7-examples" -version = "0.1.0" - -[dependencies] -embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly", "time-tick-32768hz"] } -embassy-stm32 = { version = "0.1.0", path = "../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] } -embassy-boot-stm32 = { version = "0.1.0", path = "../../../embassy-boot/stm32" } -embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" } - -defmt = { version = "0.3", optional = true } -defmt-rtt = { version = "0.3", optional = true } -panic-reset = { version = "0.1.1" } -embedded-hal = { version = "0.2.6" } - -cortex-m = "0.7.3" -cortex-m-rt = "0.7.0" - -[features] -defmt = [ - "dep:defmt", - "embassy-stm32/defmt", - "embassy-boot-stm32/defmt", -] diff --git a/examples/boot/stm32h7/flash-boot.sh b/examples/boot/stm32h7/flash-boot.sh deleted file mode 100755 index a910b731..00000000 --- a/examples/boot/stm32h7/flash-boot.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -mv ../../../embassy-boot/stm32/memory.x ../../../embassy-boot/stm32/memory-old.x -cp memory-bl.x ../../../embassy-boot/stm32/memory.x - -cargo flash --manifest-path ../../../embassy-boot/stm32/Cargo.toml --release --features embassy-stm32/stm32f767zi --chip STM32H743ZITx --target thumbv7em-none-eabihf - -rm ../../../embassy-boot/stm32/memory.x -mv ../../../embassy-boot/stm32/memory-old.x ../../../embassy-boot/stm32/memory.x diff --git a/examples/boot/stm32l0/Cargo.toml b/examples/boot/stm32l0/Cargo.toml deleted file mode 100644 index fbc4fb71..00000000 --- a/examples/boot/stm32l0/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -edition = "2021" -name = "embassy-boot-stm32l0-examples" -version = "0.1.0" - -[dependencies] -embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly", "time-tick-32768hz"] } -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" } -embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" } - -defmt = { version = "0.3", optional = true } -defmt-rtt = { version = "0.3", optional = true } -panic-reset = { version = "0.1.1" } -embedded-hal = { version = "0.2.6" } - -cortex-m = "0.7.3" -cortex-m-rt = "0.7.0" - -[features] -defmt = [ - "dep:defmt", - "embassy-stm32/defmt", - "embassy-boot-stm32/defmt", -] diff --git a/examples/boot/stm32l1/Cargo.toml b/examples/boot/stm32l1/Cargo.toml deleted file mode 100644 index f3f05f61..00000000 --- a/examples/boot/stm32l1/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -edition = "2021" -name = "embassy-boot-stm32l1-examples" -version = "0.1.0" - -[dependencies] -embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly", "time-tick-32768hz"] } -embassy-stm32 = { version = "0.1.0", path = "../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] } -embassy-boot-stm32 = { version = "0.1.0", path = "../../../embassy-boot/stm32" } -embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" } - -defmt = { version = "0.3", optional = true } -defmt-rtt = { version = "0.3", optional = true } -panic-reset = { version = "0.1.1" } -embedded-hal = { version = "0.2.6" } - -cortex-m = "0.7.3" -cortex-m-rt = "0.7.0" - -[features] -defmt = [ - "dep:defmt", - "embassy-stm32/defmt", - "embassy-boot-stm32/defmt", -] diff --git a/examples/boot/stm32l4/Cargo.toml b/examples/boot/stm32l4/Cargo.toml deleted file mode 100644 index 1b7b2202..00000000 --- a/examples/boot/stm32l4/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -edition = "2021" -name = "embassy-boot-stm32l4-examples" -version = "0.1.0" - -[dependencies] -embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly", "time-tick-32768hz"] } -embassy-stm32 = { version = "0.1.0", path = "../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] } -embassy-boot-stm32 = { version = "0.1.0", path = "../../../embassy-boot/stm32" } -embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" } - -defmt = { version = "0.3", optional = true } -defmt-rtt = { version = "0.3", optional = true } -panic-reset = { version = "0.1.1" } -embedded-hal = { version = "0.2.6" } - -cortex-m = "0.7.3" -cortex-m-rt = "0.7.0" - -[features] -defmt = [ - "dep:defmt", - "embassy-stm32/defmt", - "embassy-boot-stm32/defmt", -] diff --git a/examples/boot/stm32wl/Cargo.toml b/examples/boot/stm32wl/Cargo.toml deleted file mode 100644 index 1bd69ae4..00000000 --- a/examples/boot/stm32wl/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -edition = "2021" -name = "embassy-boot-stm32wl-examples" -version = "0.1.0" - -[dependencies] -embassy = { version = "0.1.0", path = "../../../embassy", features = ["nightly", "time-tick-32768hz"] } -embassy-stm32 = { version = "0.1.0", path = "../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] } -embassy-boot-stm32 = { version = "0.1.0", path = "../../../embassy-boot/stm32" } -embassy-embedded-hal = { version = "0.1.0", path = "../../../embassy-embedded-hal" } - -defmt = { version = "0.3", optional = true } -defmt-rtt = { version = "0.3", optional = true } -panic-reset = { version = "0.1.1" } -embedded-hal = { version = "0.2.6" } - -cortex-m = "0.7.3" -cortex-m-rt = "0.7.0" - -[features] -defmt = [ - "dep:defmt", - "embassy-stm32/defmt", - "embassy-boot-stm32/defmt", -] |