aboutsummaryrefslogtreecommitdiff
path: root/embassy-boot/src/firmware_updater/blocking.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-boot/src/firmware_updater/blocking.rs')
-rw-r--r--embassy-boot/src/firmware_updater/blocking.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/embassy-boot/src/firmware_updater/blocking.rs b/embassy-boot/src/firmware_updater/blocking.rs
index f1368540d..3814b6c31 100644
--- a/embassy-boot/src/firmware_updater/blocking.rs
+++ b/embassy-boot/src/firmware_updater/blocking.rs
@@ -16,12 +16,16 @@ pub struct BlockingFirmwareUpdater<'d, DFU: NorFlash, STATE: NorFlash> {
16} 16}
17 17
18#[cfg(target_os = "none")] 18#[cfg(target_os = "none")]
19impl<'a, FLASH: NorFlash> 19impl<'a, DFUFlash: NorFlash, StateFlash: NorFlash>
20 FirmwareUpdaterConfig<BlockingPartition<'a, NoopRawMutex, FLASH>, BlockingPartition<'a, NoopRawMutex, FLASH>> 20 FirmwareUpdaterConfig<
21 BlockingPartition<'a, NoopRawMutex, DFUFlash>,
22 BlockingPartition<'a, NoopRawMutex, StateFlash>,
23 >
21{ 24{
22 /// Create a firmware updater config from the flash and address symbols defined in the linkerfile 25 /// Create a firmware updater config from the flash and address symbols defined in the linkerfile
23 pub fn from_linkerfile_blocking( 26 pub fn from_linkerfile_blocking(
24 flash: &'a embassy_sync::blocking_mutex::Mutex<NoopRawMutex, core::cell::RefCell<FLASH>>, 27 dfu_flash: &'a embassy_sync::blocking_mutex::Mutex<NoopRawMutex, core::cell::RefCell<DFUFlash>>,
28 state_flash: &'a embassy_sync::blocking_mutex::Mutex<NoopRawMutex, core::cell::RefCell<StateFlash>>,
25 ) -> Self { 29 ) -> Self {
26 extern "C" { 30 extern "C" {
27 static __bootloader_state_start: u32; 31 static __bootloader_state_start: u32;
@@ -35,14 +39,14 @@ impl<'a, FLASH: NorFlash>
35 let end = &__bootloader_dfu_end as *const u32 as u32; 39 let end = &__bootloader_dfu_end as *const u32 as u32;
36 trace!("DFU: 0x{:x} - 0x{:x}", start, end); 40 trace!("DFU: 0x{:x} - 0x{:x}", start, end);
37 41
38 BlockingPartition::new(flash, start, end - start) 42 BlockingPartition::new(dfu_flash, start, end - start)
39 }; 43 };
40 let state = unsafe { 44 let state = unsafe {
41 let start = &__bootloader_state_start as *const u32 as u32; 45 let start = &__bootloader_state_start as *const u32 as u32;
42 let end = &__bootloader_state_end as *const u32 as u32; 46 let end = &__bootloader_state_end as *const u32 as u32;
43 trace!("STATE: 0x{:x} - 0x{:x}", start, end); 47 trace!("STATE: 0x{:x} - 0x{:x}", start, end);
44 48
45 BlockingPartition::new(flash, start, end - start) 49 BlockingPartition::new(state_flash, start, end - start)
46 }; 50 };
47 51
48 Self { dfu, state } 52 Self { dfu, state }