pub enum BootCommandSequenceDescription {
UploadSignedImage,
CheckDerivedFirmwareVersions,
}
Expand description
High level commands that lpc55 will convert safely into commands used to define SB2.1 files
Example
[[commands]]
seq = "UploadImage"
image = "Signed"
Variants
UploadSignedImage
Takes the filename specified in image from config.firmware
,
pads to 512B if necessary, erases flash, then uploads securely
(all but first block, only then the first block).
CheckDerivedFirmwareVersions
Takes the version specified in config.firmware.product
and
checks that it is greater than or equal to both the “Secure”
and “Nonsecure” firmware versions in the customer data page on the device.
This uses an interpretation and encoding of the [u16; 3]
Version
as an incrementing u32
counter. Namely, major version is interpreted
as an era (signaling breaking changes) and restricted to below 1024.
Minor version is interpreted as days since the twenties (unrestricted
for practical purposes). Patch version is restricted to below 64, and
would rarely be used.
So, for instance, 1:20210520
would correspond to 1.505.0
,
since (dt.date(2021, 5, 20) - dt.date(2020, 1, 1)).days = 505
, and
map to the counter (1 << 22) + (505 << 6) = 4226624
.
If the check fails, then the SB2 update stops.
Trait Implementations
sourceimpl Clone for BootCommandSequenceDescription
impl Clone for BootCommandSequenceDescription
sourcefn clone(&self) -> BootCommandSequenceDescription
fn clone(&self) -> BootCommandSequenceDescription
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<'de> Deserialize<'de> for BootCommandSequenceDescription
impl<'de> Deserialize<'de> for BootCommandSequenceDescription
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl PartialEq<BootCommandSequenceDescription> for BootCommandSequenceDescription
impl PartialEq<BootCommandSequenceDescription> for BootCommandSequenceDescription
sourcefn eq(&self, other: &BootCommandSequenceDescription) -> bool
fn eq(&self, other: &BootCommandSequenceDescription) -> bool
impl Eq for BootCommandSequenceDescription
impl StructuralEq for BootCommandSequenceDescription
impl StructuralPartialEq for BootCommandSequenceDescription
Auto Trait Implementations
impl RefUnwindSafe for BootCommandSequenceDescription
impl Send for BootCommandSequenceDescription
impl Sync for BootCommandSequenceDescription
impl Unpin for BootCommandSequenceDescription
impl UnwindSafe for BootCommandSequenceDescription
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.