CommandTag

Enum CommandTag 

Source
#[repr(u8)]
pub enum CommandTag<'a> {
Show 30 variants NoCommand { bytes: &'a [u8], }, FlashEraseAll { memory_id: u32, }, FlashEraseRegion { start_address: u32, byte_count: u32, memory_id: u32, }, ReadMemory { start_address: u32, byte_count: u32, memory_id: u32, }, WriteMemory { start_address: u32, memory_id: u32, bytes: &'a [u8], }, FillMemory { start_address: u32, byte_count: u32, pattern: u32, }, FlashSecurityDisable = 6, GetProperty { tag: PropertyTagDiscriminants, memory_index: u32, }, ReceiveSBFile { bytes: &'a [u8], }, Execute { start_address: u32, argument: u32, stackpointer: u32, }, Call { start_address: u32, argument: u32, }, Reset = 11, SetProperty { tag: PropertyTagDiscriminants, value: u32, }, FlashEraseAllUnsecure = 13, FlashProgramOnce { index: u32, count: u32, data: u32, }, FlashReadOnce { index: u32, count: u32, }, FlashReadResource = 16, ConfigureMemory { memory_id: u32, address: u32, }, ReliableUpdate = 18, GenerateKeyBlob = 19, FuseProgram { start_address: u32, bytes: &'a [u8], memory_id: u32, }, KeyProvisioning(&'a KeyProvOperation), TrustProvisioning(&'a TrustProvOperation), FuseRead { start_address: u32, byte_count: u32, memory_id: u32, }, UpdateLifeCycle = 24, EleMessage = 25, EL2GO = 32, ConfigureI2C = 193, ConfigureSPI = 194, ConfigureCAN = 195,
}
Expand description

MCU Bootloader Command Tags

§Command Categories

  • Memory Operations: Read, write, fill, and erase memory regions
  • Flash Operations: Specialized flash programming and security operations
  • Device Control: Reset, execute, and property management
  • Security: Key provisioning, trust provisioning, and lifecycle management
  • Protocol Configuration: Setup for various communication interfaces

Variants§

§

NoCommand

Used to load flashloader into the memory

Fields

§bytes: &'a [u8]

Binary data to write into the device

§

FlashEraseAll

Erase all flash memory sectors

Fields

§memory_id: u32

Memory identifier (0 for internal flash)

§

FlashEraseRegion

Erase specific flash memory region

Fields

§start_address: u32

Starting address of region to erase

§byte_count: u32

Number of bytes to erase (must be sector-aligned)

§memory_id: u32

Memory identifier

§

ReadMemory

Read data from memory

Fields

§start_address: u32

Starting address to read from

§byte_count: u32

Number of bytes to read

§memory_id: u32

Memory identifier

§

WriteMemory

Write data to memory

Fields

§start_address: u32

Starting address to write to

§memory_id: u32

Memory identifier

§bytes: &'a [u8]

Binary data to write

§

FillMemory

Fill memory region with pattern

Fields

§start_address: u32

Starting address (must be word-aligned)

§byte_count: u32

Number of bytes to fill (must be word-aligned)

§pattern: u32

32-bit pattern to repeat

§

FlashSecurityDisable = 6

Disable flash read/write protection

§

GetProperty

Get device property value

Fields

§tag: PropertyTagDiscriminants

Property identifier to retrieve

§memory_index: u32

Memory index for memory-specific properties

§

ReceiveSBFile

Process Secure Binary (SB) file

Fields

§bytes: &'a [u8]

SB file binary data

§

Execute

Execute code at specified address

Fields

§start_address: u32

Address to jump to

§argument: u32

Argument passed to the code

§stackpointer: u32

Stack pointer value to set

§

Call

Call function

Fields

§start_address: u32

Function address to call

§argument: u32

Argument passed to function

§

Reset = 11

Reset the MCU

§

SetProperty

Set device property value

Fields

§tag: PropertyTagDiscriminants

Property identifier to set

§value: u32

New property value

§

FlashEraseAllUnsecure = 13

Erase all flash and remove security

§

FlashProgramOnce

Program One-Time Programmable (OTP) memory

Fields

§index: u32

OTP memory index

§count: u32

Number of bytes to program

§data: u32

Data to program

§

FlashReadOnce

Read One-Time Programmable (OTP) memory

Fields

§index: u32

OTP memory index

§count: u32

Number of bytes to read

§

FlashReadResource = 16

Read flash resource information

§

ConfigureMemory

Configure external memory interface

Fields

§memory_id: u32

Memory interface identifier

§address: u32

Configuration data address

§

ReliableUpdate = 18

Perform reliable update operation

§

GenerateKeyBlob = 19

Generate encrypted key blob

§

FuseProgram

Program device fuses

Fields

§start_address: u32

Starting fuse address

§bytes: &'a [u8]

Fuse data to program

§memory_id: u32

Memory identifier

§

KeyProvisioning(&'a KeyProvOperation)

Key provisioning operations

§

TrustProvisioning(&'a TrustProvOperation)

Trust provisioning operations

§

FuseRead

Read device fuses

Fields

§start_address: u32

Starting fuse address

§byte_count: u32

Number of bytes to read

§memory_id: u32

Memory identifier

§

UpdateLifeCycle = 24

Update device lifecycle state

§

EleMessage = 25

Send EdgeLock Enclave message

§

EL2GO = 32

EdgeLock 2GO provisioning operations

§

ConfigureI2C = 193

Configure I2C interface parameters

§

ConfigureSPI = 194

Configure SPI interface parameters

§

ConfigureCAN = 195

Configure CAN interface parameters

Trait Implementations§

Source§

impl<'a> Clone for CommandTag<'a>

Source§

fn clone(&self) -> CommandTag<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandToParams for CommandTag<'_>

Source§

fn to_params(&self) -> (Vec<u32>, Option<&[u8]>)

Convert command to parameters and optional data phase.

Converts the command into a tuple containing command parameters as a vector of u32 values and an optional byte slice for data phase transmission.

§Returns

A tuple where the first element contains command parameters and the second contains optional data phase bytes

Source§

impl<'a> Debug for CommandTag<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Display for CommandTag<'a>

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, '_enum> From<&'_enum CommandTag<'a>> for CommandTagDiscriminants

Source§

fn from(val: &'_enum CommandTag<'a>) -> CommandTagDiscriminants

Converts to this type from the input type.
Source§

impl<'a> From<CommandTag<'a>> for CommandTagDiscriminants

Source§

fn from(val: CommandTag<'a>) -> CommandTagDiscriminants

Converts to this type from the input type.
Source§

impl<'a> IntoDiscriminant for CommandTag<'a>

Source§

type Discriminant = CommandTagDiscriminants

Enum listing the same variants as this enum but without any data fields
Source§

fn discriminant(&self) -> Self::Discriminant

Source§

impl ToAddress for CommandTag<'_>

Source§

fn code(&self) -> u8

Extract the numeric code from a tagged enum. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CommandTag<'a>

§

impl<'a> RefUnwindSafe for CommandTag<'a>

§

impl<'a> Send for CommandTag<'a>

§

impl<'a> Sync for CommandTag<'a>

§

impl<'a> Unpin for CommandTag<'a>

§

impl<'a> UnwindSafe for CommandTag<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.