diff options
| author | Peter Krull <[email protected]> | 2024-09-23 19:02:59 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-09-23 19:02:59 +0200 |
| commit | a2c473306f4a7c8e99add2546450ab3a7a97436e (patch) | |
| tree | 5522a708e492db7d4632dc0a56fe5057244f03f0 /examples/boot/bootloader | |
| parent | e02a987bafd4f0fcf9d80e7c4f6e1504b8b02cec (diff) | |
| parent | 2935290a6222536d6341103f91bfd732165d3862 (diff) | |
Merge branch 'embassy-rs:main' into multi-signal
Diffstat (limited to 'examples/boot/bootloader')
| -rw-r--r-- | examples/boot/bootloader/nrf/Cargo.toml | 4 | ||||
| -rw-r--r-- | examples/boot/bootloader/rp/Cargo.toml | 6 | ||||
| -rw-r--r-- | examples/boot/bootloader/rp/memory.x | 2 | ||||
| -rw-r--r-- | examples/boot/bootloader/stm32-dual-bank/Cargo.toml | 5 | ||||
| -rw-r--r-- | examples/boot/bootloader/stm32-dual-bank/README.md | 8 | ||||
| -rw-r--r-- | examples/boot/bootloader/stm32/Cargo.toml | 4 | ||||
| -rw-r--r-- | examples/boot/bootloader/stm32/memory.x | 2 | ||||
| -rw-r--r-- | examples/boot/bootloader/stm32wb-dfu/Cargo.toml | 6 | ||||
| -rw-r--r-- | examples/boot/bootloader/stm32wb-dfu/src/main.rs | 2 |
9 files changed, 18 insertions, 21 deletions
diff --git a/examples/boot/bootloader/nrf/Cargo.toml b/examples/boot/bootloader/nrf/Cargo.toml index 3e41d1479..9d5d51a13 100644 --- a/examples/boot/bootloader/nrf/Cargo.toml +++ b/examples/boot/bootloader/nrf/Cargo.toml | |||
| @@ -12,20 +12,20 @@ defmt-rtt = { version = "0.4", optional = true } | |||
| 12 | embassy-nrf = { path = "../../../../embassy-nrf", features = [] } | 12 | embassy-nrf = { path = "../../../../embassy-nrf", features = [] } |
| 13 | embassy-boot-nrf = { path = "../../../../embassy-boot-nrf" } | 13 | embassy-boot-nrf = { path = "../../../../embassy-boot-nrf" } |
| 14 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 14 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 15 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 15 | embassy-sync = { version = "0.6.0", path = "../../../../embassy-sync" } |
| 16 | cortex-m-rt = { version = "0.7" } | 16 | cortex-m-rt = { version = "0.7" } |
| 17 | cfg-if = "1.0.0" | 17 | cfg-if = "1.0.0" |
| 18 | 18 | ||
| 19 | [features] | 19 | [features] |
| 20 | defmt = [ | 20 | defmt = [ |
| 21 | "dep:defmt", | 21 | "dep:defmt", |
| 22 | "dep:defmt-rtt", | ||
| 22 | "embassy-boot-nrf/defmt", | 23 | "embassy-boot-nrf/defmt", |
| 23 | "embassy-nrf/defmt", | 24 | "embassy-nrf/defmt", |
| 24 | ] | 25 | ] |
| 25 | softdevice = [ | 26 | softdevice = [ |
| 26 | "embassy-boot-nrf/softdevice", | 27 | "embassy-boot-nrf/softdevice", |
| 27 | ] | 28 | ] |
| 28 | debug = ["defmt-rtt", "defmt"] | ||
| 29 | 29 | ||
| 30 | [profile.dev] | 30 | [profile.dev] |
| 31 | debug = 2 | 31 | debug = 2 |
diff --git a/examples/boot/bootloader/rp/Cargo.toml b/examples/boot/bootloader/rp/Cargo.toml index 3cf61a002..9df396e5e 100644 --- a/examples/boot/bootloader/rp/Cargo.toml +++ b/examples/boot/bootloader/rp/Cargo.toml | |||
| @@ -9,9 +9,9 @@ license = "MIT OR Apache-2.0" | |||
| 9 | defmt = { version = "0.3", optional = true } | 9 | defmt = { version = "0.3", optional = true } |
| 10 | defmt-rtt = { version = "0.4", optional = true } | 10 | defmt-rtt = { version = "0.4", optional = true } |
| 11 | 11 | ||
| 12 | embassy-rp = { path = "../../../../embassy-rp", features = [] } | 12 | embassy-rp = { path = "../../../../embassy-rp", features = ["rp2040"] } |
| 13 | embassy-boot-rp = { path = "../../../../embassy-boot-rp" } | 13 | embassy-boot-rp = { path = "../../../../embassy-boot-rp" } |
| 14 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 14 | embassy-sync = { version = "0.6.0", path = "../../../../embassy-sync" } |
| 15 | embassy-time = { path = "../../../../embassy-time", features = [] } | 15 | embassy-time = { path = "../../../../embassy-time", features = [] } |
| 16 | 16 | ||
| 17 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 17 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| @@ -23,10 +23,10 @@ cfg-if = "1.0.0" | |||
| 23 | [features] | 23 | [features] |
| 24 | defmt = [ | 24 | defmt = [ |
| 25 | "dep:defmt", | 25 | "dep:defmt", |
| 26 | "dep:defmt-rtt", | ||
| 26 | "embassy-boot-rp/defmt", | 27 | "embassy-boot-rp/defmt", |
| 27 | "embassy-rp/defmt", | 28 | "embassy-rp/defmt", |
| 28 | ] | 29 | ] |
| 29 | debug = ["defmt-rtt", "defmt"] | ||
| 30 | 30 | ||
| 31 | [profile.release] | 31 | [profile.release] |
| 32 | debug = true | 32 | debug = true |
diff --git a/examples/boot/bootloader/rp/memory.x b/examples/boot/bootloader/rp/memory.x index c3b54976e..88b5bbb15 100644 --- a/examples/boot/bootloader/rp/memory.x +++ b/examples/boot/bootloader/rp/memory.x | |||
| @@ -2,7 +2,7 @@ MEMORY | |||
| 2 | { | 2 | { |
| 3 | /* NOTE 1 K = 1 KiBi = 1024 bytes */ | 3 | /* NOTE 1 K = 1 KiBi = 1024 bytes */ |
| 4 | BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100 | 4 | BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100 |
| 5 | FLASH : ORIGIN = 0x10000100, LENGTH = 24K | 5 | FLASH : ORIGIN = 0x10000100, LENGTH = 24K - 0x100 |
| 6 | BOOTLOADER_STATE : ORIGIN = 0x10006000, LENGTH = 4K | 6 | BOOTLOADER_STATE : ORIGIN = 0x10006000, LENGTH = 4K |
| 7 | ACTIVE : ORIGIN = 0x10007000, LENGTH = 512K | 7 | ACTIVE : ORIGIN = 0x10007000, LENGTH = 512K |
| 8 | DFU : ORIGIN = 0x10087000, LENGTH = 516K | 8 | DFU : ORIGIN = 0x10087000, LENGTH = 516K |
diff --git a/examples/boot/bootloader/stm32-dual-bank/Cargo.toml b/examples/boot/bootloader/stm32-dual-bank/Cargo.toml index 313187adc..b91b05412 100644 --- a/examples/boot/bootloader/stm32-dual-bank/Cargo.toml +++ b/examples/boot/bootloader/stm32-dual-bank/Cargo.toml | |||
| @@ -15,15 +15,14 @@ cortex-m = { version = "0.7.6", features = [ | |||
| 15 | "inline-asm", | 15 | "inline-asm", |
| 16 | "critical-section-single-core", | 16 | "critical-section-single-core", |
| 17 | ] } | 17 | ] } |
| 18 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 18 | embassy-sync = { version = "0.6.0", path = "../../../../embassy-sync" } |
| 19 | cortex-m-rt = { version = "0.7" } | 19 | cortex-m-rt = { version = "0.7" } |
| 20 | embedded-storage = "0.3.1" | 20 | embedded-storage = "0.3.1" |
| 21 | embedded-storage-async = "0.4.0" | 21 | embedded-storage-async = "0.4.0" |
| 22 | cfg-if = "1.0.0" | 22 | cfg-if = "1.0.0" |
| 23 | 23 | ||
| 24 | [features] | 24 | [features] |
| 25 | defmt = ["dep:defmt", "embassy-boot-stm32/defmt", "embassy-stm32/defmt"] | 25 | defmt = ["dep:defmt", "dep:defmt-rtt", "embassy-boot-stm32/defmt", "embassy-stm32/defmt"] |
| 26 | debug = ["defmt-rtt", "defmt"] | ||
| 27 | 26 | ||
| 28 | [profile.dev] | 27 | [profile.dev] |
| 29 | debug = 2 | 28 | debug = 2 |
diff --git a/examples/boot/bootloader/stm32-dual-bank/README.md b/examples/boot/bootloader/stm32-dual-bank/README.md index 3de3171cd..cd6c0bc84 100644 --- a/examples/boot/bootloader/stm32-dual-bank/README.md +++ b/examples/boot/bootloader/stm32-dual-bank/README.md | |||
| @@ -2,16 +2,16 @@ | |||
| 2 | 2 | ||
| 3 | ## Overview | 3 | ## Overview |
| 4 | 4 | ||
| 5 | This bootloader leverages `embassy-boot` to interact with the flash. | 5 | This bootloader leverages `embassy-boot` to interact with the flash. |
| 6 | This example targets STM32 devices with dual-bank flash memory, with a primary focus on the STM32H747XI series. | 6 | This example targets STM32 devices with dual-bank flash memory, with a primary focus on the STM32H747XI series. |
| 7 | Users must modify the `memory.x` configuration file to match with the memory layout of their specific STM32 device. | 7 | Users must modify the `memory.x` configuration file to match with the memory layout of their specific STM32 device. |
| 8 | 8 | ||
| 9 | Additionally, this example can be extended to utilize external flash memory, such as QSPI, for storing partitions. | 9 | Additionally, this example can be extended to utilize external flash memory, such as QSPI, for storing partitions. |
| 10 | 10 | ||
| 11 | ## Memory Configuration | 11 | ## Memory Configuration |
| 12 | 12 | ||
| 13 | In this example's `memory.x` file, various symbols are defined to assist in effective memory management within the bootloader environment. | 13 | In this example's `memory.x` file, various symbols are defined to assist in effective memory management within the bootloader environment. |
| 14 | For dual-bank STM32 devices, it's crucial to assign these symbols correctly to their respective memory banks. | 14 | For dual-bank STM32 devices, it's crucial to assign these symbols correctly to their respective memory banks. |
| 15 | 15 | ||
| 16 | ### Symbol Definitions | 16 | ### Symbol Definitions |
| 17 | 17 | ||
diff --git a/examples/boot/bootloader/stm32/Cargo.toml b/examples/boot/bootloader/stm32/Cargo.toml index 74c01b0f4..541186949 100644 --- a/examples/boot/bootloader/stm32/Cargo.toml +++ b/examples/boot/bootloader/stm32/Cargo.toml | |||
| @@ -12,7 +12,7 @@ defmt-rtt = { version = "0.4", optional = true } | |||
| 12 | embassy-stm32 = { path = "../../../../embassy-stm32", features = [] } | 12 | embassy-stm32 = { path = "../../../../embassy-stm32", features = [] } |
| 13 | embassy-boot-stm32 = { path = "../../../../embassy-boot-stm32" } | 13 | embassy-boot-stm32 = { path = "../../../../embassy-boot-stm32" } |
| 14 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 14 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 15 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 15 | embassy-sync = { version = "0.6.0", path = "../../../../embassy-sync" } |
| 16 | cortex-m-rt = { version = "0.7" } | 16 | cortex-m-rt = { version = "0.7" } |
| 17 | embedded-storage = "0.3.1" | 17 | embedded-storage = "0.3.1" |
| 18 | embedded-storage-async = "0.4.0" | 18 | embedded-storage-async = "0.4.0" |
| @@ -21,10 +21,10 @@ cfg-if = "1.0.0" | |||
| 21 | [features] | 21 | [features] |
| 22 | defmt = [ | 22 | defmt = [ |
| 23 | "dep:defmt", | 23 | "dep:defmt", |
| 24 | "dep:defmt-rtt", | ||
| 24 | "embassy-boot-stm32/defmt", | 25 | "embassy-boot-stm32/defmt", |
| 25 | "embassy-stm32/defmt", | 26 | "embassy-stm32/defmt", |
| 26 | ] | 27 | ] |
| 27 | debug = ["defmt-rtt", "defmt"] | ||
| 28 | 28 | ||
| 29 | [profile.dev] | 29 | [profile.dev] |
| 30 | debug = 2 | 30 | debug = 2 |
diff --git a/examples/boot/bootloader/stm32/memory.x b/examples/boot/bootloader/stm32/memory.x index b6f185ef7..198290520 100644 --- a/examples/boot/bootloader/stm32/memory.x +++ b/examples/boot/bootloader/stm32/memory.x | |||
| @@ -2,7 +2,7 @@ MEMORY | |||
| 2 | { | 2 | { |
| 3 | /* NOTE 1 K = 1 KiBi = 1024 bytes */ | 3 | /* NOTE 1 K = 1 KiBi = 1024 bytes */ |
| 4 | FLASH : ORIGIN = 0x08000000, LENGTH = 24K | 4 | FLASH : ORIGIN = 0x08000000, LENGTH = 24K |
| 5 | BOOTLOADER_STATE : ORIGIN = 0x08006000, LENGTH = 4K | 5 | BOOTLOADER_STATE : ORIGIN = 0x08006000, LENGTH = 8K |
| 6 | ACTIVE : ORIGIN = 0x08008000, LENGTH = 32K | 6 | ACTIVE : ORIGIN = 0x08008000, LENGTH = 32K |
| 7 | DFU : ORIGIN = 0x08010000, LENGTH = 36K | 7 | DFU : ORIGIN = 0x08010000, LENGTH = 36K |
| 8 | RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 16K | 8 | RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 16K |
diff --git a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml index 854f94d85..050b672ce 100644 --- a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml +++ b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml | |||
| @@ -12,24 +12,24 @@ defmt-rtt = { version = "0.4", optional = true } | |||
| 12 | embassy-stm32 = { path = "../../../../embassy-stm32", features = [] } | 12 | embassy-stm32 = { path = "../../../../embassy-stm32", features = [] } |
| 13 | embassy-boot-stm32 = { path = "../../../../embassy-boot-stm32" } | 13 | embassy-boot-stm32 = { path = "../../../../embassy-boot-stm32" } |
| 14 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 14 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 15 | embassy-sync = { version = "0.5.0", path = "../../../../embassy-sync" } | 15 | embassy-sync = { version = "0.6.0", path = "../../../../embassy-sync" } |
| 16 | cortex-m-rt = { version = "0.7" } | 16 | cortex-m-rt = { version = "0.7" } |
| 17 | embedded-storage = "0.3.1" | 17 | embedded-storage = "0.3.1" |
| 18 | embedded-storage-async = "0.4.0" | 18 | embedded-storage-async = "0.4.0" |
| 19 | cfg-if = "1.0.0" | 19 | cfg-if = "1.0.0" |
| 20 | embassy-usb-dfu = { version = "0.1.0", path = "../../../../embassy-usb-dfu", features = ["dfu", "cortex-m"] } | 20 | embassy-usb-dfu = { version = "0.1.0", path = "../../../../embassy-usb-dfu", features = ["dfu", "cortex-m"] } |
| 21 | embassy-usb = { version = "0.1.0", path = "../../../../embassy-usb", default-features = false } | 21 | embassy-usb = { version = "0.3.0", path = "../../../../embassy-usb", default-features = false } |
| 22 | embassy-futures = { version = "0.1.1", path = "../../../../embassy-futures" } | 22 | embassy-futures = { version = "0.1.1", path = "../../../../embassy-futures" } |
| 23 | 23 | ||
| 24 | [features] | 24 | [features] |
| 25 | defmt = [ | 25 | defmt = [ |
| 26 | "dep:defmt", | 26 | "dep:defmt", |
| 27 | "dep:defmt-rtt", | ||
| 27 | "embassy-boot-stm32/defmt", | 28 | "embassy-boot-stm32/defmt", |
| 28 | "embassy-stm32/defmt", | 29 | "embassy-stm32/defmt", |
| 29 | "embassy-usb/defmt", | 30 | "embassy-usb/defmt", |
| 30 | "embassy-usb-dfu/defmt" | 31 | "embassy-usb-dfu/defmt" |
| 31 | ] | 32 | ] |
| 32 | debug = ["defmt-rtt", "defmt"] | ||
| 33 | 33 | ||
| 34 | [profile.dev] | 34 | [profile.dev] |
| 35 | debug = 2 | 35 | debug = 2 |
diff --git a/examples/boot/bootloader/stm32wb-dfu/src/main.rs b/examples/boot/bootloader/stm32wb-dfu/src/main.rs index d989fbfdf..093b39f9d 100644 --- a/examples/boot/bootloader/stm32wb-dfu/src/main.rs +++ b/examples/boot/bootloader/stm32wb-dfu/src/main.rs | |||
| @@ -49,7 +49,6 @@ fn main() -> ! { | |||
| 49 | let mut buffer = AlignedBuffer([0; WRITE_SIZE]); | 49 | let mut buffer = AlignedBuffer([0; WRITE_SIZE]); |
| 50 | let updater = BlockingFirmwareUpdater::new(fw_config, &mut buffer.0[..]); | 50 | let updater = BlockingFirmwareUpdater::new(fw_config, &mut buffer.0[..]); |
| 51 | 51 | ||
| 52 | let mut device_descriptor = [0; 256]; | ||
| 53 | let mut config_descriptor = [0; 256]; | 52 | let mut config_descriptor = [0; 256]; |
| 54 | let mut bos_descriptor = [0; 256]; | 53 | let mut bos_descriptor = [0; 256]; |
| 55 | let mut control_buf = [0; 4096]; | 54 | let mut control_buf = [0; 4096]; |
| @@ -57,7 +56,6 @@ fn main() -> ! { | |||
| 57 | let mut builder = Builder::new( | 56 | let mut builder = Builder::new( |
| 58 | driver, | 57 | driver, |
| 59 | config, | 58 | config, |
| 60 | &mut device_descriptor, | ||
| 61 | &mut config_descriptor, | 59 | &mut config_descriptor, |
| 62 | &mut bos_descriptor, | 60 | &mut bos_descriptor, |
| 63 | &mut [], | 61 | &mut [], |
