pub struct BootLoader {
pub state: State,
}Expand description
A bootloader for STM32 devices.
Fields§
§state: StateThe reported state of the bootloader after preparing for boot
Implementations§
Source§impl BootLoader
impl BootLoader
Sourcepub fn prepare<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash, const BUFFER_SIZE: usize>(
config: BootLoaderConfig<ACTIVE, DFU, STATE>,
) -> Self
pub fn prepare<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash, const BUFFER_SIZE: usize>( config: BootLoaderConfig<ACTIVE, DFU, STATE>, ) -> Self
Inspect the bootloader state and perform actions required before booting, such as swapping firmware
Sourcepub fn try_prepare<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash, const BUFFER_SIZE: usize>(
config: BootLoaderConfig<ACTIVE, DFU, STATE>,
) -> Result<Self, BootError>
pub fn try_prepare<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash, const BUFFER_SIZE: usize>( config: BootLoaderConfig<ACTIVE, DFU, STATE>, ) -> Result<Self, BootError>
Inspect the bootloader state and perform actions required before booting, such as swapping firmware
Sourcepub unsafe fn load(self, start: u32) -> !
pub unsafe fn load(self, start: u32) -> !
Boots the application.
§Safety
This modifies the stack pointer and reset vector and will run code placed in the active partition.
On a dual-bank STM32G0B0/G0B1/G0C1 the jump into an active partition in flash bank 2 is a branch across
the banks, which can fail with the flash prefetch on (ES0547 2.2.8, ES0548/ES0549 2.2.10): keep the
bootloader’s config.rcc.flash_prefetch at its default, FlashPrefetch::IfSingleBank.
Auto Trait Implementations§
impl Freeze for BootLoader
impl RefUnwindSafe for BootLoader
impl Send for BootLoader
impl Sync for BootLoader
impl Unpin for BootLoader
impl UnsafeUnpin for BootLoader
impl UnwindSafe for BootLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more