MBoot Module API#
SPSDK MCU Bootloader communication module.
This module provides unified interface and communication protocols for interacting with NXP MCU bootloaders across different transport layers including UART, CAN, I2C, SPI, and SDIO interfaces.
McuBoot Class#
SPSDK MCU bootloader communication interface.
This module provides the McuBoot class for communicating with NXP MCU bootloaders, enabling secure provisioning operations, firmware updates, and device configuration through various transport protocols.
- class spsdk.mboot.mcuboot.McuBoot(interface, cmd_exception=False, family=None)#
Bases:
objectMcuBoot communication interface for NXP bootloader operations.
This class provides a high-level interface for communicating with NXP MCU bootloaders, handling command execution, status management, and data transfer operations. It supports various bootloader protocols and manages connection state and error handling.
- Variables:
DEFAULT_MAX_PACKET_SIZE – Default maximum packet size for data transfers.
Initialize the McuBoot object.
- Parameters:
interface (
MbootProtocolBase) – The instance of communication interface classcmd_exception (
bool) – True to throw McuBootCommandError on any error; False to set status code only Note: some operation might raise McuBootCommandError is all casesfamily (
Optional[FamilyRevision]) – Optional family revision specification
- DEFAULT_MAX_PACKET_SIZE = 32#
- property available_commands: list[CommandTag]#
Get a list of supported commands.
Retrieves the available commands from the MCU boot loader. If the commands list is already cached, returns the cached version. Otherwise, queries the device for available commands using the AVAILABLE_COMMANDS property and caches the result.
- Raises:
McuBootCommandError – When unable to retrieve available commands property.
- Returns:
List of supported command tags from the MCU boot loader.
- call(address, argument)#
Call function at specified address with given argument.
- Parameters:
address (
int) – Call address (must be word aligned)argument (
int) – Function arguments address
- Return type:
bool- Returns:
False in case of any problem; True otherwise
- close()#
Disconnect from the device.
Closes the connection to the MCU device through the underlying interface. This method should be called when communication with the device is no longer needed to properly release resources and terminate the connection.
- Return type:
None
- configure_memory(address, mem_id)#
Configure memory with specified parameters.
This method configures a memory region at the given address with the specified memory ID. The configuration data is expected to be located at the provided memory address.
- Parameters:
address (
int) – The address in memory where configuration data is located.mem_id (
int) – Memory identifier specifying which memory to configure.
- Return type:
bool- Returns:
True if configuration was successful, False if any problem occurred.
- dsc_hsm_create_session(oem_seed_input_addr, oem_seed_input_size, oem_share_output_addr, oem_share_output_size)#
Create DSC HSM session for trust provisioning.
Command used by OEM to provide its share to create the initial trust provisioning keys.
- Parameters:
oem_seed_input_addr (
int) – Address of 128-bit entropy seed value provided by the OEM.oem_seed_input_size (
int) – OEM seed size in bytes.oem_share_output_addr (
int) – Address for 128-bit encrypted token output.oem_share_output_size (
int) – Output buffer size in bytes.
- Return type:
Optional[int]- Returns:
Session value if successful, None otherwise.
- dsc_hsm_enc_blk(sbx_header_input_addr, sbx_header_input_size, block_num, block_data_addr, block_data_size)#
Command used to encrypt the given block sliced by the nxpimage.
This command is only supported after issuance of dsc_hsm_create_session.
- Parameters:
sbx_header_input_addr (
int) – SBx header containing file size, Firmware version and Timestamp data. Except for hash digest of block 0, all other fields should be valid.sbx_header_input_size (
int) – Size of the header in bytes.block_num (
int) – Number of block to encrypt.block_data_addr (
int) – Address of data block to encrypt.block_data_size (
int) – Size of data block in bytes.
- Return type:
Optional[int]- Returns:
Response value from trust provisioning operation, None if operation failed.
- dsc_hsm_enc_sign(block_data_input_addr, block_data_input_size, signature_output_addr, signature_output_size)#
Sign data buffer using DSC HSM encryption.
This command is only supported after issuance of dsc_hsm_create_session.
- Parameters:
block_data_input_addr (
int) – Address of data buffer to be signed.block_data_input_size (
int) – Size of data buffer in bytes.signature_output_addr (
int) – Address to output signature data.signature_output_size (
int) – Size of the output signature data in bytes.
- Return type:
Optional[int]- Returns:
Response value from trust provisioning operation, None if operation failed.
- efuse_program_once(index, value, verify=False)#
Write into MCU once program region (OCOTP).
This method programs a 4-byte value into the One-Time Programmable (OTP) memory at the specified index. Optionally verifies the write operation by reading back and comparing the value as a bitmask.
- Parameters:
index (
int) – Start index in the OTP memory region.value (
int) – 4-byte integer value to program into OTP.verify (
bool) – If True, verify programming by reading back and comparing as bitmask.
- Return type:
bool- Returns:
True if programming succeeded, False if any error occurred.
- efuse_read_once(index)#
Read from MCU flash program once region.
The method reads a 32-bit value from the specified index in the MCU’s one-time programmable (OTP) flash region.
- Parameters:
index (
int) – Start index in the flash program once region.- Return type:
Optional[int]- Returns:
Read value as 32-bit integer, or None if operation failed.
- el2go_batch_tp(data_address, report_address=4294967295, dry_run=False, progress_callback=None)#
Perform EL2GO batch trust provisioning operation.
Executes product-based trust provisioning using secure objects stored at the specified address in target memory. Optionally stores provisioning report and supports dry-run mode for validation without actual provisioning.
- Parameters:
data_address (
int) – Memory address where secure objects are stored in target device.report_address (
int) – Memory address to store provisioning report, defaults to 0xFFFF_FFFF (no report storage).dry_run (
bool) – Execute validation only without actual provisioning, defaults to False.progress_callback (
Optional[Callable[[int,int],None]]) – Optional callback function for progress updates during data transfer operations.
- Return type:
tuple[Optional[int],Optional[bytes]]- Returns:
Tuple containing status code and provisioning report data if successful, (None, None) if operation failed.
- el2go_close_device(address, dry_run=False)#
Close device using EL2GO Provisioning FW.
This command finalizes the device provisioning process by closing the device through the EL2GO (EdgeLock 2GO) provisioning firmware.
- Parameters:
address (
int) – Target device address for the close operation.dry_run (
bool) – If True, performs a simulation without actual device changes.
- Return type:
Optional[int]- Returns:
Response value from the trust provisioning operation, or None if operation failed.
- el2go_get_version()#
Get version of the EL2GO Provisioning FW.
This method retrieves the firmware version information from the EL2GO (EdgeLock 2GO) provisioning system by sending a version query command and processing the response.
- Return type:
Optional[list[int]]- Returns:
List of version integers if successful, None if the command fails or returns an unexpected response type.
- ele_message(cmdMsgAddr, cmdMsgCnt, respMsgAddr, respMsgCnt)#
Send EdgeLock Enclave message.
This method sends a command message to the EdgeLock Enclave and optionally receives a response. The command and response data are exchanged through RAM addresses.
- Parameters:
cmdMsgAddr (
int) – Address in RAM where the command message words are prepared.cmdMsgCnt (
int) – Count of 32-bit command words.respMsgAddr (
int) – Address in RAM where the response will be stored.respMsgCnt (
int) – Count of 32-bit response words.
- Return type:
bool- Returns:
True if the operation was successful, False otherwise.
- execute(address, argument, sp)#
Execute program on a given address using the stack pointer.
- Parameters:
address (
int) – Jump address (must be word aligned)argument (
int) – Function arguments addresssp (
int) – Stack pointer address
- Return type:
bool- Returns:
False in case of any problem; True otherwise
- fill_memory(address, length, pattern=4294967295)#
Fill MCU memory with specified pattern.
The method fills a specified memory region with a given 32-bit pattern value. All parameters must be word-aligned for proper operation.
- Parameters:
address (
int) – Start address in MCU memory (must be word aligned).length (
int) – Number of words to fill (must be word aligned).pattern (
int) – 32-bit pattern value to fill memory with.
- Return type:
bool- Returns:
True if operation successful, False otherwise.
- flash_erase_all(mem_id=0)#
Erase complete flash memory without recovering flash security section.
This operation will erase all flash memory content except for the flash security section, which remains intact to preserve security configurations.
- Parameters:
mem_id (
int) – Memory identifier specifying which memory to erase (default is 0).- Return type:
bool- Returns:
True if erase operation completed successfully, False otherwise.
- flash_erase_all_unsecure()#
Erase complete flash memory and recover flash security section.
This command performs a mass erase of the entire flash memory and restores the flash security settings to their default unsecured state.
- Return type:
bool- Returns:
True if the erase operation completed successfully, False otherwise.
- flash_erase_region(address, length, mem_id=0)#
Erase specified range of flash memory.
This method erases a contiguous region of flash memory starting at the given address for the specified length. The operation is performed on the target device through the MCU boot protocol.
- Parameters:
address (
int) – Start address of the flash region to erase.length (
int) – Number of bytes to erase from the start address.mem_id (
int) – Memory identifier specifying which memory to erase (default is 0).
- Return type:
bool- Returns:
True if erase operation completed successfully, False otherwise.
- flash_program_once(index, data)#
Write into MCU flash program once region (max 8 bytes).
- Parameters:
index (
int) – Start index for the program once region.data (
bytes) – Input data aligned to 4 or 8 bytes.
- Return type:
bool- Returns:
False in case of any problem; True otherwise.
- Raises:
SPSDKError – When invalid length of data. Must be aligned to 4 or 8 bytes.
- flash_read_once(index, count=4)#
Read from MCU flash program once region.
The method reads data from the MCU’s one-time programmable (OTP) flash region. Maximum read size is 8 bytes per operation.
- Parameters:
index (
int) – Start index in the program once regioncount (
int) – Number of bytes to read (must be 4 or 8)
- Return type:
Optional[bytes]- Returns:
Data read from the program once region; None if operation fails
- Raises:
SPSDKError – When invalid count of bytes. Must be 4 or 8
- flash_read_resource(address, length, option=1)#
Read resource of flash module.
The method reads data from specific flash memory areas like IFR or Firmware ID. The length must be aligned to 4 bytes boundary.
- Parameters:
address (
int) – Start address to read from.length (
int) – Number of bytes to read (must be aligned to 4 bytes).option (
int) – Area to be read. 0 means Flash IFR, 1 means Flash Firmware ID.
- Raises:
McuBootError – When the length is not aligned to 4 bytes.
- Return type:
Optional[bytes]- Returns:
Data from the resource; None in case of failure.
- flash_security_disable(backdoor_key)#
Disable flash security by using backdoor key.
The method sends a flash security disable command to the MCU using the provided 8-byte backdoor key. The key bytes are reordered (reversed in 4-byte chunks) before transmission.
- Parameters:
backdoor_key (
bytes) – The backdoor key value as bytes array, must be exactly 8 bytes long.- Return type:
bool- Returns:
True if flash security was successfully disabled, False otherwise.
- Raises:
McuBootError – If the backdoor_key is not exactly 8 bytes long.
- fuse_program(address, data, mem_id=0)#
Program fuse memory with specified data.
This method programs fuse memory at the given address with the provided data. The operation is performed through the MCU bootloader interface.
- Parameters:
address (
int) – Start address in fuse memory where programming begins.data (
bytes) – Binary data to be programmed into fuse memory.mem_id (
int) – Memory identifier for the target fuse memory (default: 0).
- Return type:
bool- Returns:
True if programming succeeded, False if any error occurred.
- fuse_read(address, length, mem_id=0)#
Read fuse memory from the target device.
This method reads data from the fuse memory at the specified address and length. The operation may fail if the fuse memory is not accessible or if invalid parameters are provided.
- Parameters:
address (
int) – Start address in fuse memory to read from.length (
int) – Number of bytes to read from fuse memory.mem_id (
int) – Memory identifier for fuse access, defaults to 0.
- Return type:
Optional[bytes]- Returns:
Data read from the fuse memory; None in case of a failure.
- generate_key_blob(dek_data, key_sel=0, count=72)#
Generate Key Blob.
This method creates a key blob by wrapping a Data Encryption Key (DEK) using the specified Blob Key Encryption Key (BKEK). The process involves sending the DEK data to the target device and retrieving the generated encrypted key blob.
- Parameters:
dek_data (
bytes) – Data Encryption Key as bytes to be wrapped into key blobkey_sel (
int) – Select the BKEK used to wrap the BK (default: OPTMK/FUSES)count (
int) – Expected key blob size in bytes (default: 72 for AES128bit)
- Return type:
Optional[bytes]- Returns:
Generated key blob as bytes, None if operation fails
- get_memory_list()#
Get list of embedded memories.
Retrieves information about all available memory regions including internal flash, internal RAM, and external memories connected to the MCU.
- Return type:
dict- Returns:
Dictionary with memory regions. Keys: ‘internal_flash’ (optional) - list of internal flash regions, ‘internal_ram’ (optional) - list of internal RAM regions, ‘external_mems’ (optional) - list of external memory regions.
- Raises:
McuBootCommandError – Error reading the memory list.
- get_property(prop_tag, index=0)#
Get specified property value from the MCU device.
Retrieves a property value using the get-property command. The property can be related to device capabilities, memory regions, or external memory configurations.
- Parameters:
prop_tag (
Union[PropertyTag,int]) – Property tag identifier from PropertyTag enum or integer valueindex (
int) – External memory ID or internal memory region index (depends on property type)
- Return type:
Optional[list[int]]- Returns:
List of integers representing the property value; None if no response from device
- Raises:
McuBootError – If received invalid get-property response
- get_property_list()#
Get a list of available properties.
Retrieves all available properties for the target device by iterating through known property tags and attempting to read their values. Properties that cannot be read are skipped, and successfully read properties are parsed and included in the result list.
- Return type:
list[PropertyValueBase]- Returns:
List of available properties with their parsed values.
- Raises:
McuBootCommandError – Failure to read properties list.
McuBootError – Property values cannot be parsed.
- property is_opened: bool#
Check if the device interface is currently opened.
- Returns:
True if the device interface is opened, False otherwise.
- kp_enroll()#
Key provisioning: Enroll Command (start PUF).
This command initiates the Physical Unclonable Function (PUF) enrollment process for key provisioning operations.
- Return type:
bool- Returns:
True if enrollment was successful, False otherwise.
- kp_read_key_store()#
Read key data from key store area.
This method performs a key provisioning operation to retrieve key data stored in the device’s key store area. The operation sends a READ_KEY_STORE command and processes the response to extract the key data.
- Return type:
Optional[bytes]- Returns:
Key data from key store area if successful, None if operation fails.
- kp_read_nonvolatile(mem_id=0)#
Load the key from a nonvolatile memory to bootloader.
This method performs key provisioning operation to read a key from nonvolatile memory and load it into the bootloader for further use.
- Parameters:
mem_id (
int) – The memory ID to read from.- Return type:
bool- Returns:
True if operation successful, False otherwise.
- kp_set_intrinsic_key(key_type, key_size)#
Key provisioning: Generate Intrinsic Key.
This method generates an intrinsic key with the specified type and size using the key provisioning functionality.
- Parameters:
key_type (
int) – Type of the key to generate.key_size (
int) – Size of the key in bytes.
- Return type:
bool- Returns:
True if key generation was successful, False otherwise.
- kp_set_user_key(key_type, key_data)#
Send the user key specified by key_type to bootloader for key provisioning.
- Parameters:
key_type (
int) – Type of the user key, see enumeration for details.key_data (
bytes) – Binary content of the user key.
- Return type:
bool- Returns:
True if key was successfully sent, False in case of any problem.
- kp_write_key_store(key_data)#
Key provisioning: Write key data into key store area.
This method writes the provided key store binary content to the processor’s key store area using the key provisioning protocol.
- Parameters:
key_data (
bytes) – Key store binary content to be written to processor.- Return type:
bool- Returns:
True if operation succeeded, False otherwise.
- kp_write_nonvolatile(mem_id=0)#
Write the key to a nonvolatile memory during key provisioning.
This method performs a key provisioning operation to store the previously loaded key into nonvolatile memory for persistent storage.
- Parameters:
mem_id (
int) – The memory ID where the key should be written (default: 0)- Return type:
bool- Returns:
True if the operation was successful, False otherwise
- load_image(data, progress_callback=None)#
Load a boot image to the device.
The method splits the boot image data into chunks and sends them to the device for loading. Progress can be tracked through an optional callback function.
- Parameters:
data (
bytes) – Boot image data to be loaded to the device.progress_callback (
Optional[Callable[[int,int],None]]) – Optional callback function for progress updates, receives current and total progress values.
- Return type:
bool- Returns:
True if image loaded successfully, False if any problem occurred.
- nxp_get_id(id_blob_addr, id_blob_size)#
Harvest device ID blob during wafer test as part of RTS flow.
This command retrieves the device ID blob from the specified memory location according to the Round-trip trust provisioning specification.
- Parameters:
id_blob_addr (
int) – Address of ID blob in device memory.id_blob_size (
int) – Size of the ID blob buffer in bytes.
- Return type:
Optional[int]- Returns:
First value from trust provisioning response if successful, None otherwise.
- open()#
Connect to the device.
Establishes connection to the target device using the configured interface. Logs the connection attempt with interface details.
- Raises:
SPSDKConnectionError – If the connection to the device fails.
SPSDKError – If the interface is not properly configured.
- Return type:
None
- read_memory(address, length, mem_id=0, progress_callback=None, fast_mode=False)#
Read data from MCU memory.
The method implements a workaround for better USB-HID reliability by splitting large reads into smaller packets when not in fast mode. Fast mode transfers data in single operation but may be unreliable for USB-HID interfaces.
- Parameters:
address (
int) – Start address in memory to read from.length (
int) – Number of bytes to read.mem_id (
int) – Memory identifier, defaults to 0.progress_callback (
Optional[Callable[[int,int],None]]) – Optional callback function to report progress with signature (bytes_read, total_bytes).fast_mode (
bool) – Enable fast mode for USB-HID transfer, may be unreliable.
- Return type:
Optional[bytes]- Returns:
Data read from memory, empty bytes on command failure, or None on read failure.
- receive_sb_file(data, progress_callback=None, check_errors=False)#
Receive SB file.
Sends Secure Binary file data to the target device for processing. The method handles data chunking, progress reporting, and error checking during transmission.
- Parameters:
data (
bytes) – SB file data to be transmitted to the device.progress_callback (
Optional[Callable[[int,int],None]]) – Optional callback function for progress updates during transmission.check_errors (
bool) – Check for ABORT_FRAME and related errors on USB interface between packets. When False, significantly improves USB transfer speed (~20x) but final status may be misleading. If receive-sb-file fails, re-run with this flag set to True.
- Return type:
bool- Returns:
True if successful, False if any problem occurred.
- reliable_update(address)#
Execute reliable update command on the target device.
This command instructs the bootloader to perform a reliable update using firmware stored at the specified address.
- Parameters:
address (
int) – Memory address where the new firmware is stored.- Return type:
bool- Returns:
True if the reliable update command was successful, False otherwise.
- reset(timeout=2000, reopen=True)#
Reset MCU and reconnect if enabled.
The method sends a reset command to the MCU, closes the current connection, and optionally reopens it after a specified timeout period.
- Parameters:
timeout (
int) – The maximal waiting time in milliseconds for reopen connection.reopen (
bool) – True for reopen connection after HW reset else False.
- Return type:
bool- Returns:
False in case of any problem; True otherwise.
- Raises:
McuBootConnectionError – Reset command failed or reopen failed.
- set_property(prop_tag, value)#
Set value of specified property.
This method sets a property value on the target device using the SetProperty command. The property is identified by its tag and the new value is applied.
- Parameters:
prop_tag (
Union[PropertyTag,int]) – Property tag identifier from PropertyTag enum or integer value.value (
int) – New value to set for the specified property.
- Return type:
bool- Returns:
True if property was set successfully, False otherwise.
- property status_code: int#
Return status code of the last operation.
- Returns:
Status code as integer value.
- property status_string: str#
Return status string.
Convert the internal status code to a human-readable string representation.
- Returns:
Human-readable status string corresponding to the current status code.
- tp_hsm_enc_blk(mfg_cust_mk_sk_0_blob_input_addr, mfg_cust_mk_sk_0_blob_input_size, kek_id, sb3_header_input_addr, sb3_header_input_size, block_num, block_data_addr, block_data_size)#
Trust provisioning: Encrypt the given SB3 data block.
This method encrypts a Secure Binary 3 (SB3) data block using HSM encryption with the provided CKDF Master Key Blob and encryption parameters.
- Parameters:
mfg_cust_mk_sk_0_blob_input_addr (
int) – The input buffer address where the CKDF Master Key Blob locates at.mfg_cust_mk_sk_0_blob_input_size (
int) – The byte count of the CKDF Master Key Blob.kek_id (
int) – The CKDF Master Key Encryption Key ID (0x10: NXP_CUST_KEK_INT_SK, 0x11: NXP_CUST_KEK_EXT_SK).sb3_header_input_addr (
int) – The input buffer address where the SB3 Header (block0) locates at.sb3_header_input_size (
int) – The byte count of the SB3 Header.block_num (
int) – The index of the block. Due to SB3 Header (block 0) is always unencrypted, the index starts from block1.block_data_addr (
int) – The buffer address where the SB3 data block locates at.block_data_size (
int) – The byte count of the SB3 data block.
- Return type:
bool- Returns:
True if encryption was successful, False otherwise.
- tp_hsm_enc_sign(key_blob_input_addr, key_blob_input_size, block_data_input_addr, block_data_input_size, signature_output_addr, signature_output_size)#
Sign data using HSM encryption and signing operation.
This method performs Trust Provisioning HSM encryption and signing operation on the provided data block using the specified key blob, writing the resulting signature to the output buffer.
- Parameters:
key_blob_input_addr (
int) – Input buffer address where signing key blob is located.key_blob_input_size (
int) – Size of the signing key blob in bytes.block_data_input_addr (
int) – Input buffer address where the data to be signed is located.block_data_input_size (
int) – Size of the data to be signed in bytes.signature_output_addr (
int) – Output buffer address where ROM writes the signature.signature_output_size (
int) – Size of the output buffer in bytes.
- Return type:
Optional[int]- Returns:
Signature size in bytes if successful, None if operation fails.
- tp_hsm_gen_key(key_type, reserved, key_blob_output_addr, key_blob_output_size, ecdsa_puk_output_addr, ecdsa_puk_output_size)#
Generate HSM keys for trust provisioning operations.
This method generates common keys used in trust provisioning, including manufacturing firmware keys, encryption keys, signing keys, and customer master keys. The generated keys are written to specified output buffers.
- Parameters:
key_type (
int) – Type of key to generate (MFW_ISK, MFW_ENCK, GEN_SIGNK, GET_CUST_MK_SK).reserved (
int) – Reserved parameter, must be zero.key_blob_output_addr (
int) – Output buffer address where ROM writes the key blob.key_blob_output_size (
int) – Size of the key blob output buffer in bytes.ecdsa_puk_output_addr (
int) – Output buffer address where ROM writes the public key.ecdsa_puk_output_size (
int) – Size of the public key output buffer in bytes.
- Return type:
Optional[list[int]]- Returns:
List containing byte count of the key blob and public key from device, None if operation fails.
- tp_hsm_store_key(key_type, key_property, key_input_addr, key_input_size, key_blob_output_addr, key_blob_output_size)#
Trust provisioning: Store OEM common keys.
This method stores OEM common keys using the trust provisioning HSM functionality. The key is stored as a blob in the specified output buffer location.
- Parameters:
key_type (
int) – Key type to store (CKDFK, HKDFK, HMACK, CMACK, AESK, KUOK)key_property (
int) – Key properties - Bit 0: Key Size (0=128bit, 1=256bit), Bits 30-31: CSS protection modekey_input_addr (
int) – Input buffer address where the key is locatedkey_input_size (
int) – Size of the key in byteskey_blob_output_addr (
int) – Output buffer address for the key blobkey_blob_output_size (
int) – Output buffer size in bytes
- Return type:
Optional[list[int]]- Returns:
Key blob header and byte count (header excluded) on success, None on failure
Generate OEM master share for trust provisioning.
Takes the entropy seed provided by the OEM as input and generates encrypted shares and customer certificate public key through the trust provisioning operation.
- Parameters:
oem_share_input_addr (
int) – The input buffer address where the OEM Share (entropy seed) is located.oem_share_input_size (
int) – The byte count of the OEM Share.oem_enc_share_output_addr (
int) – The output buffer address where ROM writes the Encrypted OEM Share.oem_enc_share_output_size (
int) – The output buffer size in bytes.oem_enc_master_share_output_addr (
int) – The output buffer address where ROM writes the Encrypted OEM Master Share.oem_enc_master_share_output_size (
int) – The output buffer size in bytes.oem_cust_cert_puk_output_addr (
int) – The output buffer address where ROM writes the OEM Customer Certificate Public Key.oem_cust_cert_puk_output_size (
int) – The output buffer size in bytes.
- Return type:
Optional[list[int]]- Returns:
Sizes of two encrypted blobs (the Encrypted OEM Share and the Encrypted OEM Master Share) and a public key (the OEM Customer Certificate Public Key), or None if operation fails.
- tp_oem_get_cust_cert_dice_puk(oem_rkth_input_addr, oem_rkth_input_size, oem_cust_cert_dice_puk_output_addr, oem_cust_cert_dice_puk_output_size, mldsa=False)#
Get OEM customer certificate DICE public key.
Creates the initial DICE CA keys by processing OEM Root Key Table Hash (RKTH) input and generating the corresponding OEM Customer Certificate Public Key for DICE.
- Parameters:
oem_rkth_input_addr (
int) – Input buffer address where the OEM RKTH is located.oem_rkth_input_size (
int) – Byte count of the OEM RKTH.oem_cust_cert_dice_puk_output_addr (
int) – Output buffer address where ROM writes the OEM Customer Certificate Public Key for DICE.oem_cust_cert_dice_puk_output_size (
int) – Output buffer size in bytes.mldsa (
bool) – Flag to indicate MLDSA operation, defaults to False.
- Return type:
Optional[int]- Returns:
Byte count of the OEM Customer Certificate Public Key for DICE, or None if operation fails.
- tp_oem_get_cust_dice_response(challenge_addr, challenge_size, response_addr, response_size)#
Create DICE response for given challenge.
This method generates a Device Identifier Composition Engine (DICE) response based on the provided challenge data through the Trust Provisioning interface.
- Parameters:
challenge_addr (
int) – The input buffer address where the challenge is located.challenge_size (
int) – The byte count of the challenge.response_addr (
int) – The output buffer address where ROM/FW writes the response.response_size (
int) – The byte count of the response.
- Return type:
Optional[int]- Returns:
The byte count of the DICE response, or None if operation failed.
Set OEM master share for trust provisioning.
Takes the entropy seed and the Encrypted OEM Master Share to configure the trust provisioning process.
- Parameters:
oem_share_input_addr (
int) – The input buffer address where the OEM Share (entropy seed) is located.oem_share_input_size (
int) – The byte count of the OEM Share.oem_enc_master_share_input_addr (
int) – The input buffer address where the Encrypted OEM Master Share is located.oem_enc_master_share_input_size (
int) – The byte count of the Encrypted OEM Master Share.
- Return type:
bool- Returns:
True if operation succeeded, False otherwise.
- tp_prove_genuinity(address, buffer_size)#
Start the process of proving genuinity.
- Parameters:
address (
int) – Address where to prove genuinity request (challenge) container.buffer_size (
int) – Maximum size of the response package (limit 0xFFFF).
- Raises:
McuBootError – Invalid input parameters.
- Return type:
Optional[int]- Returns:
Operation result if prove genuinity operation is successfully completed.
- tp_prove_genuinity_hybrid(address, buffer_size)#
Start the process of proving genuinity using hybrid mode.
This method initiates a trust provisioning operation to prove the genuinity of the device using hybrid cryptographic approach.
- Parameters:
address (
int) – Address where to store the genuinity request (challenge) container.buffer_size (
int) – Maximum size of the response package (limit 0xFFFF).
- Raises:
McuBootError – Invalid input parameters.
- Return type:
Optional[int]- Returns:
Operation result code if successful, None otherwise.
- tp_set_wrapped_data(address, stage=75, control=1)#
Start the process of setting OEM data in TrustProvisioning flow.
This method initiates the TrustProvisioning SetWrappedData operation to configure OEM data on the target device. The operation can use either a specified address or a container within the firmware.
- Parameters:
address (
int) – Address where the wrapped data container is located on target devicestage (
int) – Stage of TrustProvisioning flow, defaults to 0x4Bcontrol (
int) – Control flag - 1 to use the address, 2 to use container within firmware, defaults to 1
- Return type:
bool- Returns:
True if set_wrapped_data operation is successfully completed, False otherwise
- update_life_cycle(life_cycle)#
Update device life cycle.
This method sends a command to update the device’s life cycle state to a new value.
- Parameters:
life_cycle (
int) – New life cycle value to set on the device.- Return type:
bool- Returns:
True if the life cycle update was successful, False otherwise.
- wpc_get_id(wpc_id_blob_addr, wpc_id_blob_size)#
Command used for harvesting device ID blob.
The method retrieves the Wireless Power Consortium (WPC) device identification blob from the target device through trust provisioning interface.
- Parameters:
wpc_id_blob_addr (
int) – Buffer address where the WPC ID blob will be stored.wpc_id_blob_size (
int) – Size of the buffer allocated for the WPC ID blob.
- Return type:
Optional[int]- Returns:
Device ID value if successful, None if command fails or returns invalid response.
- wpc_insert_cert(wpc_cert_addr, wpc_cert_len, ec_id_offset, wpc_puk_offset)#
Insert WPC certificate for validation before writing to flash.
This command extracts ECID and WPC PUK from the certificate and validates both components. Returns success if validation passes, otherwise returns failure.
- Parameters:
wpc_cert_addr (
int) – Address of the certificate to be inserted.wpc_cert_len (
int) – Length of the certificate in bytes.ec_id_offset (
int) – Offset to the 72-bit ECID within the certificate.wpc_puk_offset (
int) – Offset to the WPC PUK from the beginning of the certificate.
- Return type:
Optional[int]- Returns:
0 if validation successful, None if validation failed.
- wpc_sign_csr(csr_tbs_addr, csr_tbs_len, signature_addr, signature_len)#
Sign CSR data using the TBS (To Be Signed) portion.
This command signs Certificate Signing Request data and stores the resulting signature at the specified memory location.
- Parameters:
csr_tbs_addr (
int) – Address of CSR-TBS data in memory.csr_tbs_len (
int) – Length in bytes of CSR-TBS data.signature_addr (
int) – Address where to store the generated signature.signature_len (
int) – Expected length of the signature in bytes.
- Return type:
Optional[int]- Returns:
Actual signature length if successful, None otherwise.
- write_memory(address, data, mem_id=0, progress_callback=None)#
Write data into MCU memory.
The method writes the provided data to the specified memory address in the MCU. Data is automatically split into chunks for transmission.
- Parameters:
address (
int) – Start address in memory where data will be written.data (
bytes) – Bytes data to be written to memory.mem_id (
int) – Memory ID (see ExtMemId), use 0 for internal memory.progress_callback (
Optional[Callable[[int,int],None]]) – Optional callback function for progress updates with (current, total) parameters.
- Return type:
bool- Returns:
True if write operation succeeded, False otherwise.
MBoot Commands#
SPSDK MBOOT protocol commands and responses implementation.
This module provides comprehensive support for MBOOT (MCU Bootloader) protocol communication, including command packets, response parsing, and protocol-specific operations for secure provisioning and device management.
- class spsdk.mboot.commands.CmdHeader(tag, flags, reserved, params_count)#
Bases:
objectMcuBoot command/response header.
This class represents the header structure for McuBoot protocol commands and responses, providing serialization and parsing capabilities for communication with MCU bootloader.
- Variables:
SIZE – Fixed size of the header in bytes (4 bytes).
Initialize the Command Header.
- Parameters:
tag (
int) – Tag indicating the command, see CommandTag classflags (
int) – Flags for the commandreserved (
int) – Reserved field for future useparams_count (
int) – Number of parameters for the command
- SIZE = 4#
- export()#
Export the command header to bytes.
Serializes the command header fields (tag, flags, reserved, params_count) into a 4-byte packed binary format.
- Return type:
bytes- Returns:
Exported command header as bytes.
- classmethod parse(data, offset=0)#
Parse command header from binary data.
The method extracts a 4-byte command header from the provided binary data at the specified offset and creates a CmdHeader object.
- Parameters:
data (
bytes) – Binary data containing the command header.offset (
int) – Byte offset within the data where parsing should start.
- Return type:
Self- Returns:
Parsed CmdHeader object.
- Raises:
McuBootError – Invalid data format or insufficient data length.
- class spsdk.mboot.commands.CmdPacket(tag, flags, *args, data=None)#
Bases:
CmdPacketBaseMcuBoot command packet format class.
Represents a command packet used in McuBoot protocol communication, handling command formatting, parameter management, and binary serialization for secure boot operations.
- Variables:
SIZE – Fixed size of the command packet in bytes.
EMPTY_VALUE – Default empty value used for padding.
Initialize the Command Packet object.
Creates a new command packet with the specified tag, flags, arguments, and optional data. The data is automatically padded to 4-byte alignment if provided.
- Parameters:
tag (
CommandTag) – Tag identifying the command typeflags (
int) – Flags used by the commandargs (
int) – Variable number of integer arguments used by the commanddata (
Optional[bytes]) – Additional binary data to append to parameters, defaults to None
- EMPTY_VALUE = 0#
- SIZE = 32#
- export(padding=True)#
Export CmdPacket into bytes.
The method serializes the command packet by exporting the header with updated parameter count, packing all parameters as unsigned integers, and optionally adding padding to reach the required size.
- Parameters:
padding (
bool) – If True, add padding to reach the specific packet size.- Return type:
bytes- Returns:
Exported command packet as bytes.
- class spsdk.mboot.commands.CmdResponse(header, raw_data)#
Bases:
CmdResponseBaseMcuBoot command response handler.
This class represents a response from McuBoot commands, providing parsing and access to response data including status codes, headers, and raw response content. It handles the interpretation of binary response data and provides convenient access to response status and values.
Initialize the Command Response object.
Creates a command response instance with the provided header and raw data. The status code is automatically extracted from the raw data.
- Parameters:
header (
CmdHeader) – Header for the responseraw_data (
bytes) – Response data containing status and payload
- property value: int#
Get integer representation of the response.
Unpacks the first 4 bytes of raw_data as a big-endian unsigned integer.
- Returns:
Integer value extracted from the response data.
- class spsdk.mboot.commands.CommandFlag(tag, label, description=None)#
Bases:
SpsdkEnumMcuBoot command flags enumeration.
This enumeration defines flags that can be applied to McuBoot commands to specify their behavior and characteristics, such as whether a command includes a data phase.
- HAS_DATA_PHASE = (1, 'DataPhase', 'Command has a data phase')#
- NONE = (0, 'NoFlags', 'No flags specified')#
- class spsdk.mboot.commands.CommandTag(tag, label, description=None)#
Bases:
SpsdkEnumMcuBoot command enumeration for bootloader operations.
This enumeration defines all available commands that can be sent to NXP MCU bootloaders through the McuBoot protocol. Each command includes a numeric identifier, string name, and human-readable description for various memory operations, security functions, and device configuration tasks.
- CALL = (10, 'Call', 'Call')#
- CONFIGURE_CAN = (195, 'ConfigureCan', 'Configure CAN')#
- CONFIGURE_I2C = (193, 'ConfigureI2c', 'Configure I2C')#
- CONFIGURE_MEMORY = (17, 'ConfigureMemory', 'Configure Quad-SPI Memory')#
- CONFIGURE_SPI = (194, 'ConfigureSpi', 'Configure SPI')#
- EL2GO = (32, 'EL2GO', 'EL2GO Provisioning Commands and API Calls')#
- ELE_MESSAGE = (25, 'EleMessage', 'Send EdgeLock Enclave Message')#
- EXECUTE = (9, 'Execute', 'Execute')#
- FILL_MEMORY = (5, 'FillMemory', 'Fill Memory')#
- FLASH_ERASE_ALL = (1, 'FlashEraseAll', 'Erase Complete Flash')#
- FLASH_ERASE_ALL_UNSECURE = (13, 'FlashEraseAllUnsecure', 'Erase Complete Flash and Unlock')#
- FLASH_ERASE_REGION = (2, 'FlashEraseRegion', 'Erase Flash Region')#
- FLASH_PROGRAM_ONCE = (14, 'FlashProgramOnce', 'Flash Program Once')#
- FLASH_READ_ONCE = (15, 'FlashReadOnce', 'Flash Read Once')#
- FLASH_READ_RESOURCE = (16, 'FlashReadResource', 'Flash Read Resource')#
- FLASH_SECURITY_DISABLE = (6, 'FlashSecurityDisable', 'Disable Flash Security')#
- FUSE_PROGRAM = (20, 'ProgramFuse', 'Program Fuse')#
- FUSE_READ = (23, 'ReadFuse', 'Read Fuse')#
- GENERATE_KEY_BLOB = (19, 'GenerateKeyBlob', 'Generate Key Blob')#
- GET_PROPERTY = (7, 'GetProperty', 'Get Property')#
- KEY_PROVISIONING = (21, 'KeyProvisioning', 'Key Provisioning')#
- NO_COMMAND = (0, 'NoCommand', 'No Command')#
- READ_MEMORY = (3, 'ReadMemory', 'Read Memory')#
- RECEIVE_SB_FILE = (8, 'ReceiveSBFile', 'Receive SB File')#
- RELIABLE_UPDATE = (18, 'ReliableUpdate', 'Reliable Update')#
- RESET = (11, 'Reset', 'Reset MCU')#
- SET_PROPERTY = (12, 'SetProperty', 'Set Property')#
- TRUST_PROVISIONING = (22, 'TrustProvisioning', 'Trust Provisioning')#
- UPDATE_LIFE_CYCLE = (24, 'UpdateLifeCycle', 'Update Life Cycle')#
- WRITE_MEMORY = (4, 'WriteMemory', 'Write Memory')#
- class spsdk.mboot.commands.EL2GOCommandGroup(tag, label, description=None)#
Bases:
SpsdkEnumEL2GO command group enumeration for EdgeLock 2GO operations.
This enumeration defines the available command groups for EdgeLock 2GO trust provisioning operations including version retrieval, device closure, and batch trust provisioning workflows.
- EL2GO_BATCH_TP = (3, 'el2go_batch_tp', 'EL2GO Batch Trust Provisioning')#
- EL2GO_CLOSE_DEVICE = (2, 'el2go_close_device', 'EL2GO Close Device')#
- EL2GO_GET_FW_VERSION = (1, 'el2go_get_version', 'EL2GO Get Version')#
- class spsdk.mboot.commands.FlashReadOnceResponse(header, raw_data)#
Bases:
CmdResponseMcuBoot Flash Read Once response handler.
This class processes and manages response data from McuBoot Flash Read Once operations, parsing the response format and extracting length, values, and data fields for further processing.
Initialize the Flash-Read-Once response object.
Parses the raw response data to extract length and values from the Flash-Read-Once command. The method unpacks the response data and extracts the actual data bytes based on the length.
- Parameters:
header (
CmdHeader) – Header for the response containing command informationraw_data (
bytes) – Raw response data bytes to be parsed
- Raises:
struct.error – If raw_data cannot be unpacked according to expected format
- class spsdk.mboot.commands.FlashReadResourceResponse(header, raw_data)#
Bases:
CmdResponseMcuBoot flash read resource response.
This class represents the response format for flash read resource operations in McuBoot protocol, containing the response header and the length of the resource data that was read.
Initialize the Flash-Read-Resource response object.
- Parameters:
header (
CmdHeader) – Header for the responseraw_data (
bytes) – Response data containing length information
- class spsdk.mboot.commands.GenerateKeyBlobSelect(tag, label, description=None)#
Bases:
SpsdkEnumKey selector enumeration for generate-key-blob operations.
Defines available key sources for key blob generation on NXP devices. For devices with SNVS (Secure Non-Volatile Storage), supports OTPMK from FUSE/OTP, ZMK from SNVS, and CMK from SNVS. For devices without SNVS, the key selector is ignored and default behavior applies.
- CMK = (3, 'CMK', 'CMK from SNVS')#
- OPTMK = (0, 'OPTMK', 'OTPMK from FUSE or OTP(default)')#
- ZMK = (2, 'ZMK', 'ZMK from SNVS')#
- class spsdk.mboot.commands.GenericResponse(header, raw_data)#
Bases:
CmdResponseMcuBoot generic response format class.
This class represents a standard response format for McuBoot commands, providing parsing and display functionality for command responses that include status information and command tags.
Initialize the Generic response object.
- Parameters:
header (
CmdHeader) – Header for the responseraw_data (
bytes) – Response data containing command tag information
- class spsdk.mboot.commands.GetPropertyResponse(header, raw_data)#
Bases:
CmdResponseMcuBoot get property response format class.
This class represents a response from McuBoot get-property commands, handling the parsing and formatting of property values returned by the bootloader.
Initialize the Get-Property response object.
Parses the raw response data to extract property values from the mboot get-property command response.
- Parameters:
header (
CmdHeader) – Header for the response containing command informationraw_data (
bytes) – Raw response data bytes to be parsed for property values
- class spsdk.mboot.commands.KeyProvOperation(tag, label, description=None)#
Bases:
SpsdkEnumKey provisioning operation type enumeration.
This enumeration defines the available operations for key provisioning in SPSDK, including enrollment, key management, and storage operations.
- ENROLL = (0, 'Enroll', 'Enroll Operation')#
- READ_KEY_STORE = (6, 'ReadKeyStore', 'Read Key Store Operation')#
- READ_NON_VOLATILE = (4, 'ReadNonVolatile', 'Read Non Volatile Operation')#
- SET_INTRINSIC_KEY = (2, 'SetIntrinsicKey', 'Set Intrinsic Key Operation')#
- SET_USER_KEY = (1, 'SetUserKey', 'Set User Key Operation')#
- WRITE_KEY_STORE = (5, 'WriteKeyStore', 'Write Key Store Operation')#
- WRITE_NON_VOLATILE = (3, 'WriteNonVolatile', 'Write Non Volatile Operation')#
- class spsdk.mboot.commands.KeyProvUserKeyType(tag, label, description=None)#
Bases:
SpsdkEnumEnumeration of supported user keys in PUF for key provisioning operations.
This enumeration defines the various types of cryptographic keys that can be provisioned and managed through the Physical Unclonable Function (PUF). The availability of specific key types depends on the target SoC capabilities.
- OTFADKEK = (2, 'OTFADKEK', 'Key for OTFAD encryption')#
- PRINCE_REGION_0 = (7, 'PRINCE0', 'Key for Prince region 0')#
- PRINCE_REGION_1 = (8, 'PRINCE1', 'Key for Prince region 1')#
- PRINCE_REGION_2 = (9, 'PRINCE2', 'Key for Prince region 2')#
- PRINCE_REGION_3 = (10, 'PRINCE3', 'Key for Prince region 3')#
- SBKEK = (3, 'SBKEK', 'Key for SB file encryption')#
- UDS = (12, 'UDS', 'Universal Device Secret for DICE')#
- USERKEK = (11, 'USERKEK', 'Encrypted boot image key')#
- class spsdk.mboot.commands.KeyProvisioningResponse(header, raw_data)#
Bases:
CmdResponseMcuBoot Key Provisioning response format class.
Represents the response data structure returned from McuBoot key provisioning operations, including response header information and the length of provisioned key data.
Initialize the Key-Provisioning response object.
- Parameters:
header (
CmdHeader) – Header for the response.raw_data (
bytes) – Response data containing length information.
- class spsdk.mboot.commands.NoResponse(cmd_tag)#
Bases:
CmdResponseSPSDK MBoot NoResponse command representation.
This class represents a special internal case when no response is provided by the target device during MBoot communication. It extends CmdResponse to handle scenarios where the target fails to respond to issued commands.
Create a NoResponse to a command that was issued, indicated by its tag.
- Parameters:
cmd_tag (
int) – Tag of the command that preceded the no-response from target.
- class spsdk.mboot.commands.ReadMemoryResponse(header, raw_data)#
Bases:
CmdResponseMcuBoot read memory response format class.
This class represents the response format for read memory operations in McuBoot protocol, handling the parsing and representation of memory data returned from the target device.
Initialize the Read-Memory response object.
- Parameters:
header (
CmdHeader) – Header for the responseraw_data (
bytes) – Response data containing length information
- class spsdk.mboot.commands.ResponseTag(tag, label, description=None)#
Bases:
SpsdkEnumMcuBoot response tag enumeration.
This enumeration defines response tags used by McuBoot protocol to identify different types of responses returned by the target device. Each tag corresponds to a specific command response type with associated metadata including tag value, name, and description.
- FLASH_READ_ONCE = (175, 'FlashReadOnceResponse', 'Flash Read Once Response')#
- FLASH_READ_RESOURCE = (176, 'FlashReadResourceResponse', 'Flash Read Resource Response')#
- GENERIC = (160, 'GenericResponse', 'Generic Response')#
- GET_PROPERTY = (167, 'GetPropertyResponse', 'Get Property Response')#
- KEY_BLOB_RESPONSE = (179, 'CreateKeyBlobResponse', 'Create Key Blob')#
- KEY_PROVISIONING_RESPONSE = (181, 'KeyProvisioningResponse', 'Key Provisioning Response')#
- READ_MEMORY = (163, 'ReadMemoryResponse', 'Read Memory Response')#
- TRUST_PROVISIONING_RESPONSE = (182, 'TrustProvisioningResponse', 'Trust Provisioning Response')#
- class spsdk.mboot.commands.TrustProvDevHsmDsc(tag, label, description=None)#
Bases:
SpsdkEnumDSC Device HSM command enumeration for Trust Provisioning.
This enumeration defines the available HSM (Hardware Security Module) commands for DSC (Device Security Controller) operations in trust provisioning workflows. Each command represents a specific HSM operation with its corresponding command code and description.
- DSC_HSM_CREATE_SESSION = (100663296, 'dsc_hsm_create_session', 'DSC HSM create session')#
- DSC_HSM_ENC_BLK = (100663297, 'dsc_hsm_enc_blk', 'DSC HSM encrypt bulk')#
- DSC_HSM_ENC_SIGN = (100663298, 'dsc_hsm_enc_sign', 'DSC HSM sign')#
- class spsdk.mboot.commands.TrustProvKeyType(tag, label, description=None)#
Bases:
SpsdkEnumTrust Provisioning key type enumeration.
Defines the supported key types for trust provisioning operations in SPSDK, including cryptographic key derivation functions, message authentication codes, and encryption keys.
- AESK = (5, 'AESK', 'AES Key')#
- CKDFK = (1, 'CKDFK', 'CKDF Master Key')#
- CMACK = (4, 'CMACK', 'CMAC Key')#
- HKDFK = (2, 'HKDFK', 'HKDF Master Key')#
- HMACK = (3, 'HMACK', 'HMAC Key')#
- KUOK = (6, 'KUOK', 'Key Unwrap Only Key')#
- class spsdk.mboot.commands.TrustProvOemKeyType(tag, label, description=None)#
Bases:
SpsdkEnumTrustProv OEM key type enumeration.
This enumeration defines the various types of OEM keys used in Trust Provisioning operations, including manufacturing firmware signing keys, encryption keys, and master keys for key derivation functions.
- ENCKEY = (15525, 'ENCKEY', 'Generic Encryption Key')#
- GENSIGNK = (23100, 'GENSIGNK', 'Generic ECDSA Signing Key')#
- GETCUSTMKSK = (15450, 'GETCUSTMKSK', 'CKDF Master Key for Production Firmware Encryption Key')#
- MFWENCK = (42435, 'MFWENCK', 'CKDF Master Key for Manufacturing Firmware Encryption Key')#
- MFWISK = (50085, 'MFWISK', 'ECDSA Manufacturing Firmware Signing Key')#
- class spsdk.mboot.commands.TrustProvOperation(tag, label, description=None)#
Bases:
SpsdkEnumTrust Provisioning operation enumeration.
This enumeration defines all supported operations for the Trust Provisioning flow, including genuinity proving, wrapped data processing, key management, and DICE certificate operations for secure device provisioning.
- HSM_ENC_BLOCK = (5, 'HsmEncBlock', 'HSM Enc block')#
- HSM_ENC_SIGN = (6, 'HsnEncSign', 'HSM enc sign')#
- HSM_GEN_KEY = (3, 'HsmGenKey', 'HSM gen key')#
- HSM_STORE_KEY = (4, 'HsmStoreKey', 'HSM store key')#
- ISP_SET_WRAPPED_DATA = (240, 'SetWrappedData', 'Start processing Wrapped data')#
Type of trust provisioning operation.
- OEM_GEN_MASTER_SHARE = (0, 'OemGenMasterShare', 'Enroll Operation')#
- OEM_GET_CUST_CERT_DICE_PUK = (2, 'GetDiceCaPuk', 'Get DICE CA public key')#
- OEM_GET_CUST_DICE_RESPONSE = (7, 'GetDiceResponse', 'Get DICE response')#
- OEM_SET_MASTER_SHARE = (1, 'SetUserKey', 'Set User Key Operation')#
- PROVE_GENUINITY = (244, 'ProveGenuinity', 'Start the proving genuinity process')#
- PROVE_GENUINITY_HYBRID = (245, 'ProveGenuinityHybrid', 'Start the hybrid proving genuinity process')#
- class spsdk.mboot.commands.TrustProvWpc(tag, label, description=None)#
Bases:
SpsdkEnumWPC trusted facility command enumeration for DSC operations.
This enumeration defines the available commands for Wireless Power Consortium (WPC) trusted facility operations in Device Security Controller (DSC) context, including ID retrieval, certificate management, and certificate signing request operations.
- NXP_GET_ID = (83886081, 'nxp_get_id', 'NXP get ID')#
- WPC_GET_ID = (83886080, 'wpc_get_id', 'WPC get ID')#
- WPC_INSERT_CERT = (83886082, 'wpc_insert_cert', 'WPC insert certificate')#
- WPC_SIGN_CSR = (83886083, 'wpc_sign_csr', 'WPC sign CSR')#
- class spsdk.mboot.commands.TrustProvWrappingKeyType(tag, label, description=None)#
Bases:
SpsdkEnumTrust Provisioning wrapping key type enumeration.
Defines the available wrapping key types used in trust provisioning operations for wrapping MFG_CUST_MK_SK0_BLOB data.
- EXT_SK = (17, 'EXT_SK', 'The wrapping key for wrapping of MFG_CUST_MK_SK0_BLOB')#
- INT_SK = (16, 'INT_SK', 'The wrapping key for wrapping of MFG_CUST_MK_SK0_BLOB')#
- class spsdk.mboot.commands.TrustProvisioningResponse(header, raw_data)#
Bases:
CmdResponseMcuBoot Trust Provisioning response format class.
Handles response data from trust provisioning operations in McuBoot protocol, including parsing of response values and payload data extraction.
Initialize the Trust-Provisioning response object.
Parses the raw response data and extracts parameter values from the binary format.
- Parameters:
header (
CmdHeader) – Header for the response containing metadata and parameter count.raw_data (
bytes) – Response data in binary format to be unpacked.
- get_payload_data(offset=0)#
Get the payload from the response.
Converts response values to bytes starting from specified offset. Each value is converted to 4-byte little-endian format and concatenated.
- Parameters:
offset (
int) – Offset of integer unit in data to start conversion from.- Return type:
Optional[bytes]- Returns:
Concatenated bytes from response values, or None if insufficient data.
- spsdk.mboot.commands.parse_cmd_response(data, offset=0)#
Parse command response from raw data bytes.
The method parses the command header to identify the response type and creates the appropriate response object based on the tag. If the response type is not recognized, it returns a generic CmdResponse object.
- Parameters:
data (
bytes) – Input data in bytes containing the command responseoffset (
int) – The offset position in input data to start parsing from
- Return type:
- Returns:
Parsed command response object of appropriate type
MBoot Properties#
SPSDK MBoot device properties management and interpretation utilities.
This module provides comprehensive functionality for handling and interpreting target device properties in the MBoot context. It includes property definitions, value parsing, formatting utilities, and human-readable representations of device characteristics such as available peripherals, memory attributes, and security features.
- class spsdk.mboot.properties.AvailableCommandsValue(prop, raw_values)#
Bases:
PropertyValueBaseAvailable commands property value container.
This class represents and manages the available commands property from MCU bootloader, providing methods to check command availability and convert the bitmask value into human-readable command lists.
Initialize the AvailableCommands-based property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the property
- property tags: list[int]#
Get list of command tags for available commands.
Returns a list of integer tags representing commands that are available based on the current property value. Each bit in the property value corresponds to a specific command tag.
- Returns:
List of integer command tags for available commands.
- to_str()#
Get stringified property representation.
Converts the property value to a list of command tag labels that correspond to the bits set in the property value.
- Return type:
str- Returns:
List of command tag labels for bits set in the property value.
- value#
- class spsdk.mboot.properties.AvailablePeripheralsValue(prop, raw_values)#
Bases:
PropertyValueBaseAvailable Peripherals property value container.
This class represents and manages the available peripherals property value, providing methods to convert the raw peripheral data into integer and human-readable string formats with peripheral names.
Initialize the AvailablePeripherals-based property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the property
- to_int()#
Get the raw integer portion of the property.
- Return type:
int- Returns:
The integer value of the property.
- to_str()#
Get stringified property representation.
Converts the property value to a human-readable string by extracting and joining the labels of all peripheral tags that match the property’s bit flags.
- Return type:
str- Returns:
Comma-separated string of peripheral tag labels that are set in the property value.
- value#
- class spsdk.mboot.properties.BoolValue(prop, raw_values, true_values=(1,), true_string='YES', false_values=(0,), false_string='NO')#
Bases:
PropertyValueBaseBoolean property value representation for SPSDK device properties.
This class handles boolean-based property values with customizable true/false representations, allowing flexible interpretation of raw integer values as boolean states with configurable string representations.
Initialize the Boolean-based property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the propertytrue_values (
tuple[int]) – Values representing ‘True’, defaults to (1,)true_string (
str) – String representing ‘True’, defaults to ‘YES’false_values (
tuple[int]) – Values representing ‘False’, defaults to (0,)false_string (
str) – String representing ‘False’, defaults to ‘NO’
- to_int()#
Get the raw integer portion of the property.
- Return type:
int- Returns:
The integer value of the property.
- to_str()#
Get stringified property representation.
Converts the boolean property value to its string representation based on the configured true/false string values.
- Return type:
str- Returns:
String representation of the property value.
- value#
- class spsdk.mboot.properties.DeviceUidValue(prop, raw_values)#
Bases:
PropertyValueBaseDevice UID value property representation.
This class handles device unique identifier values from MCU properties, providing conversion methods to different formats including integer and hexadecimal string representations.
Initialize the Version-based property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the property
- to_int()#
Get the raw integer portion of the property.
Converts the property value bytes to an integer using big-endian byte order.
- Return type:
int- Returns:
Integer representation of the property value.
- to_str()#
Get stringified property representation.
Converts the property value to a hexadecimal string representation where each byte is formatted as a two-digit lowercase hexadecimal value.
- Return type:
str- Returns:
Hexadecimal string representation of the property value.
- value#
- class spsdk.mboot.properties.EnumValue(prop, raw_values, enum, na_msg='Unknown Item')#
Bases:
PropertyValueBaseProperty value wrapper for enumeration-based data.
This class represents a property value that maps raw integer data to enumeration labels, providing both numeric and string representations of the property value with fallback handling for unknown values.
Initialize the enumeration-based property object.
- Parameters:
prop (
PropertyTag) – Property tag, see PropertyTag enum.raw_values (
list[int]) – List of integers representing the property values.enum (
Type[SpsdkEnum]) – Enumeration class to pick property values from.na_msg (
str) – Message to display if an item is not found in the enum.
- enum#
- to_int()#
Get the raw integer portion of the property.
- Return type:
int- Returns:
The integer value of the property.
- to_str()#
Get stringified property representation.
Converts the property value to its string representation using the associated enum label. If the enum label is not found, returns a formatted string with the raw value.
- Return type:
str- Returns:
String representation of the property value or formatted error message.
- Raises:
SPSDKKeyError – When enum label cannot be found for the property value.
- value#
- class spsdk.mboot.properties.ExternalMemoryAttributesValue(prop, raw_values, mem_id=0)#
Bases:
PropertyValueBaseExternal memory attributes property value container.
This class represents and manages attribute information for external memories in SPSDK bootloader operations, including memory geometry parameters such as start address, total size, page size, sector size, and block size.
Initialize the ExternalMemoryAttributes-based property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the propertymem_id (
int) – ID of the external memory
- block_size#
- mem_id#
- page_size#
- sector_size#
- start_address#
- to_str()#
Get stringified property representation.
Formats the property object into a human-readable string containing available property information such as start address, total size, page size, sector size, and block size.
- Return type:
str- Returns:
Comma-separated string of formatted property values.
- total_size#
- value#
- class spsdk.mboot.properties.FlashReadMargin(tag, label, description=None)#
Bases:
SpsdkEnumFlash read margin enumeration for memory operations.
This enumeration defines the different margin levels used when reading flash memory to verify data integrity under various conditions.
- Variables:
NORMAL – Standard read margin for normal operation.
USER – User-defined read margin level.
FACTORY – Factory-set read margin for production testing.
- FACTORY = (2, 'FACTORY')#
- NORMAL = (0, 'NORMAL')#
- USER = (1, 'USER')#
- class spsdk.mboot.properties.FuseLock(index, locked)#
Bases:
objectFuse Lock representation for MCU OTP (One-Time Programmable) memory.
This class represents the lock status of individual fuses in the MCU’s OTP memory, providing information about whether a specific fuse index is locked or unlocked.
Initialize object representing information about fuse lock.
- Parameters:
index (
int) – Value of OTP index.locked (
bool) – Status of the lock, true if locked.
- class spsdk.mboot.properties.FuseLockRegister(value, index, start=0)#
Bases:
objectOTP Controller Fuse Lock Register representation.
This class represents a fuse lock register from the OTP (One-Time Programmable) controller, providing access to individual fuse lock status bits and their formatted representation.
Initialize object representing the OTP Controller Program Locked Status.
Creates bitfields for each fuse position from the start index to bit 31, indicating whether each fuse is locked based on the register value.
- Parameters:
value (
int) – Value of the register containing lock status bits.index (
int) – Base index of the fuse register.start (
int) – Bit position to start processing from (default is 0).
- class spsdk.mboot.properties.FuseLockedStatus(prop, raw_values)#
Bases:
PropertyValueBaseSPSDK Fuse Locked Status Property.
This class represents and manages the locked status of OTP (One-Time Programmable) fuses in NXP MCU devices. It processes raw register values and provides structured access to individual fuse lock states through register and bitfield representations.
Initialize the FuseLockedStatus property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the property
-
fuses:
list[FuseLockRegister]#
- get_fuses()#
Get list of fuses bitfield objects.
The method iterates through all fuse registers and extracts their bitfield objects into a single flat list.
- Return type:
list[FuseLock]- Returns:
List of FuseLockBitfield objects from all fuse registers.
- to_str()#
Get stringified property representation.
Converts the OTP Controller Program Locked Status registers to a formatted string representation showing each register’s status with its index.
- Return type:
str- Returns:
Formatted string containing all OTP Controller Program Locked Status registers with their respective indices.
- class spsdk.mboot.properties.IntListValue(prop, raw_values, str_format='hex', delimiter=', ')#
Bases:
PropertyValueBaseProperty value container for lists of integers.
This class represents a property value that contains a list of integer values, providing formatted string representation with configurable display format and delimiter options for the integer list elements.
Initialize the integer-list-based property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the propertystr_format (
str) – Format to display the value (‘dec’, ‘hex’, ‘size’)delimiter (
str) – Delimiter for values in a list
- delimiter#
- to_str()#
Get stringified property representation.
Converts the property values to a formatted string representation using the configured format and delimiter.
- Return type:
str- Returns:
String representation of property values in format “[value1,value2,…]”.
- value#
- class spsdk.mboot.properties.IntValue(prop, raw_values, str_format='dec')#
Bases:
PropertyValueBaseInteger-based property value representation.
This class handles integer property values from MCU boot properties, providing formatted string representation and raw integer access with support for decimal, hexadecimal, and size formatting options.
Initialize the integer-based property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the propertystr_format (
str) – Format to display the value (‘dec’, ‘hex’, ‘size’)
- to_int()#
Get the raw integer property representation.
- Return type:
int- Returns:
Integer value of the property.
- to_str()#
Get stringified property representation.
Converts the property value to a formatted string representation using the internal format specification.
- Return type:
str- Returns:
Formatted string representation of the property value.
- value#
- class spsdk.mboot.properties.IrqNotifierPinValue(prop, raw_values)#
Bases:
PropertyValueBaseIRQ notifier pin property value container.
This class represents and manages IRQ (Interrupt Request) notifier pin configuration data, providing access to pin number, port number, and enablement status from raw property values.
Initialize the IrqNotifierPin-based property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the property
- property enabled: bool#
Indicates whether IRQ reporting is enabled.
- Returns:
True if IRQ reporting is enabled, False otherwise.
- property pin: int#
Get the pin number used for reporting IRQ.
Extracts the pin number from the lower 8 bits of the value.
- Returns:
Pin number (0-255) used for IRQ reporting.
- property port: int#
Get the port number used for reporting IRQ.
Extracts the port number from bits 8-15 of the property value using bitwise operations to isolate the relevant byte.
- Returns:
Port number as an integer value (0-255).
- to_str()#
Get stringified property representation.
- Return type:
str- Returns:
String representation of the IRQ port property including port, pin, and enabled status.
- value#
- class spsdk.mboot.properties.PeripheryTag(tag, label, description=None)#
Bases:
SpsdkEnumEnumeration of peripheral interface tags for bootloader communication.
This class defines standardized tags that identify different peripheral interfaces supported by the bootloader for communication with the host. Each tag contains a numeric identifier, short name, and descriptive label for the corresponding peripheral interface type.
- CAN = (8, 'CAN', 'CAN Interface')#
- I2C_SLAVE = (2, 'I2C-Slave', 'I2C Slave Interface')#
- LIN = (128, 'LIN', 'LIN Interface')#
- SPI_SLAVE = (4, 'SPI-Slave', 'SPI Slave Interface')#
- UART = (1, 'UART', 'UART Interface')#
- USB_CDC = (32, 'USB-CDC', 'USB CDC-Class Interface')#
- USB_DFU = (64, 'USB-DFU', 'USB DFU-Class Interface')#
- USB_HID = (16, 'USB-HID', 'USB HID-Class Interface')#
- class spsdk.mboot.properties.PfrKeystoreUpdateOpt(tag, label, description=None)#
Bases:
SpsdkEnumPFR keystore update operation options enumeration.
This enumeration defines the available options for updating PFR (Protected Flash Region) keystore operations, specifying different methods for provisioning and memory operations.
- KEY_PROVISIONING = (0, 'KEY_PROVISIONING', 'KeyProvisioning')#
- WRITE_MEMORY = (1, 'WRITE_MEMORY', 'WriteMemory')#
- class spsdk.mboot.properties.PropertyTag(value)#
Bases:
EnumMcuBoot property tag enumeration.
This enumeration defines all available property tags that can be queried from McuBoot-enabled devices. Each property represents a specific device characteristic such as flash memory attributes, RAM configuration, security state, or bootloader capabilities. The enumeration provides multiple representations for each property including internal labels, CLI-friendly names, and human-readable descriptions.
- AVAILABLE_COMMANDS = ('AvailableCommands', 'available-commands', 'Available Commands')#
- AVAILABLE_PERIPHERALS = ('AvailablePeripherals', 'available-peripherals', 'Available Peripherals')#
- BOOT_STATUS_REGISTER = ('BootStatusRegister', 'boot-status', 'Boot Status Register')#
- BYTE_WRITE_TIMEOUT_MS = ('ByteWriteTimeoutMs', 'byte-write-timeout-ms', 'Byte Write Timeout in ms')#
- CRC_CHECK_STATUS = ('CrcCheckStatus', 'check-status', 'CRC Check Status')#
- CURRENT_VERSION = ('CurrentVersion', 'current-version', 'Current Version')#
- EXTERNAL_MEMORY_ATTRIBUTES = ('ExternalMemoryAttributes', 'external-memory-attributes', 'External Memory Attributes')#
- FIRMWARE_VERSION = ('FirmwareVersion', 'loadable-fw-version', 'Firmware Version')#
- FLASH_ACCESS_SEGMENT_COUNT = ('FlashAccessSegmentCount', 'flash-access-segment-count', 'Flash Access Segment Count')#
- FLASH_ACCESS_SEGMENT_SIZE = ('FlashAccessSegmentSize', 'flash-access-segment-size', 'Flash Access Segment Size')#
- FLASH_BLOCK_COUNT = ('FlashBlockCount', 'flash-block-count', 'Flash Block Count')#
- FLASH_FAC_SUPPORT = ('FlashFacSupport', 'flash-fac-support', 'Flash Fac. Support')#
- FLASH_PAGE_SIZE = ('FlashPageSize', 'flash-page-size', 'Flash Page Size')#
- FLASH_READ_MARGIN = ('FlashReadMargin', 'flash-read-margin', 'Flash Read Margin')#
- FLASH_SECTOR_SIZE = ('FlashSectorSize', 'flash-sector-size', 'Flash Sector Size')#
- FLASH_SECURITY_STATE = ('FlashSecurityState', 'security-state', 'Security State')#
- FLASH_SIZE = ('FlashSize', 'flash-size-in-bytes', 'Flash Size')#
- FLASH_START_ADDRESS = ('FlashStartAddress', 'flash-start-address', 'Flash Start Address')#
- FUSE_LOCKED_STATUS = ('FuseLockedStatus', 'fuse-locked-status', 'Fuse Locked Status')#
- FUSE_PROGRAM_VOLTAGE = ('FuseProgramVoltage', 'fuse-program-voltage', 'Fuse Program Voltage')#
- IRQ_NOTIFIER_PIN = ('IrqNotifierPin', 'irq-notify-pin', 'Irq Notifier Pin')#
- LAST_ERROR = ('LastError', 'reserved', 'Last Error Value')#
- LIFE_CYCLE_STATE = ('LifeCycleState', 'life-cycle', 'Life Cycle State')#
- LIST_PROPERTIES = ('ListProperties', 'list-properties', 'List Properties')#
- MAX_PACKET_SIZE = ('MaxPacketSize', 'max-packet-size', 'Max Packet Size')#
- PFR_KEYSTORE_UPDATE_OPT = ('PfrKeystoreUpdateOpt', 'pfr-keystore-update-opt', 'PFR Keystore Update Opt')#
- QSPI_INIT_STATUS = ('QspiInitStatus', 'qspi/otfad-init-status', 'QuadSPI Initialization Status')#
- RAM_SIZE = ('RamSize', 'ram-size-in-bytes', 'RAM Size')#
- RAM_START_ADDRESS = ('RamStartAddress', 'ram-start-address', 'RAM Start Address')#
- RELIABLE_UPDATE_STATUS = ('ReliableUpdateStatus', 'reliable-update-status', 'Reliable Update Status')#
- RESERVED_REGIONS = ('ReservedRegions', 'reserved-regions', 'Reserved Regions')#
- SHE_BOOT_MODE = ('SheBootMode', 'she-boot-mode', 'Secure Hardware Extension: Boot Mode')#
- SHE_FLASH_PARTITION = ('SheFlashPartition', 'she-flash-partition', 'Secure Hardware Extension: Flash Partition')#
- SYSTEM_DEVICE_IDENT = ('SystemDeviceIdent', 'system-device-id', 'System Device Identification')#
- TARGET_VERSION = ('TargetVersion', 'target-version', 'Target Version')#
- UNIQUE_DEVICE_IDENT = ('UniqueDeviceIdent', 'unique-device-id', 'Unique Device Identification')#
- UNKNOWN = ('Unknown', 'unknown', 'Unknown property')#
- VALIDATE_REGIONS = ('ValidateRegions', 'reserved_1', 'Validate Regions')#
- VERIFY_ERASE = ('VerifyErase', 'verify-erase', 'Verify Erase')#
- VERIFY_WRITES = ('VerifyWrites', 'verify-writes', 'Verify Writes')#
- property description: str#
Get the description of the property tag.
- Returns:
Description string of the property tag.
- property friendly_name: str#
Get the friendly name of the property tag.
- Returns:
The human-readable name associated with this property tag.
- classmethod from_index(index, family=None)#
Convert property index to its corresponding PropertyTag.
The method searches through available properties for the given family and returns the PropertyTag that matches the specified index.
- Parameters:
index (
int) – Property index to search for.family (
Optional[FamilyRevision]) – Device family to get properties from, defaults to None.
- Return type:
- Returns:
The matching PropertyTag instance.
- Raises:
SPSDKError – If no matching PropertyTag is found for the given index.
- classmethod from_name(name)#
Convert a name to its corresponding PropertyTag.
Searches through all PropertyTag members to find a match based on either the label or friendly_name attribute.
- Parameters:
name (
str) – The name to convert (label or friendly_name).- Return type:
Self- Returns:
The matching PropertyTag instance.
- Raises:
SPSDKValueError – If no matching PropertyTag is found.
- property label: str#
Get the internal name of the property tag.
- Returns:
Internal name of the property tag.
- class spsdk.mboot.properties.PropertyValueBase(prop, name=None, desc=None)#
Bases:
objectBase class for property value representation in SPSDK.
This class provides a foundation for handling property values with associated metadata including property tags, names, and descriptions. Derived classes must implement the to_str() method to provide specific string representations of their property values.
Initialize the base of property.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagname (
Optional[str]) – Optional name for the propertydesc (
Optional[str]) – Optional description for the property
- desc#
- name#
- prop#
- property tag: int#
Get the property tag index.
- Returns:
Integer index representing the property tag.
- to_str()#
Convert property value to string representation.
This is an abstract method that must be implemented by derived classes to provide a human-readable string format of the property value.
- Return type:
str- Returns:
String representation of the property value.
- Raises:
NotImplementedError – Derived class has to implement this method.
- class spsdk.mboot.properties.ReservedRegionsValue(prop, raw_values)#
Bases:
PropertyValueBaseReserved Regions property value container.
This class represents and manages reserved memory regions property data, parsing raw integer values into structured memory region objects for easier access and manipulation.
Initialize the ReserverRegion-based property object.
Creates memory regions from raw integer values, filtering out regions with zero size.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the property in pairs (address, size)
-
regions:
list[MemoryRegion]#
- to_str()#
Get stringified property representation.
Converts the regions collection into a formatted multi-line string where each region is numbered and displayed on a separate line with proper indentation.
- Return type:
str- Returns:
Multi-line string representation of all regions with numbering and indentation.
- class spsdk.mboot.properties.SHEBootMode(prop, raw_values)#
Bases:
PropertyValueBaseSHE Boot Mode property representation for SPSDK mboot operations.
This class handles the parsing and formatting of SHE (Secure Hardware Extension) boot mode properties, extracting boot mode type and boot size information from raw property values. The class provides human-readable formatting of boot mode configurations including strict, serial, parallel, and undefined boot modes.
Initialize the SHE Boot Mode property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the property
- mode#
- size#
- to_str()#
Get stringified property representation.
Converts the SHE (Secure Hardware Extension) boot property into a human-readable string format showing boot mode and size information.
- Return type:
str- Returns:
Formatted string containing SHE boot mode and size details.
- class spsdk.mboot.properties.SHEFlashPartition(prop, raw_values)#
Bases:
PropertyValueBaseSHE Flash Partition property representation for SPSDK mboot operations.
This class handles the parsing and formatting of SHE (Secure Hardware Extension) flash partition properties, including maximum key capacity and flash size configuration for CSEc (Cryptographic Services Engine compact) operations.
Initialize the SHE Flash Partition property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the property
- flash_size#
- max_keys#
- to_str()#
Get stringified property representation.
Converts the property values into a human-readable string format that displays EEPROM flash size and maximum keys configuration.
- Return type:
str- Returns:
Formatted string containing flash size and maximum keys information.
- class spsdk.mboot.properties.Version(*args, **kwargs)#
Bases:
objectMcuBoot version representation and management.
This class provides version handling for McuBoot operations, supporting version parsing from string and integer formats, version comparison operations, and conversion between different version representations. The version consists of mark, major, minor, and fixation components.
Initialize the Version object.
Creates a Version object from either an integer or string representation, or from individual version components passed as keyword arguments.
- Parameters:
args (
Union[str,int]) – Version data as integer or string representationkwargs (
int) – Individual version components (mark, major, minor, fixation)
- Raises:
McuBootError – When argument is neither string nor integer type
- from_int(value)#
Parse version data from raw integer value.
Extracts version components (mark, major, minor, fixation) from a 32-bit integer where each component occupies 8 bits. The mark is converted to ASCII character if it represents a valid uppercase letter (A-Z).
- Parameters:
value (
int) – Raw 32-bit integer containing packed version information- Return type:
None
- from_str(value)#
Parse version data from string value.
The method parses a version string in format “X.Y.Z” or “MX.Y.Z” where M is a mark character, X is major version, Y is minor version, and Z is fixation version.
- Parameters:
value (
str) – String representation of version in format “X.Y.Z” or “MX.Y.Z”- Raises:
ValueError – Invalid version string format or non-numeric version components
- Return type:
None
- to_int(no_mark=False)#
Get version value in raw integer format.
The method combines major, minor, and fixation version components into a single integer value. Optionally includes a character mark in the most significant byte.
- Parameters:
no_mark (
bool) – If True, return value without mark component.- Return type:
int- Returns:
Integer representation of the version with optional mark.
- to_str(no_mark=False)#
Get version value in readable string format.
- Parameters:
no_mark (
bool) – If True, return value without mark.- Return type:
str- Returns:
String representation of the version.
- class spsdk.mboot.properties.VersionValue(prop, raw_values)#
Bases:
PropertyValueBaseSPSDK property value container for version information.
This class represents a property value that contains version data, providing methods to access and format version information as both integer and string representations.
Initialize the Version-based property object.
- Parameters:
prop (
PropertyTag) – Property tag, see: PropertyTagraw_values (
list[int]) – List of integers representing the property
- to_int()#
Get the raw integer portion of the property.
- Return type:
int- Returns:
The integer value of the property.
- to_str()#
Get stringified property representation.
- Return type:
str- Returns:
String representation of the property value.
- value#
- spsdk.mboot.properties.get_properties(family=None)#
Get all properties including family specific properties if family defined.
This method retrieves common property indexes and optionally merges them with family-specific overridden properties from the database if a family is specified.
- Parameters:
family (
Optional[FamilyRevision]) – Optional family revision to get specific properties for.- Raises:
SPSDKValueError – When family has no blhost support defined in database.
- Return type:
dict[int,PropertyTag]- Returns:
Dictionary mapping property indexes to PropertyTag objects.
- spsdk.mboot.properties.get_property_index(prop, family=None)#
Get index of given property.
Retrieves the numeric index for a property, either by returning the integer directly or by looking up the PropertyTag in the family-specific properties dictionary.
- Parameters:
prop (
Union[PropertyTag,int]) – Property tag or integer index to look up.family (
Optional[FamilyRevision]) – Optional family revision to get properties for specific MCU family.
- Raises:
SPSDKError – When the property tag is not found in the properties dictionary.
- Return type:
int- Returns:
Numeric index of the property.
- spsdk.mboot.properties.get_property_tag_label(mboot_property, family=None)#
Get property tag and label from property identifier.
Converts property identifier (either PropertyTag enum or integer) to a tuple containing the property index and its human-readable label. For unknown integer properties, returns “Unknown” as the label.
- Parameters:
mboot_property (
Union[PropertyTag,int]) – Property identifier as PropertyTag enum or integer value.family (
Optional[FamilyRevision]) – Optional family revision for property lookup context.
- Return type:
tuple[int,str]- Returns:
Tuple containing property index (int) and property label (str).
- spsdk.mboot.properties.int_fmt(value, format_str)#
Format integer value to string representation based on specified format.
Converts an integer value to its string representation using various formatting options including size formatting, hexadecimal, decimal, signed 32-bit integer, or custom format strings.
- Parameters:
value (
int) – Integer value to be formatted.format_str (
str) – Format specification - ‘size’, ‘hex’, ‘dec’, ‘int32’, or custom format.
- Return type:
str- Returns:
Formatted string representation of the integer value.
- spsdk.mboot.properties.parse_property_value(property_tag, raw_values, ext_mem_id=None, family=None)#
Parse the property value received from the device.
The method converts raw property data from device into a structured property object. It handles property tag conversion and applies family-specific configurations.
- Parameters:
property_tag (
Union[int,PropertyTag]) – Tag representing the property, either as integer or PropertyTag enum.raw_values (
list[int]) – List of integer values received from the device.ext_mem_id (
Optional[int]) – ID of the external memory used to read the property, defaults to None.family (
Optional[FamilyRevision]) – Supported family revision for property parsing, defaults to None.
- Return type:
Optional[PropertyValueBase]- Returns:
Object representing the parsed property or None if parsing fails.
- spsdk.mboot.properties.size_fmt(value, kibibyte=True)#
Convert size value into human-readable string format.
Converts a numeric size value (in bytes) into a formatted string with appropriate unit suffix (B, kB/kiB, MB/MiB, etc.) for better readability.
- Parameters:
value (
Union[int,float]) – The raw size value in bytes to be converted.kibibyte (
bool) – True for binary units (1024 bytes = 1 kiB), False for decimal units (1000 bytes = 1 kB).
- Return type:
str- Returns:
Human-readable size string with value and unit suffix.
External Memories#
SPSDK MBoot memory management and identification utilities.
This module provides comprehensive memory handling functionality for the MBoot protocol, including memory region definitions, memory identifiers, and property management for different types of memory devices such as RAM, Flash, and external memory.
- class spsdk.mboot.memories.ExtMemId(tag, label, description=None)#
Bases:
MemIdEnumMcuBoot External Memory Property Tags.
Enumeration of external memory identifiers used by McuBoot for memory property operations and configuration. Each memory type is defined with a unique ID, short name, and descriptive name for various external memory interfaces including SPI, SEMC, Flash, NAND, and card-based storage systems.
- FLASH_EXEC_ONLY = (16, 'FLASH-EXEC', 'Execute-Only region on internal Flash')#
- FLEX_SPI_NOR = (9, 'FLEX-SPI-NOR', 'Flex SPI NOR Memory')#
- FUSE = (4, 'FUSE', 'Nonvolatile information register 0 (only used by SB loader)')#
- I2C_NOR_EEPROM = (273, 'I2C-MEM', 'I2C NOR/EEPROM Memory')#
- IFR = (4, 'IFR0', 'Nonvolatile information register 0 (only used by SB loader)')#
- MMC_CARD = (289, 'MMC', 'MMC/eMMC Memory Card')#
- QUAD_SPI0 = (1, 'QSPI', 'Quad SPI Memory 0')#
- SD_CARD = (288, 'SD', 'eSD/SD/SDHC/SDXC Memory Card')#
- SEMC_NAND = (256, 'SEMC-NAND', 'SEMC NAND Memory')#
- SEMC_NOR = (8, 'SEMC-NOR', 'SEMC NOR Memory')#
- SPIFI_NOR = (10, 'SPIFI-NOR', 'SPIFI NOR Memory')#
- SPI_NAND = (257, 'SPI-NAND', 'SPI NAND Memory')#
- SPI_NOR_EEPROM = (272, 'SPI-MEM', 'SPI NOR/EEPROM Memory')#
- XSPI_NOR = (11, 'XSPI-NOR', 'XSPI NOR Memory')#
- class spsdk.mboot.memories.ExtMemPropTags(tag, label, description=None)#
Bases:
SpsdkEnumMcuBoot External Memory Property Tags.
Enumeration defining property tags used to identify and configure external memory characteristics in McuBoot operations. These tags specify memory attributes such as initialization status, addressing, and block organization parameters.
- BLOCK_SIZE = (16, 'BLOCK_SIZE')#
- INIT_STATUS = (0, 'INIT_STATUS')#
- PAGE_SIZE = (4, 'PAGE_SIZE')#
- SECTOR_SIZE = (8, 'SECTOR_SIZE')#
- SIZE_IN_KBYTES = (2, 'SIZE_IN_KBYTES')#
- START_ADDRESS = (1, 'START_ADDRESS')#
- class spsdk.mboot.memories.ExtMemRegion(mem_id, raw_values=None)#
Bases:
MemoryRegionExternal memory region representation for SPSDK memory operations.
This class represents and manages external memory regions with their properties including start address, size information, and block characteristics. It parses raw memory property values and provides formatted access to external memory configuration data.
Initialize the external memory region object.
Parses raw property values to extract memory characteristics like start address, total size, page size, sector size, and block size based on property tags.
- Parameters:
mem_id (
int) – ID of the external memoryraw_values (
Optional[list[int]]) – List of integers representing the memory properties, where first element contains property tags and subsequent elements contain corresponding values
- property name: str#
Get the name of external memory for given memory ID.
- Returns:
Name of the external memory as a string label.
- class spsdk.mboot.memories.FlashRegion(index, start, size, sector_size)#
Bases:
MemoryRegionFlash memory region representation for SPSDK memory operations.
This class extends MemoryRegion to provide flash-specific functionality including sector size management and region indexing for flash memory operations.
Initialize the Flash memory region object.
- Parameters:
index (
int) – Number of the memory region.start (
int) – Start address of the memory region.size (
int) – Size of the memory region in bytes.sector_size (
int) – Size of the sector in bytes.
- class spsdk.mboot.memories.MemId(tag, label, description=None)#
Bases:
MemIdEnumMcuBoot Memory Identifier Enumeration.
This enumeration defines memory property tags used by McuBoot for identifying and accessing different types of internal and external memory devices including Flash, RAM, QSPI, SEMC, and various storage interfaces.
- FLASH_EXEC_ONLY = (16, 'FLASH-EXEC', 'Execute-Only region on internal Flash')#
- FLEX_SPI_NOR = (9, 'FLEX-SPI-NOR', 'Flex SPI NOR Memory')#
- FUSE = (4, 'FUSE', 'Nonvolatile information register 0 (only used by SB loader)')#
- I2C_NOR_EEPROM = (273, 'I2C-MEM', 'I2C NOR/EEPROM Memory')#
- IFR = (4, 'IFR0', 'Nonvolatile information register 0 (only used by SB loader)')#
- INTERNAL_MEMORY = (0, 'RAM/FLASH', 'Internal RAM/FLASH (Used for the PRINCE configuration)')#
- MMC_CARD = (289, 'MMC', 'MMC/eMMC Memory Card')#
- QUAD_SPI0 = (1, 'QSPI', 'Quad SPI Memory 0')#
- SD_CARD = (288, 'SD', 'eSD/SD/SDHC/SDXC Memory Card')#
- SEMC_NAND = (256, 'SEMC-NAND', 'SEMC NAND Memory')#
- SEMC_NOR = (8, 'SEMC-NOR', 'SEMC NOR Memory')#
- SPIFI_NOR = (10, 'SPIFI-NOR', 'SPIFI NOR Memory')#
- SPI_NAND = (257, 'SPI-NAND', 'SPI NAND Memory')#
- SPI_NOR_EEPROM = (272, 'SPI-MEM', 'SPI NOR/EEPROM Memory')#
- class spsdk.mboot.memories.MemIdEnum(tag, label, description=None)#
Bases:
SpsdkEnumMcuBoot Memory Identifier Enumeration.
This enumeration class manages memory identifiers for McuBoot operations, providing conversion utilities between legacy and current memory ID formats. The class supports bidirectional mapping between string and integer representations of memory identifiers.
- classmethod get_legacy_int(key)#
Convert legacy integer memory ID to corresponding enum key string.
This method takes a legacy integer memory identifier and converts it to the corresponding string key used in the new enum system by looking up the mapping in LEGACY_MEM_ID dictionary.
- Parameters:
key (
int) – Legacy integer memory identifier to convert.- Return type:
Optional[str]- Returns:
String key corresponding to the legacy memory ID, or None if not found.
- classmethod get_legacy_str(key)#
Convert legacy string identifier to corresponding memory tag value.
This method looks up a legacy memory identifier string in the conversion table and returns the corresponding new enum tag value if found.
- Parameters:
key (
str) – Legacy memory identifier string to convert- Return type:
Optional[int]- Returns:
Memory tag value as integer if conversion successful, None if key not found
- class spsdk.mboot.memories.MemoryRegion(start, end)#
Bases:
objectMemory region representation for MCU memory management.
This class represents a contiguous memory region with defined start and end addresses, providing basic memory region operations and formatting for SPSDK memory management operations.
Initialize the memory region object.
- Parameters:
start (
int) – Start address of region.end (
int) – End address of region.
- class spsdk.mboot.memories.RamRegion(index, start, size)#
Bases:
MemoryRegionRAM memory region representation for SPSDK memory operations.
This class represents a specific RAM memory region with indexed identification, extending the base MemoryRegion functionality to provide RAM-specific memory management capabilities for bootloader operations.
Initialize the RAM memory region object.
- Parameters:
index (
int) – Number of region.start (
int) – Start address of region.size (
int) – Size of region in bytes.
MBoot ErrorCodes#
SPSDK MBoot protocol status and error codes.
This module defines status codes and error handling utilities for the MBoot protocol communication, providing enumeration of possible response codes and string conversion functionality.
- class spsdk.mboot.error_codes.StatusCode(tag, label, description=None)#
Bases:
SpsdkEnumMcuBoot status codes enumeration.
This enumeration defines all possible status codes returned by McuBoot operations, including general operation results and specific flash driver error conditions. Each status code contains a numeric value, string identifier, and human-readable description for comprehensive error reporting and debugging.
- ABORT_DATA_PHASE = (10002, 'AbortDataPhase', 'Abort Data Phase')#
- APP_CRC_CHECK_FAILED = (10401, 'AppCrcCheckFailed', 'Application: CRC Check: Failed')#
- APP_CRC_CHECK_INACTIVE = (10402, 'AppCrcCheckInactive', 'Application CRC Check: Inactive')#
- APP_CRC_CHECK_INVALID = (10403, 'AppCrcCheckInvalid', 'Application CRC Check: Invalid')#
- APP_CRC_CHECK_OUT_OF_RANGE = (10404, 'AppCrcCheckOutOfRange', 'Application CRC Check: Out Of Range')#
- APP_CRC_CHECK_PASSED = (10400, 'AppCrcCheckPassed', 'Application CRC Check: Passed')#
- EDGELOCK_ABORT = (30002, 'EDGELOCK_Abort', 'EDGELOCK: Abort')#
- EDGELOCK_INVALID_LIFECYCLE = (30007, 'EDGELOCK_InvalidLifecycle', 'EDGELOCK: Invalid Lifecycle')#
- EDGELOCK_INVALID_RESPONSE = (30000, 'EDGELOCK_InvalidResponse', 'EDGELOCK: Invalid Response')#
- EDGELOCK_OPERATION_FAILED = (30003, 'EDGELOCK_OperationFailed', 'EDGELOCK: Operation Failed')#
- EDGELOCK_OTP_INVALID_IDX = (30006, 'EDGELOCK_OTPInvalidIDX', 'EDGELOCK: OTP Invalid IDX')#
- EDGELOCK_OTP_LOCKED = (30005, 'EDGELOCK_OTPLocked', 'EDGELOCK: OTP Locked')#
- EDGELOCK_OTP_PROGRAM_FAILURE = (30004, 'EDGELOCK_OTPProgramFailure', 'EDGELOCK: OTP Program Failure')#
- EDGELOCK_RESPONSE_ERROR = (30001, 'EDGELOCK_ResponseError', 'EDGELOCK: Response Error')#
- EL2GO_PROV_SUCCESS = (1515870810, 'EL2GO_FW_PASS', 'Device has been successfully provisioned.')#
- FAIL = (1, 'Fail', 'Fail')#
- FLASH_ACCESS_ERROR = (103, 'FlashAccessError', 'FLASH Driver: Access Error')#
- FLASH_ADDRESS_ERROR = (102, 'FlashAddressError', 'FLASH Driver: Address Error')#
- FLASH_ALIGNMENT_ERROR = (101, 'FlashAlignmentError', 'FLASH Driver: Alignment Error')#
- FLASH_BLANK_IFR_PAGE_DATA = (133, 'FlashBlankIfrPageData', 'FLASH Driver: Blank IFR Page Data')#
- FLASH_CFPA_SCRATCH_PAGE_INVALID = (148, 'FlashCfpaScratchPageInvalid', 'FLASH Driver: CFPA Scratch Page Invalid')#
- FLASH_CFPA_VERSION_ROLLBACK_DISALLOWED = (149, 'FlashCfpaVersionRollbackDisallowed', 'FLASH Driver: CFPA Version Rollback Disallowed')#
- FLASH_CMPA_CFG_DIRECT_ERASE_NOT_ALLOWED = (140, 'FlashCmpaCfgDirectEraseNotAllowed', 'FLASH Driver: CMPA Cfg Direct Erase Not Allowed')#
- FLASH_COMMAND_ABORT_OPTION = (121, 'FlashCommandAbortOption', 'FLASH Driver: Operation is aborted')#
- FLASH_COMMAND_FAILURE = (105, 'FlashCommandFailure', 'FLASH Driver: Command Failure')#
- FLASH_COMMAND_NOT_SUPPORTED = (111, 'FlashCommandNotSupported', 'FLASH Driver: Command Not Supported')#
- FLASH_COMMAND_OPERATION_IN_PROGRESS = (152, 'FlashCommandOperationInProgress', 'FLASH Driver: Flash Memory State Busy Flash Memory Command Is In Progress')#
- FLASH_COMPARE_ERROR = (117, 'FlashCompareError', 'FLASH Driver: Destination And Source Memory Contents Do Not Match')#
- FLASH_ECC_ERROR = (116, 'FlashEccError', 'FLASH Driver: ECC Error')#
- FLASH_ENCRYPTED_REGIONS_ERASE_NOT_DONE_AT_ONCE = (134, 'FlashEncryptedRegionsEraseNotDoneAtOnce', 'FLASH Driver: Encrypted Regions Erase Not Done At Once')#
- FLASH_ERASE_KEY_ERROR = (107, 'FlashEraseKeyError', 'FLASH Driver: Provided Key Does Not Match Programmed Flash Memory Key')#
- FLASH_ERASE_VERIFY_FAILED = (154, 'FlashEraseVerifyFailed', 'FLASH Driver: Flash Memory Erase Verify Failed')#
- FLASH_EXEC_IN_RAM_NOT_READY = (109, 'FlashExecuteInRamFunctionNotReady', 'FLASH Driver: Execute In RAM Function Not Ready')#
- FLASH_HASH_CHECK_ERROR = (136, 'FlashHashCheckError', 'FLASH Driver: Hash Check Error')#
- FLASH_IFR1_ACCESS_NOT_ALLOWED = (153, 'FlashIfr1AccessNotAllowed', 'FLASH Driver: IFR1 Access Not Allowed')#
- FLASH_INVALID_PROPERTY_VALUE = (113, 'FlashInvalidPropertyValue', 'FLASH Driver: Flash Memory Property Value Out Of Range')#
- FLASH_INVALID_SPECULATION_OPTION = (114, 'FlashInvalidSpeculationOption', 'FLASH Driver: Flash Memory Prefetch Speculation Option Is Invalid')#
- FLASH_INVALID_WAIT_STATE_CYCLES = (119, 'FlashInvalidWaitStateCycles', 'FLASH Driver: Wait State Cycle Set To Read/Write Mode Is Invalid')#
- FLASH_MODIFY_PROTECTED_AREA_DISALLOWED = (151, 'FlashModifyProtectedAreaDisallowed', 'FLASH Driver: Flash Firewall Page Locked Erase And Program Are Not Allowed')#
- FLASH_NMPA_UPDATE_NOT_ALLOWED = (139, 'FlashNmpaUpdateNotAllowed', 'FLASH Driver: NMPA Update Not Allowed')#
- FLASH_OUT_OF_DATE_CFPA_PAGE = (132, 'FlashOutOfDateCfpaPage', 'FLASH Driver: Out Of Date CFPA Page')#
- FLASH_PFR_BANK_IS_LOCKED = (141, 'FlashPfrBankIsLocked', 'FLASH Driver: PFR Bank Is Locked')#
- FLASH_PFR_REGION_WRITE_BROKEN = (138, 'FlashPfrRegionWriteBroken', 'FLASH Driver: PFR Region Write Broken')#
- FLASH_PROGRAM_VERIFICATION_NOT_ALLOWED = (135, 'FlashProgramVerificationNotAllowed', 'FLASH Driver: Program Verification Not Allowed')#
- FLASH_PROTECTION_VIOLATION = (104, 'FlashProtectionViolation', 'FLASH Driver: Protection Violation')#
- FLASH_READ_HIDING_AREA_DISALLOWED = (150, 'FlashReadHidingAreaDisallowed', 'FLASH Driver: Flash Memory Hiding Read Not Allowed')#
- FLASH_READ_ONLY_PROPERTY = (112, 'FlashReadOnlyProperty', 'FLASH Driver: Flash Memory Property Is Read-Only')#
- FLASH_REGION_EXECUTE_ONLY = (108, 'FlashRegionExecuteOnly', 'FLASH Driver: Region Execute Only')#
- FLASH_REGULATION_LOSS = (118, 'FlashRegulationLoss', 'FLASH Driver: Loss Of Regulation During Read')#
- FLASH_SEALED_PFR_REGION = (137, 'FlashSealedPfrRegion', 'FLASH Driver: Sealed PFR Region')#
- FLASH_SIZE_ERROR = (100, 'FlashSizeError', 'FLASH Driver: Size Error')#
- FLASH_UNKNOWN_PROPERTY = (106, 'FlashUnknownProperty', 'FLASH Driver: Unknown Property')#
- FLEXSPINAND_ECC_CHECK_FAIL = (20002, 'FlexSPINANDEccCheckFail', 'FlexSPINAND: Ecc Check Fail')#
- FLEXSPINAND_ERASE_BLOCK_FAIL = (20005, 'FlexSPINANDEraseBlockFail', 'FlexSPINAND: Erase Block Fail')#
- FLEXSPINAND_NOT_FOUND = (20011, 'FlexSPINANDNotFound', 'FlexSPINAND: Not Found')#
- FLEXSPINAND_PAGE_EXECUTE_FAIL = (20004, 'FlexSPINANDPageExecuteFail', 'FlexSPINAND: Page Execute Fail')#
- FLEXSPINAND_PAGE_LOAD_FAIL = (20003, 'FlexSPINANDPageLoadFail', 'FlexSPINAND: Page Load Fail')#
- FLEXSPINAND_READ_CACHE_FAIL = (20001, 'FlexSPINANDReadCacheFail', 'FlexSPINAND: Read Cache Fail')#
- FLEXSPINAND_READ_PAGE_FAIL = (20000, 'FlexSPINANDReadPageFail', 'FlexSPINAND: Read Page Fail')#
- FLEXSPINAND_WAIT_TIMEOUT = (20006, 'FlexSPINANDWaitTimeout', 'FlexSPINAND: Wait Timeout')#
- FLEXSPINAND_WRITEALIGNMENTERROR = (20010, 'FlexSPINANDWriteAlignmentError', 'FlexSPINAND: Write Alignment Error')#
- FLEXSPINOR_COMMANDFAILURE = (20106, 'FlexSPINORCommandFailure', 'FlexSPINOR: Command Failure')#
- FLEXSPINOR_DTR_READ_DUMMYPROBEFAILED = (20110, 'FLEXSPINORDTRReadDummyProbeFailed', 'FLEXSPINOR: DTR Read Dummy Probe Failed')#
- FLEXSPINOR_ERASE_ALL_FAIL = (20102, 'FLEXSPINOREraseAllFail', 'FLEXSPINOR: Erase All Fail')#
- FLEXSPINOR_ERASE_SECTOR_FAIL = (20101, 'FLEXSPINOREraseSectorFail', 'FLEXSPINOR: Erase Sector Fail')#
- FLEXSPINOR_FLASH_NOTFOUND = (20109, 'FLEXSPINORFlashNotFound', 'FLEXSPINOR Flash Not Found')#
- FLEXSPINOR_NOT_SUPPORTED = (20104, 'FLEXSPINORPageSizeOverTheMaxSupportedSize', 'FlexSPINOR: PageSize over the max supported size')#
- FLEXSPINOR_PROGRAM_FAIL = (20100, 'FLEXSPINORProgramFail', 'FLEXSPINOR: Program Fail')#
- FLEXSPINOR_SFDP_NOTFOUND = (20107, 'FlexSPINORSFDPNotFound', 'FlexSPINOR: SFDP Not Found')#
- FLEXSPINOR_UNSUPPORTED_SFDP_VERSION = (20108, 'FLEXSPINORUnsupportedSFDPVersion', 'FLEXSPINOR: Unsupported SFDP Version')#
- FLEXSPINOR_WAIT_TIMEOUT = (20103, 'FLEXSPINORWaitTimeout', 'FLEXSPINOR:Wait Timeout')#
- FLEXSPINOR_WRITE_ALIGNMENT_ERROR = (20105, 'FlexSPINORWriteAlignmentError', 'FlexSPINOR:Write Alignment Error')#
- FLEXSPI_DEVICE_TIMEOUT_1 = (6002, 'FLEXSPI_DeviceTimeout', 'FLEXSPI: Device Timeout')#
- FLEXSPI_DEVICE_TIMEOUT_2 = (7002, 'FLEXSPI_DeviceTimeout', 'FLEXSPI: Device Timeout')#
- FLEXSPI_INVALID_SEQUENCE_1 = (6001, 'FLEXSPI_InvalidSequence', 'FLEXSPI: Invalid Sequence')#
- FLEXSPI_INVALID_SEQUENCE_2 = (7001, 'FLEXSPI_InvalidSequence', 'FLEXSPI: Invalid Sequence')#
- FLEXSPI_SEQUENCE_EXECUTION_TIMEOUT_1 = (6000, 'FLEXSPI_SequenceExecutionTimeout', 'FLEXSPI: Sequence Execution Timeout')#
- FLEXSPI_SEQUENCE_EXECUTION_TIMEOUT_2 = (7000, 'FLEXSPI_SequenceExecutionTimeout', 'FLEXSPI: Sequence Execution Timeout')#
- FlexSPINAND_DBBT_UPDATE_FAIL = (20009, 'Failed to update discovered bad block table to SPI NAND', 'SPI NAND: Failed to update discovered bad block table to SPI NAND')#
- FlexSPINAND_FCB_UPDATE_FAIL = (20008, 'FailedToUpdateFlashConfigBlockToSPINAND', 'SPI NAND: Failed to update Flash config block to SPI NAND')#
- FlexSPINAND_NOT_SUPPORTED = (20007, 'SPINANDPageSizeOverTheMaxSupportedSize', 'SPI NAND: PageSize over the max supported size')#
- I2C_ARBITRATION_LOST = (202, 'I2cArbitrationLost', 'I2C Driver: Arbitration Lost')#
- I2C_SLAVE_RX_OVERRUN = (201, 'I2cSlaveRxOverrun', 'I2C Driver: Slave Rx Overrun')#
- I2C_SLAVE_TX_UNDERRUN = (200, 'I2cSlaveTxUnderrun', 'I2C Driver: Slave Tx Underrun')#
- IAP_COMMAND_NOT_SUPPORTED = (100006, 'IAP_CommandNotSupported', 'IAP: Specific Command Not Supported')#
- IAP_CUMULATIVE_WRITE = (100004, 'IAP_CumulativeWrite', 'IAP: Flash Memory Region To Be Programmed Is Not Empty')#
- IAP_ERASE_FAILURE = (100005, 'IAP_EraseFailure', 'IAP: Erase Operation Failed')#
- IAP_INVALID_ARGUMENT = (100001, 'IAP_InvalidArgument', 'IAP: Invalid argument detected during API execution')#
- IAP_MEMORY_ACCESS_DISABLED = (100007, 'IAP_MemoryAccessDisabled', 'IAP: Memory Access Disabled')#
- IAP_OUT_OF_MEMORY = (100002, 'IAP_OutOfMemory', 'IAP: Heap Size Not Large Enough During API Execution')#
- IAP_READ_DISALLOWED = (100003, 'IAP_ReadDisallowed ', 'IAP: Read Memory Operation Disallowed During API Execution')#
- INVALID_ARGUMENT = (4, 'InvalidArgument', 'Invalid Argument Error')#
- INVALID_PROPERTY_VALUE = (10302, 'InvalidPropertyValue', 'Invalid Property Value')#
- MEMORY_ADDRESS_ERROR = (10209, 'MemoryAddressError', 'Memory Address Error')#
- MEMORY_ALIGNMENT_ERROR = (10206, 'MemoryAlignmentError', 'Memory Alignment Error')#
- MEMORY_APP_OVERLAP_WITH_EXECUTE_ONLY_REGION = (10204, 'MemoryAppOverlapWithExecuteOnlyRegion', 'Memory App Overlap with exec region')#
- MEMORY_BLANK_CHECK_FAILED = (10210, 'MemoryBlankCheckFailed', 'Memory Black Check Failed')#
- MEMORY_BLANK_PAGE_READ_DISALLOWED = (10211, 'MemoryBlankPageReadDisallowed', 'Memory Blank Page Read Disallowed')#
- MEMORY_CUMULATIVE_WRITE = (10203, 'MemoryCumulativeWrite', 'Memory Cumulative Write')#
- MEMORY_NOT_CONFIGURED = (10205, 'MemoryNotConfigured', 'Memory Not Configured')#
- MEMORY_PFR_SPEC_REGION_WRITE_BROKEN = (10213, 'MemoryPfrSpecRegionWriteBroken', 'Memory PFR Spec Region Write Broken')#
- MEMORY_PROTECTED_PAGE_READ_DISALLOWED = (10212, 'MemoryProtectedPageReadDisallowed', 'Memory Protected Page Read Disallowed')#
- MEMORY_RANGE_INVALID = (10200, 'MemoryRangeInvalid', 'Memory Range Invalid')#
- MEMORY_READ_FAILED = (10201, 'MemoryReadFailed', 'Memory Read Failed')#
- MEMORY_UNSUPPORTED_COMMAND = (10214, 'MemoryUnsupportedCommand', 'Memory Unsupported Command')#
- MEMORY_VERIFY_FAILED = (10207, 'MemoryVerifyFailed', 'Memory Verify Failed')#
- MEMORY_WRITE_FAILED = (10202, 'MemoryWriteFailed', 'Memory Write Failed')#
- MEMORY_WRITE_PROTECTED = (10208, 'MemoryWriteProtected', 'Memory Write Protected')#
- NO_RESPONSE = (10004, 'NoResponse', 'No response packet from target device')#
- NO_RESPONSE_EXPECTED = (10005, 'NoResponseExpected', 'No Response Expected')#
- NO_TRANSFER_IN_PROGRESS = (6, 'NoTransferInProgress', 'No Transfer In Progress Error')#
- OCOTP_PROGRAM_FAILURE = (20201, 'OCOTPProgramFailure', 'OCOTP: Program Failure')#
- OCOTP_READ_FAILURE = (20200, 'OCOTPReadFailure', 'OCOTP: Read Failure')#
- OCOTP_RELOAD_FAILURE = (20202, 'OCOTPReloadFailure', 'OCOTP: Reload Failure')#
- OCOTP_WAIT_TIMEOUT = (20203, 'OCOTPWaitTimeout', 'OCOTP: Wait Timeout')#
- OTFAD_INVALID_KEY = (502, 'OtfadInvalidKey', 'OTFAD Driver: Invalid Key')#
- OTFAD_INVALID_KEY_BLOB = (503, 'OtfadInvalidKeyBlob', 'OTFAD Driver: Invalid Key Blob')#
- OTFAD_LOGICALLY_DISABLED = (501, 'OtfadLogicallyDisabled', 'OTFAD Driver: Logically Disabled')#
- OTFAD_SECURITY_VIOLATION = (500, 'OtfadSecurityViolation', 'OTFAD Driver: Security Violation')#
- OTP_CRC_CHECK_PASS = (52808, 'OTP_CRCCheckPass', 'OTP: CRC check passed')#
- OTP_CRC_FAIL = (52803, 'OTP_CRCFail', 'OTP: CRC check failed')#
- OTP_ECC_CRC_FAIL = (52805, 'OTP_EccCheckFail', 'OTP: ECC check failed during OTP operation')#
- OTP_ERROR = (52804, 'OTP_Error', 'OTP: Error happened during OTP operation')#
- OTP_INVALID_ADDRESS = (52801, 'OTP_InvalidAddress', 'OTP: Invalid OTP address')#
- OTP_LOCKED = (52806, 'OTP_FieldLocked', 'OTP: Field is locked when programming')#
- OTP_PROGRAM_FAIL = (52802, 'OTP_ProgrammingFail', 'OTP: Programming failed')#
- OTP_TIMEOUT = (52807, 'OTP_Timeout', 'OTP: Operation timed out')#
- OTP_VERIFY_FAIL = (52009, 'OPT_VerifyFail', 'OTP: Failed to verify OTP write')#
- OUT_OF_RANGE = (3, 'OutOfRange', 'Out Of Range Error')#
- PACKETIZER_INVALID_CRC = (10502, 'InvalidCRC', 'Packetizer Error: Invalid packet type')#
- PACKETIZER_INVALID_PACKET_TYPE = (10501, 'InvalidPacketType', 'Packetizer Error: No response received for ping command')#
- PACKETIZER_NO_COMMAND_RESPONSE = (10503, 'NoCommandResponse', 'Packetizer Error: No response received for command')#
- PACKETIZER_NO_PING_RESPONSE = (10500, 'NoPingResponse', 'Packetizer Error: No Ping Response')#
- PING_ERROR = (10003, 'PingError', 'Ping Error')#
- QSPI_COMMAND_NOT_SUPPORTED = (406, 'QspiCommandNotSupported', 'QSPI Driver: Command Not Supported')#
- QSPI_COMMAND_TIMEOUT = (407, 'QspiCommandTimeout', 'QSPI Driver: Command Timeout')#
- QSPI_FLASH_ADDRESS_ERROR = (402, 'QspiFlashAddressError', 'QSPI Driver: Flash Address Error')#
- QSPI_FLASH_ALIGNMENT_ERROR = (401, 'QspiFlashAlignmentError', 'QSPI Driver: Flash Alignment Error')#
- QSPI_FLASH_COMMAND_FAILURE = (403, 'QspiFlashCommandFailure', 'QSPI Driver: Flash Command Failure')#
- QSPI_FLASH_SIZE_ERROR = (400, 'QspiFlashSizeError', 'QSPI Driver: Flash Size Error')#
- QSPI_FLASH_UNKNOWN_PROPERTY = (404, 'QspiFlashUnknownProperty', 'QSPI Driver: Flash Unknown Property')#
- QSPI_NOT_CONFIGURED = (405, 'QspiNotConfigured', 'QSPI Driver: Not Configured')#
- QSPI_WRITE_FAILURE = (408, 'QspiWriteFailure', 'QSPI Driver: Write Failure')#
- READ_ONLY = (2, 'ReadOnly', 'Read Only Error')#
- READ_ONLY_PROPERTY = (10301, 'ReadOnlyProperty', 'Read Only Property')#
- RELIABLE_UPDATE_BACKUPAPPLICATIONINVALID = (10603, 'ReliableUpdateBackupApplicationInvalid', 'Reliable Update: Backup Application Invalid')#
- RELIABLE_UPDATE_BACKUPBOOTLOADERNOTREADY = (10606, 'ReliableUpdateBackupBootloaderNotReady', 'Reliable Update: Backup Bootloader Not Ready')#
- RELIABLE_UPDATE_FAIL = (10601, 'ReliableUpdateFail', 'Reliable Update: Fail')#
- RELIABLE_UPDATE_INACTIVE = (10602, 'ReliableUpdateInactive', 'Reliable Update: Inactive')#
- RELIABLE_UPDATE_STILLINMAINAPPLICATION = (10604, 'ReliableUpdateStillInMainApplication', 'Reliable Update: Still In Main Application')#
- RELIABLE_UPDATE_SUCCESS = (10600, 'ReliableUpdateSuccess', 'Reliable Update: Success')#
- RELIABLE_UPDATE_SWAPINDICATORADDRESSINVALID = (10607, 'ReliableUpdateSwapIndicatorAddressInvalid', 'Reliable Update: Swap Indicator Address Invalid')#
- RELIABLE_UPDATE_SWAPSYSTEMNOTAVAILABLE = (10608, 'ReliableUpdateSwapSystemNotAvailable', 'Reliable Update: Swap System Not Available')#
- RELIABLE_UPDATE_SWAPSYSTEMNOTREADY = (10605, 'ReliableUpdateSwapSystemNotReady', 'Reliable Update: Swap System Not Ready')#
- RELIABLE_UPDATE_SWAPTEST = (10609, 'ReliableUpdateSwapTest', 'Reliable Update: Swap Test')#
- ROMLDR_BAD_SBKEK = (10118, 'RomLdrBadSBKEK', 'ROM Loader: Bad SBKEK Detected')#
- ROMLDR_CALL_FAILED = (10111, 'RomLdrCallFailed', 'ROM Loader: Call Failed')#
- ROMLDR_CHECKSUM = (10105, 'RomLdrChecksum', 'ROM Loader: Checksum Error')#
- ROMLDR_CRC32_ERROR = (10106, 'RomLdrCrc32Error', 'ROM Loader: CRC32 Error')#
- ROMLDR_DATA_UNDERRUN = (10109, 'RomLdrDataUnderrun', 'ROM Loader: Data Underrun')#
- ROMLDR_EOF_REACHED = (10104, 'RomLdrEOFReached', 'ROM Loader: EOF Reached')#
- ROMLDR_ID_NOT_FOUND = (10108, 'RomLdrIdNotFound', 'ROM Loader: ID Not Found')#
- ROMLDR_INVALID_SECTION_MAC_COUNT = (10116, 'RomLdrInvalidSectionMacCount', 'ROM Loader: Invalid Section Mac Count')#
- ROMLDR_JUMP_RETURNED = (10110, 'RomLdrJumpReturned', 'ROM Loader: Jump Returned')#
- ROMLDR_KEY_NOT_FOUND = (10112, 'RomLdrKeyNotFound', 'ROM Loader: Key Not Found')#
- ROMLDR_PENDING_JUMP_COMMAND = (10119, 'RomLdrPendingJumpCommand', 'ROM Loader: Pending Jump Command')#
- ROMLDR_RESET_RETURNED = (10114, 'RomLdrResetReturned', 'ROM Loader: Reset Returned')#
- ROMLDR_ROLLBACK_BLOCKED = (10115, 'RomLdrRollbackBlocked', 'ROM Loader: Rollback Blocked')#
- ROMLDR_SECTION_LENGTH = (10102, 'RomLdrSectionLength', 'ROM Loader: Section Length Error')#
- ROMLDR_SECTION_OVERRUN = (10100, 'RomLdrSectionOverrun', 'ROM Loader: Section Overrun')#
- ROMLDR_SECURE_ONLY = (10113, 'RomLdrSecureOnly', 'ROM Loader: Secure Only')#
- ROMLDR_SIGNATURE = (10101, 'RomLdrSignature', 'ROM Loader: Signature Error')#
- ROMLDR_UNENCRYPTED_ONLY = (10103, 'RomLdrUnencryptedOnly', 'ROM Loader: Unencrypted Only')#
- ROMLDR_UNEXPECTED_COMMAND = (10117, 'RomLdrUnexpectedCommand', 'ROM Loader: Unexpected Command')#
- ROMLDR_UNKNOWN_COMMAND = (10107, 'RomLdrUnknownCommand', 'ROM Loader: Unknown Command')#
- ROM_API_BUFFER_SIZE_NOT_ENOUGH = (10802, 'RomApiBufferSizeNotEnough', 'RomApi: Buffer Size Not Enough')#
- ROM_API_INVALID_BUFFER = (10803, 'RomApiInvalidBuffer', 'RomApi: Invalid Buffer')#
- ROM_API_NEED_MORE_DATA = (10801, 'RomApiNeedMoreData', 'RomApi: Need More Data')#
- SECURITY_SUBSYSTEM_ERROR = (1515890085, 'SecuritySubSystemError', 'Security SubSystem Error')#
- SECURITY_VIOLATION = (10001, 'SecurityViolation', 'Security Violation')#
- SEMCNAND_CANNOT_ENABLE_DEVICE_ECC = (21206, 'SemcNAND_CannotEnableDeviceEcc', 'SemcNAND: Cannot Enable Device Ecc')#
- SEMCNAND_DEVICE_TIMEOUT = (21200, 'SemcNAND_DeviceTimeout', 'SemcNAND: Device Timeout')#
- SEMCNAND_DISALLOW_OVERWRITE_BCB = (21219, 'SemcNAND_DisallowOverwriteBcb', 'SemcNAND: Disallow Overwrite Bcb')#
- SEMCNAND_DISORDERED_IMAGE_COPIES = (21222, 'SemcNAND_DisorderedImageCopies', 'SemcNAND: Disordered Image Copies')#
- SEMCNAND_ECC_CHECK_FAIL = (21204, 'SemcNAND_EccCheckFail', 'SemcNAND: Ecc Check Fail')#
- SEMCNAND_ERASE_VERIFY_FAILURE = (21209, 'SemcNAND_EraseVerifyFailure', 'SemcNAND: Erase Verify Failure')#
- SEMCNAND_FAIL_TO_UPDATE_DBBT = (21218, 'SemcNAND_FailToUpdateDbbt', 'SemcNAND: Fail To Update Dbbt')#
- SEMCNAND_FAIL_TO_UPDATE_FCB = (21217, 'SemcNAND_FailToUpdateFcb', 'SemcNAND: Fail To Update Fcb')#
- SEMCNAND_INVALID_CFG_TAG = (21216, 'SemcNAND_InvalidCfgTag', 'SemcNAND: Invalid Cfg Tag')#
- SEMCNAND_INVALID_MEMORY_ADDRESS = (21201, 'SemcNAND_InvalidMemoryAddress', 'SemcNAND: Invalid Memory Address')#
- SEMCNAND_INVALID_ONFI_PARAMETER = (21205, 'SemcNAND_InvalidOnfiParameter', 'SemcNAND: Invalid Onfi Parameter')#
- SEMCNAND_INVALID_READBACK_BUFFER = (21210, 'SemcNAND_InvalidReadbackBuffer', 'SemcNAND: Invalid Readback Buffer')#
- SEMCNAND_MORE_THAN_MAX_IMAGE_COPY = (21221, 'SemcNAND_MoreThanMaxImageCopy', 'SemcNAND: More Than Max Image Copy')#
- SEMCNAND_MORE_THAN_ONE_PAGE_SIZE = (21203, 'SemcNAND_MoreThanOnePageSize', 'SemcNAND: More Than One Page Size')#
- SEMCNAND_NOT_EQUAL_TO_ONE_PAGE_SIZE = (21202, 'SemcNAND_NotEqualToOnePageSize', 'SemcNAND: Not Equal To One Page Size')#
- SEMCNAND_ONLY_SUPPORT_ONFI_DEVICE = (21220, 'SemcNAND_OnlySupportOnfiDevice', 'SemcNAND: Only Support Onfi Device')#
- SEMCNAND_PROGRAM_VERIFY_FAILURE = (21208, 'SemcNAND_ProgramVerifyFailure', 'SemcNAND: Program Verify Failure')#
- SEMCNAND_SWITCH_TIMING_MODE_FAILURE = (21207, 'SemcNAND_SwitchTimingModeFailure', 'SemcNAND: Switch Timing Mode Failure')#
- SEMCNOR_ADDRESS_ALIGNMENT_ERROR = (21103, 'SemcNOR_AddressAlignmentError', 'SemcNOR: Address Alignment Error')#
- SEMCNOR_BLOCK_ERASE_COMMAND_FAILURE = (21107, 'SemcNOR_BlockEraseCommandFailure', 'SemcNOR: Block Erase Command Failure')#
- SEMCNOR_BUFFER_PROGRAM_COMMAND_FAILURE = (21108, 'SemcNOR_BufferProgramCommandFailure', 'SemcNOR: Buffer Program Command Failure')#
- SEMCNOR_COMMAND_ERROR_NO_INFO_AVAILABLE = (21106, 'SemcNOR_CommandErrorNoInfoAvailable', 'SemcNOR: Command Error No Info Available')#
- SEMCNOR_COMMAND_ERROR_NO_OP_TO_SUSPEND = (21105, 'SemcNOR_CommandErrorNoOpToSuspend', 'SemcNOR: Command Error No Op To Suspend')#
- SEMCNOR_DEVICE_TIMEOUT = (21100, 'SemcNOR_DeviceTimeout', 'SemcNOR: Device Timeout')#
- SEMCNOR_ERASE_VERIFY_FAILURE = (21110, 'SemcNOR_EraseVerifyFailure', 'SemcNOR: Erase Verify Failure')#
- SEMCNOR_INVALID_CFG_TAG = (21116, 'SemcNOR_InvalidCfgTag', 'SemcNOR: Invalid Cfg Tag')#
- SEMCNOR_INVALID_CFI_SIGNATURE = (21104, 'SemcNOR_InvalidCfiSignature', 'SemcNOR: Invalid Cfi Signature')#
- SEMCNOR_INVALID_MEMORY_ADDRESS = (21101, 'SemcNOR_InvalidMemoryAddress', 'SemcNOR: Invalid Memory Address')#
- SEMCNOR_PROGRAM_VERIFY_FAILURE = (21109, 'SemcNOR_ProgramVerifyFailure', 'SemcNOR: Program Verify Failure')#
- SEMCNOR_UNMATCHED_COMMAND_SET = (21102, 'SemcNOR_unmatchedCommandSet', 'SemcNOR: unmatched Command Set')#
- SENDING_OPERATION_CONDITION_ERROR = (1812, 'SendOperationConditionError', 'Send Operation Condition failed')#
- SERIAL_NOR_EEPROM_ADDRESS_INVALID = (10700, 'SerialNorEepromAddressInvalid', 'SerialNorEeprom: Address Invalid')#
- SERIAL_NOR_EEPROM_COMMAND_INVALID = (10704, 'SerialNorEepromCommandInvalid', 'SerialNorEeprom: Command Invalid')#
- SERIAL_NOR_EEPROM_SIZE_INVALID = (10703, 'SerialNorEepromSizeInvalid', 'SerialNorEeprom: Size Invalid')#
- SERIAL_NOR_EEPROM_TRANSFER_ERROR = (10701, 'SerialNorEepromTransferError', 'SerialNorEeprom: Transfer Error')#
- SERIAL_NOR_EEPROM_TYPE_INVALID = (10702, 'SerialNorEepromTypeInvalid', 'SerialNorEeprom: Type Invalid')#
- SPIFINOR_COMMAND_FAILURE = (22006, 'SPIFINOR_CommandFailure', 'SPIFINOR: Command Failure')#
- SPIFINOR_ERASE_ALL_FAIL = (22002, 'SPIFINOR_EraseAllFail', 'SPIFINOR: Erase All Fail')#
- SPIFINOR_ERASE_SECTORFAIL = (22001, 'SPIFINOR_EraseSectorFail', 'SPIFINOR: Erase Sector Fail')#
- SPIFINOR_NOT_SUPPORTED = (22004, 'SPIFINOR_NotSupported', 'SPIFINOR: Not Supported')#
- SPIFINOR_PROGRAM_FAIL = (22000, 'SPIFINOR_ProgramFail', 'SPIFINOR: Program Fail')#
- SPIFINOR_SFDP_NOT_FOUND = (22007, 'SPIFINOR_SFDP_NotFound', 'SPIFINOR: SFDP Not Found')#
- SPIFINOR_WAIT_TIMEOUT = (22003, 'SPIFINOR_WaitTimeout', 'SPIFINOR: Wait Timeout')#
- SPIFINOR_WRITE_ALIGNMENTERROR = (22005, 'SPIFINOR_WriteAlignmentError', 'SPIFINOR: Write Alignment Error')#
- SPI_SLAVE_RX_OVERRUN = (301, 'SpiSlaveRxOverrun', 'SPI Driver: Slave Rx Overrun')#
- SPI_SLAVE_TX_UNDERRUN = (300, 'SpiSlaveTxUnderrun', 'SPI Driver: Slave Tx Underrun')#
- STATUS_ATTACK_DRY_RUN_EN = (1963635992, 'STATUS_ATTACK_DRY_RUN_EN', 'STATUS_ATTACK_DRY_RUN_EN')#
- STATUS_ATTR_BLOB_KEY_ID_FAIL = (2768944896, 'STATUS_ATTR_BLOB_KEY_ID_FAIL', "STATUS_ATTR_BLOB_KEY_ID_FAIL: Invalid Secure Object's key ID value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_ALG_FAIL = (2768292630, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_ALG_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_ALG_FAIL: Invalid Device Group Provisioning Key Secure Object's key algorithm value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_BITS_FAIL = (2768292633, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_BITS_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_BITS_FAIL: Invalid Device Group Provisioning Key Secure Object's key bits value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_DEVICE_LCS_FAIL = (2768292635, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_DEVICE_LCS_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_DEVICE_LCS_FAIL: Invalid Device Group Provisioning Key Secure Object's device lifecycle value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_LIFETIME_FAIL = (2768292634, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_LIFETIME_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_LIFETIME_FAIL: Invalid Device Group Provisioning Key Secure Object's key lifetime value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_MAGIC_FAIL = (2768292629, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_MAGIC_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_MAGIC_FAIL: Invalid Device Group Provisioning Key Secure Object's magic value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_SIGN_ALG_FAIL = (2768292639, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_SIGN_ALG_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_SIGN_ALG_FAIL: Invalid Device Group Provisioning Key Secure Object's signing algorithm value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_SIGN_KEY_ID_FAIL = (2768292638, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_SIGN_KEY_ID_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_SIGN_KEY_ID_FAIL: Invalid Device Group Provisioning Key Secure Object's signing key ID value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_TYPE_FAIL = (2768292632, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_TYPE_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_TYPE_FAIL: Invalid Device Group Provisioning Key Secure Object's key type value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_USAGE_FAIL = (2768292631, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_USAGE_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_USAGE_FAIL: Invalid Device Group Provisioning Key Secure Object's key usage value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_WRAPP_ALG_FAIL = (2768292637, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_WRAPP_ALG_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_WRAPP_ALG_FAIL: Invalid Device Group Provisioning Key Secure Object's wrapping algorithm value")#
- STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_WRAPP_KEY_ID_FAIL = (2768292636, 'STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_WRAPP_KEY_ID_FAIL', "STATUS_ATTR_DEVICE_GROUP_PROVISIONING_KEY_WRAPP_KEY_ID_FAIL: Invalid Device Group Provisioning Key Secure Object's wrapping key ID value")#
- STATUS_ATTR_OEM_DEVICE_KEY_BITS_FAIL = (2768942340, 'STATUS_ATTR_OEM_DEVICE_KEY_BITS_FAIL', "STATUS_ATTR_OEM_DEVICE_KEY_BITS_FAIL: Invalid OEM FW Decryption key Secure Object's key bits value")#
- STATUS_ATTR_OEM_DEVICE_KEY_TYPE_FAIL = (2768942339, 'STATUS_ATTR_OEM_DEVICE_KEY_TYPE_FAIL', "STATUS_ATTR_OEM_DEVICE_KEY_TYPE_FAIL: Invalid OEM FW Decryption key Secure Object's key type value")#
- STATUS_ATTR_OEM_DEVICE_LCS_FAIL = (2768305082, 'STATUS_ATTR_OEM_DEVICE_LCS_FAIL', "STATUS_ATTR_OEM_DEVICE_LCS_FAIL: Invalid OEM FW Decryption key Secure Object's device lifecycle value")#
- STATUS_ATTR_OEM_DEVICE_SIGN_ALG_FAIL = (2768941568, 'STATUS_ATTR_OEM_DEVICE_SIGN_ALG_FAIL', "STATUS_ATTR_OEM_DEVICE_SIGN_ALG_FAIL: Invalid OEM FW Decryption key Secure Object's signing algorithm value")#
- STATUS_ATTR_OEM_DEVICE_SING_KEY_ID_FAIL = (2768942338, 'STATUS_ATTR_OEM_DEVICE_SING_KEY_ID_FAIL', "STATUS_ATTR_OEM_DEVICE_SING_KEY_ID_FAIL: Invalid OEM FW Decryption key Secure Object's signing key ID value")#
- STATUS_ATTR_OEM_DEVICE_WRAPP_ALG_FAIL = (2768941312, 'STATUS_ATTR_OEM_DEVICE_WRAPP_ALG_FAIL', "STATUS_ATTR_OEM_DEVICE_WRAPP_ALG_FAIL: Invalid OEM FW Decryption key Secure Object's wrapping algorithm value")#
- STATUS_ATTR_OEM_DEVICE_WRAPP_KEY_ID_FAIL = (2768942337, 'STATUS_ATTR_OEM_DEVICE_WRAPP_KEY_ID_FAIL', "STATUS_ATTR_OEM_DEVICE_WRAPP_KEY_ID_FAIL: Invalid OEM FW Decryption key Secure Object's wrapping key ID value")#
- STATUS_ATTR_OEM_KEY_ALG_FAIL = (2768942080, 'STATUS_ATTR_OEM_KEY_ALG_FAIL', "STATUS_ATTR_OEM_KEY_ALG_FAIL: Invalid OEM FW Decryption key Secure Object's key algorithm value")#
- STATUS_ATTR_OEM_KEY_LCS_FAIL = (2768941824, 'STATUS_ATTR_OEM_KEY_LCS_FAIL', "STATUS_ATTR_OEM_KEY_LCS_FAIL: Invalid OEM FW Decryption key Secure Object's key lifecycle value")#
- STATUS_ATTR_OEM_KEY_MAGIC_FAIL = (2768304811, 'STATUS_ATTR_OEM_KEY_MAGIC_FAIL', "STATUS_ATTR_OEM_KEY_MAGIC_FAIL: Invalid OEM FW Decryption key Secure Object's magic value")#
- STATUS_ATTR_OEM_KEY_USAGE_FAIL = (2768304826, 'STATUS_ATTR_OEM_KEY_USAGE_FAIL', "STATUS_ATTR_OEM_KEY_USAGE_FAIL: Invalid OEM FW Decryption key Secure Object's key usage value")#
- STATUS_ATTR_OTP_DATA_DEVICE_LCS_FAIL = (2768942348, 'STATUS_ATTR_OTP_DATA_DEVICE_LCS_FAIL', "STATUS_ATTR_OTP_DATA_DEVICE_LCS_FAIL: Invalid OTP Configuration Data Secure Object's device lifecycle value")#
- STATUS_ATTR_OTP_DATA_DEVICE_SING_KEY_ID_FAIL = (2768942351, 'STATUS_ATTR_OTP_DATA_DEVICE_SING_KEY_ID_FAIL', "STATUS_ATTR_OTP_DATA_DEVICE_SING_KEY_ID_FAIL: Invalid OTP Configuration Data Secure Object's signing key ID value")#
- STATUS_ATTR_OTP_DATA_DEVICE_WRAPP_ALG_FAIL = (2768942350, 'STATUS_ATTR_OTP_DATA_DEVICE_WRAPP_ALG_FAIL', "STATUS_ATTR_OTP_DATA_DEVICE_WRAPP_ALG_FAIL: Invalid OTP Configuration Data Secure Object's wrapping algorithm value.")#
- STATUS_ATTR_OTP_DATA_DEVICE_WRAPP_KEY_ID_FAIL = (2768942349, 'STATUS_ATTR_OTP_DATA_DEVICE_WRAPP_KEY_ID_FAIL', "STATUS_ATTR_OTP_DATA_DEVICE_WRAPP_KEY_ID_FAIL: Invalid OTP Configuration Data Secure Object's wrapping key ID value")#
- STATUS_ATTR_OTP_DATA_KEY_ALG_FAIL = (2768942344, 'STATUS_ATTR_OTP_DATA_KEY_ALG_FAIL', "STATUS_ATTR_OTP_DATA_KEY_ALG_FAIL: Invalid OTP Configuration Data Secure Object's key algorithm value")#
- STATUS_ATTR_OTP_DATA_KEY_LCS_FAIL = (2768942347, 'STATUS_ATTR_OTP_DATA_KEY_LCS_FAIL', "STATUS_ATTR_OTP_DATA_KEY_LCS_FAIL: Invalid OTP Configuration Data Secure Object's key lifecycle value")#
- STATUS_ATTR_OTP_DATA_KEY_SIGN_ALG_FAIL = (2768942352, 'STATUS_ATTR_OTP_DATA_KEY_SIGN_ALG_FAIL', "STATUS_ATTR_OTP_DATA_KEY_SIGN_ALG_FAIL: Invalid OTP Configuration Data Secure Object's signing algorithm value")#
- STATUS_ATTR_OTP_DATA_KEY_TYPE_FAIL = (2768942346, 'STATUS_ATTR_OTP_DATA_KEY_TYPE_FAIL', "STATUS_ATTR_OTP_DATA_KEY_TYPE_FAIL: Invalid OTP Configuration Data Secure Object's key type value")#
- STATUS_ATTR_OTP_DATA_KEY_USAGE_FAIL = (2768942345, 'STATUS_ATTR_OTP_DATA_KEY_USAGE_FAIL', "STATUS_ATTR_OTP_DATA_KEY_USAGE_FAIL: Invalid OTP Configuration Data Secure Object's key usage value")#
- STATUS_ATTR_OTP_DATA_MAGIC_FAIL = (2768942343, 'STATUS_ATTR_OTP_DATA_MAGIC_FAIL', "STATUS_ATTR_OTP_DATA_MAGIC_FAIL: Invalid OTP Configuration Data Secure Object's magic value")#
- STATUS_ATTR_RKTH_DEVICE_LCS_FAIL = (2768943360, 'STATUS_ATTR_RKTH_DEVICE_LCS_FAIL', "STATUS_ATTR_RKTH_DEVICE_LCS_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's device lifecycle value")#
- STATUS_ATTR_RKTH_DEVICE_SING_KEY_ID_FAIL = (2768944384, 'STATUS_ATTR_RKTH_DEVICE_SING_KEY_ID_FAIL', "STATUS_ATTR_RKTH_DEVICE_SING_KEY_ID_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's signing key ID value")#
- STATUS_ATTR_RKTH_DEVICE_WRAPP_ALG_FAIL = (2768944128, 'STATUS_ATTR_RKTH_DEVICE_WRAPP_ALG_FAIL', "STATUS_ATTR_RKTH_DEVICE_WRAPP_ALG_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's wrapping algorithm value")#
- STATUS_ATTR_RKTH_DEVICE_WRAPP_KEY_ID_FAIL = (2768943616, 'STATUS_ATTR_RKTH_DEVICE_WRAPP_KEY_ID_FAIL', "STATUS_ATTR_RKTH_DEVICE_WRAPP_KEY_ID_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's wrapping key ID value")#
- STATUS_ATTR_RKTH_KEY_ALG_FAIL = (2768942592, 'STATUS_ATTR_RKTH_KEY_ALG_FAIL', "STATUS_ATTR_RKTH_KEY_ALG_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's key algorithm value")#
- STATUS_ATTR_RKTH_KEY_BITS_FAIL = (2768942342, 'STATUS_ATTR_RKTH_KEY_BITS_FAIL', "STATUS_ATTR_RKTH_KEY_BITS_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's key bits value")#
- STATUS_ATTR_RKTH_KEY_LCS_FAIL = (2768943104, 'STATUS_ATTR_RKTH_KEY_LCS_FAIL', "STATUS_ATTR_RKTH_KEY_LCS_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's key lifecycle value")#
- STATUS_ATTR_RKTH_KEY_SIGN_ALG_FAIL = (2768943872, 'STATUS_ATTR_RKTH_KEY_SIGN_ALG_FAIL', "STATUS_ATTR_RKTH_KEY_SIGN_ALG_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's signing algorithm value")#
- STATUS_ATTR_RKTH_KEY_TYPE_FAIL = (2768942341, 'STATUS_ATTR_RKTH_KEY_TYPE_FAIL', "STATUS_ATTR_RKTH_KEY_TYPE_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's key type value")#
- STATUS_ATTR_RKTH_KEY_USAGE_FAIL = (2768942848, 'STATUS_ATTR_RKTH_KEY_USAGE_FAIL', "STATUS_ATTR_RKTH_KEY_USAGE_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's key usage value")#
- STATUS_ATTR_RKTH_MAGIC_FAIL = (2768942336, 'STATUS_ATTR_RKTH_MAGIC_FAIL', "STATUS_ATTR_RKTH_MAGIC_FAIL: Invalid OEM FW Authentication Key Hash Secure Object's magic value")#
- STATUS_BLANK_DEVICE_FUSES_1 = (1962987537, 'STATUS_BLANK_DEVICE_FUSES_1', 'STATUS_BLANK_DEVICE_FUSES_1: Blank Device fuses')#
- STATUS_BLANK_DEVICE_FUSES_2 = (1962987538, 'STATUS_BLANK_DEVICE_FUSES_2', 'STATUS_BLANK_DEVICE_FUSES_2: Blank Device fuses')#
- STATUS_BUFFER_OVERFLOW_OTP_CONF = (1963635993, 'STATUS_BUFFER_OVERFLOW_OTP_CONF', 'STATUS_BUFFER_OVERFLOW_OTP_CONF: Buffer overflow error')#
- STATUS_CONFIG_FLASH_MEMORY_FAIL = (2768292622, 'STATUS_CONFIG_FLASH_MEMORY_FAIL', 'STATUS_CONFIG_FLASH_MEMORY_FAIL: Configuration of Flash failed')#
- STATUS_CONTEXT_INIT_FAIL = (2768292644, 'STATUS_CONTEXT_INIT_FAIL', 'STATUS_CONTEXT_INIT_FAIL')#
- STATUS_CSS_INIT_FAIL = (2768292647, 'STATUS_CSS_INIT_FAIL', 'STATUS_CSS_INIT_FAIL')#
- STATUS_DECRYPT_EXT_BLOB_1_FAIL = (2768942355, 'STATUS_DECRYPT_EXT_BLOB_1_FAIL', "STATUS_DECRYPT_EXT_BLOB_1_FAIL: Failure in decrypting external Secure Objects's key payload")#
- STATUS_DECRYPT_EXT_BLOB_2_FAIL = (2768292618, 'STATUS_DECRYPT_EXT_BLOB_2_FAIL', "STATUS_DECRYPT_EXT_BLOB_2_FAIL: Failure in decrypting external Secure Objects's key payload")#
- STATUS_DELETE_KEY_FAIL = (1962985728, 'STATUS_DELETE_KEY_FAIL', 'STATUS_DELETE_KEY_FAIL: Failure in key deletion')#
- STATUS_DER_EL2GO_CUST_MK_SK_FAIL = (2768292653, 'STATUS_DER_EL2GO_CUST_MK_SK_FAIL', 'STATUS_DER_EL2GO_CUST_MK_SK_FAIL')#
- STATUS_DER_NXP_CUST_DIE_EL2GOOEM_MK_SK_FAIL = (2768292652, 'STATUS_DER_NXP_CUST_DIE_EL2GOOEM_MK_SK_FAIL', 'STATUS_DER_NXP_CUST_DIE_EL2GOOEM_MK_SK_FAIL')#
- STATUS_DER_NXP_CUST_DIE_EL2GO_MK_SK_FAIL = (2768292651, 'STATUS_DER_NXP_CUST_DIE_EL2GO_MK_SK_FAIL', 'STATUS_DER_NXP_CUST_DIE_EL2GO_MK_SK_FAIL')#
- STATUS_DER_NXP_CUST_EL2GOLOG_AUTH_PRK_SEED_FAIL = (2768292650, 'STATUS_DER_NXP_CUST_EL2GOLOG_AUTH_PRK_SEED_FAIL', 'STATUS_DER_NXP_CUST_EL2GOLOG_AUTH_PRK_SEED_FAIL')#
- STATUS_DER_NXP_DIE_EL2GO_MK_SK_FAIL = (2768292649, 'STATUS_DER_NXP_DIE_EL2GO_MK_SK_FAIL', 'STATUS_DER_NXP_DIE_EL2GO_MK_SK_FAIL')#
- STATUS_DER_NXP_DIE_MK_SK_FAIL = (2768292646, 'STATUS_DER_NXP_DIE_MK_SK_FAIL', 'STATUS_DER_NXP_DIE_MK_SK_FAIL')#
- STATUS_DEVICE_NOT_IN_FLEXSPI_BOOT_MODE = (1963635994, 'STATUS_DEVICE_NOT_IN_FLEXSPI_BOOT_MODE', 'STATUS_DEVICE_NOT_IN_FLEXSPI_BOOT_MODE: Device is booted not in FlexSPI Boot mode')#
- STATUS_ENCRYPT_EXT_BLOB_FAIL = (2768292619, 'STATUS_ENCRYPT_EXT_BLOB_FAIL', "STATUS_ENCRYPT_EXT_BLOB_FAIL: Failure in encrypting external Secure Objects's key payload")#
- STATUS_ENC_EXT_KEY_FAIL = (2768292641, 'STATUS_ENC_EXT_KEY_FAIL', 'STATUS_ENC_EXT_KEY_FAIL: Failed to encrypt external Secure Object')#
- STATUS_ENC_INT_KEY_FAIL = (2768292640, 'STATUS_ENC_INT_KEY_FAIL', 'STATUS_ENC_INT_KEY_FAIL: Failed to encrypt internal Secure Object')#
- STATUS_ERASE_FLASH_FAIL = (2768292654, 'STATUS_ERASE_FLASH_FAIL', 'STATUS_ERASE_FLASH_FAIL')#
- STATUS_EXTRA_BLOBS_SIZE_FAIL = (2768292627, 'STATUS_EXTRA_BLOBS_SIZE_FAIL', 'STATUS_EXTRA_BLOBS_SIZE_FAIL: Size of non-static Secure Objects is more than 16KB')#
- STATUS_GET_DEVICE_SHARES_FAIL = (2768290048, 'STATUS_GET_DEVICE_SHARES_FAIL', 'STATUS_GET_DEVICE_SHARES_FAIL: Failure in reading out device shares')#
- STATUS_GET_UUID_FAIL = (2768292660, 'STATUS_GET_UUID_FAIL', 'STATUS_GET_UUID_FAIL')#
- STATUS_HASH_OP_FAIL = (2768292642, 'STATUS_HASH_OP_FAIL', 'STATUS_HASH_OP_FAIL: Failed hash operation')#
- STATUS_HASH_PUB_KEY_FAIL = (2768292661, 'STATUS_HASH_PUB_KEY_FAIL', 'STATUS_HASH_PUB_KEY_FAIL')#
- STATUS_INVALID_RKTH_SIZE_FAIL = (2768942359, 'STATUS_INVALID_RKTH_SIZE_FAIL', 'STATUS_INVALID_RKTH_SIZE_FAIL: Invalid OEM FW Authentication Key Hash size')#
- STATUS_KEYGEN_FAIL = (2768292623, 'STATUS_KEYGEN_FAIL', 'STATUS_KEYGEN_FAIL: Generation of key failed')#
- STATUS_KEYSTORE_INIT_FAIL = (2768292645, 'STATUS_KEYSTORE_INIT_FAIL', 'STATUS_KEYSTORE_INIT_FAIL')#
- STATUS_KEY_DERIVATION_10_FAIL = (2768291840, 'STATUS_KEY_DERIVATION_10_FAIL', 'STATUS_KEY_DERIVATION_10_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_11_FAIL = (2768292609, 'STATUS_KEY_DERIVATION_11_FAIL', 'STATUS_KEY_DERIVATION_11_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_12_FAIL = (2768292610, 'STATUS_KEY_DERIVATION_12_FAIL', 'STATUS_KEY_DERIVATION_12_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_13_FAIL = (2768292357, 'STATUS_KEY_DERIVATION_13_FAIL', 'STATUS_KEY_DERIVATION_13_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_14_FAIL = (2768292358, 'STATUS_KEY_DERIVATION_14_FAIL', 'STATUS_KEY_DERIVATION_14_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_15_FAIL = (2768292615, 'STATUS_KEY_DERIVATION_15_FAIL', 'STATUS_KEY_DERIVATION_15_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_16_FAIL = (2768292616, 'STATUS_KEY_DERIVATION_16_FAIL', 'STATUS_KEY_DERIVATION_16_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_1_FAIL = (2768290304, 'STATUS_KEY_DERIVATION_1_FAIL', 'STATUS_KEY_DERIVATION_1_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_2_FAIL = (2768290560, 'STATUS_KEY_DERIVATION_2_FAIL', 'STATUS_KEY_DERIVATION_2_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_3_FAIL = (2768290816, 'STATUS_KEY_DERIVATION_3_FAIL', 'STATUS_KEY_DERIVATION_3_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_4_FAIL = (2768291072, 'STATUS_KEY_DERIVATION_4_FAIL', 'STATUS_KEY_DERIVATION_4_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_5_FAIL = (2768291328, 'STATUS_KEY_DERIVATION_5_FAIL', 'STATUS_KEY_DERIVATION_5_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_6_FAIL = (2768291584, 'STATUS_KEY_DERIVATION_6_FAIL', 'STATUS_KEY_DERIVATION_6_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_7_FAIL = (2768292608, 'STATUS_KEY_DERIVATION_7_FAIL', 'STATUS_KEY_DERIVATION_7_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_8_FAIL = (1962987539, 'STATUS_KEY_DERIVATION_8_FAIL', 'STATUS_KEY_DERIVATION_8_FAIL: Failure in key derivation')#
- STATUS_KEY_DERIVATION_9_FAIL = (1962987540, 'STATUS_KEY_DERIVATION_9_FAIL', 'STATUS_KEY_DERIVATION_9_FAIL: Failure in key derivation')#
- STATUS_KEY_USAGE_1_FAIL = (1962991872, 'STATUS_KEY_USAGE_1_FAIL', "STATUS_KEY_USAGE_1_FAIL: Failure in using an EdgeLock 2GO's Secure Object key")#
- STATUS_KEY_USAGE_2_FAIL = (1962992128, 'STATUS_KEY_USAGE_2_FAIL', "STATUS_KEY_USAGE_2_FAIL: Failure in using an EdgeLock 2GO's Secure Object key")#
- STATUS_LESS_BLOBS_STORED = (2768942353, 'STATUS_LESS_BLOBS_STORED', 'STATUS_LESS_BLOBS_STORED: Three main Secure Object are not present in Flash memory')#
- STATUS_LOCK_DEVICE_FUSE_FAIL = (1963635988, 'STATUS_LOCK_DEVICE_FUSE_FAIL', 'STATUS_LOCK_DEVICE_FUSE_FAIL: Failure in locking Device fuse')#
- STATUS_MAX_NUMBER_SECURE_OBJECTS = (2768292612, 'STATUS_MAX_NUMBER_SECURE_OBJECTS', 'STATUS_MAX_NUMBER_SECURE_OBJECTS: More than 16 of non-static Secure Objects are present.')#
- STATUS_MISMATCH_IN_SECURE_OBJECTS_LCS_1 = (1963635996, 'STATUS_MISMATCH_IN_SECURE_OBJECTS_LCS_1', "STATUS_MISMATCH_IN_SECURE_OBJECTS_LCS_1: Secure Objects present don't share the same lifecycle.")#
- STATUS_MISMATCH_IN_SECURE_OBJECTS_LCS_2 = (2768292614, 'STATUS_MISMATCH_IN_SECURE_OBJECTS_LCS_2', "STATUS_MISMATCH_IN_SECURE_OBJECTS_LCS_2: Secure Objects present don't share the same lifecycle.")#
- STATUS_MISMATCH_IN_SECURE_OBJECTS_TYPE = (1963635995, 'STATUS_MISMATCH_IN_SECURE_OBJECTS_TYPE', 'STATUS_MISMATCH_IN_SECURE_OBJECTS_TYPE: Secure Objects present are a mix of device individual and product-based flow')#
- STATUS_NON_BLANK_DEVICE_FUSES_1_FAIL = (1962992384, 'STATUS_NON_BLANK_DEVICE_FUSES_1_FAIL', 'STATUS_NON_BLANK_DEVICE_FUSES_1_FAIL: Non blank Device fuses')#
- STATUS_NON_BLANK_DEVICE_FUSES_2_FAIL = (1962992640, 'STATUS_NON_BLANK_DEVICE_FUSES_2_FAIL', 'STATUS_NON_BLANK_DEVICE_FUSES_2_FAIL: Non blank Device fuses')#
- STATUS_NO_BLOB_IN_ADDRESS = (2768942360, 'STATUS_NO_BLOB_IN_ADDRESS', 'STATUS_NO_BLOB_IN_ADDRESS: No Secure Object present in given Flash memory address')#
- STATUS_NO_DEVICE_GROUP_PROVISIONING_KEY_FAIL = (2768292628, 'STATUS_NO_DEVICE_GROUP_PROVISIONING_KEY_FAIL', 'STATUS_NO_DEVICE_GROUP_PROVISIONING_KEY_FAIL: There is no DEVICE_GROUP_PROVISIONING_KEY Secure Object present in Flash')#
- STATUS_NO_MORE_SECURE_OBJECTS = (2768292611, 'STATUS_NO_MORE_SECURE_OBJECTS', 'STATUS_NO_MORE_SECURE_OBJECTS')#
- STATUS_NULL_POINTER_FAIL = (1963635990, 'STATUS_NULL_POINTER_FAIL', 'STATUS_NULL_POINTER_FAIL: Null pointer error')#
- STATUS_PARSE_BLOB_1_FAIL = (2768293889, 'STATUS_PARSE_BLOB_1_FAIL', "STATUS_PARSE_BLOB_1_FAIL: Failure in parsing an EdgeLock 2GO's Secure Object fields")#
- STATUS_PARSE_BLOB_2_FAIL = (2768292613, 'STATUS_PARSE_BLOB_2_FAIL', "STATUS_PARSE_BLOB_2_FAIL: Failure in parsing an EdgeLock 2GO's Secure Object fields")#
- STATUS_READ_CMPA_FAIL = (2768292648, 'STATUS_READ_CMPA_FAIL', 'STATUS_READ_CMPA_FAIL')#
- STATUS_READ_DEVICE_FUSES_1_FAIL = (1962993664, 'STATUS_READ_DEVICE_FUSES_1_FAIL', 'STATUS_READ_DEVICE_FUSES_1_FAIL: Failure in reading out Device fuses')#
- STATUS_READ_DEVICE_FUSES_2_FAIL = (1962993920, 'STATUS_READ_DEVICE_FUSES_2_FAIL', 'STATUS_READ_DEVICE_FUSES_2_FAIL: Failure in reading out Device fuses')#
- STATUS_READ_DEVICE_SHARES_FAIL = (2768292352, 'STATUS_READ_DEVICE_SHARES_FAIL', 'STATUS_READ_DEVICE_SHARES_FAIL')#
- STATUS_SBLOADER_FINALIZE_FAIL = (2768292659, 'STATUS_SBLOADER_FINALIZE_FAIL', 'STATUS_SBLOADER_FINALIZE_FAIL')#
- STATUS_SBLOADER_INIT_FAIL = (2768292656, 'STATUS_SBLOADER_INIT_FAIL', 'STATUS_SBLOADER_INIT_FAIL')#
- STATUS_SBLOADER_PUMP_FAIL = (2768292658, 'STATUS_SBLOADER_PUMP_FAIL', 'STATUS_SBLOADER_PUMP_FAIL')#
- STATUS_SBLOADER_UP_COMMANDSET_FAIL = (2768292657, 'STATUS_SBLOADER_UP_COMMANDSET_FAIL', 'STATUS_SBLOADER_UP_COMMANDSET_FAIL')#
- STATUS_SECTOR_COPY_FAIL = (2768292643, 'STATUS_SECTOR_COPY_FAIL', 'STATUS_SECTOR_COPY_FAIL: Flash sector size is too big')#
- STATUS_SECURE_BOOT_NOT_EN = (1963635991, 'STATUS_SECURE_BOOT_NOT_EN', 'STATUS_SECURE_BOOT_NOT_EN: Device Secure Boot not enabled')#
- STATUS_SIGN_FAIL = (2768292624, 'STATUS_SIGN_FAIL', 'STATUS_SIGN_FAIL: Signing of non-static Secure Object failed')#
- STATUS_UNSUPPORTED_ENC_ALG_FAIL = (2768292620, 'STATUS_UNSUPPORTED_ENC_ALG_FAIL', "STATUS_UNSUPPORTED_ENC_ALG_FAIL: Unsupported Secure Object's encryption algorithm")#
- STATUS_VALID_DER_LCS_FAIL = (2768942357, 'STATUS_VALID_DER_LCS_FAIL', 'STATUS_VALID_DER_LCS_FAIL Invalid device lifecycle')#
- STATUS_VALID_LCS_FAIL = (1962987536, 'STATUS_VALID_LCS_FAIL', 'STATUS_VALID_LCS_FAIL: Not valid device lifecycle')#
- STATUS_VALID_MEMORY_USE_OVERFLOW = (1963635986, 'STATUS_VALID_MEMORY_USE_OVERFLOW', 'STATUS_VALID_MEMORY_USE_OVERFLOW: Memory overflow')#
- STATUS_VERIFY_BLOB_1_FAILED = (2768293890, 'STATUS_VERIFY_BLOB_1_FAILED', "STATUS_VERIFY_BLOB_1_FAILED: Failure in verifying an EdgeLock 2GO's Secure Object")#
- STATUS_VERIFY_BLOB_2_FAILED = (2768293891, 'STATUS_VERIFY_BLOB_2_FAILED', "STATUS_VERIFY_BLOB_2_FAILED: Failure in verifying an EdgeLock 2GO's Secure Object")#
- STATUS_VERIFY_BLOB_3_FAILED = (2768292617, 'STATUS_VERIFY_BLOB_3_FAILED', "STATUS_VERIFY_BLOB_3_FAILED: Failure in verifying an EdgeLock 2GO's Secure Object")#
- STATUS_WRITE_DEVICE_FUSES_1_FAIL = (1962992896, 'STATUS_WRITE_DEVICE_FUSES_1_FAIL', 'STATUS_WRITE_DEVICE_FUSES_1_FAIL: Failure in programming Device fuses')#
- STATUS_WRITE_DEVICE_FUSES_2_FAIL = (1962993152, 'STATUS_WRITE_DEVICE_FUSES_2_FAIL', 'STATUS_WRITE_DEVICE_FUSES_2_FAIL: Failure in programming Device fuses')#
- STATUS_WRITE_DEVICE_FUSES_3_FAIL = (1962993408, 'STATUS_WRITE_DEVICE_FUSES_3_FAIL', 'STATUS_WRITE_DEVICE_FUSES_3_FAIL: Failure in programming Device fuses')#
- STATUS_WRITE_FLASH_FAIL = (2768292655, 'STATUS_WRITE_FLASH_FAIL', 'STATUS_WRITE_FLASH_FAIL')#
- STATUS_WRITING_IN_FLASH_FAIL = (2768292621, 'STATUS_WRITING_IN_FLASH_FAIL', 'STATUS_WRITING_IN_FLASH_FAIL: Writing in Flash failed')#
- STATUS_WRITING_PROV_REPORT_IN_FLASH_FAIL = (2768292626, 'STATUS_WRITING_PROV_REPORT_IN_FLASH_FAIL', 'STATUS_WRITING_PROV_REPORT_IN_FLASH_FAIL: Writing provisioning report to flash failed')#
- STATUS_WRONG_EL2GO_HOST_CMD = (2768292625, 'STATUS_WRONG_EL2GO_HOST_CMD', 'STATUS_WRONG_EL2GO_HOST_CMD: Invalid el2go-host command was used')#
- SUCCESS = (0, 'Success', 'Success')#
- TIMEOUT = (5, 'TimeoutError', 'Timeout Error')#
- TP_ADDRESS_ERROR = (80005, 'TP_ADDRESS_ERROR', 'TP: Address out of allowed range or buffer could not be allocated')#
- TP_ADDR_OUT_OF_RANGE = (80018, 'TP_ADDR_OUT_OF_RANGE', 'TP: Address is out of range')#
- TP_ALREADYINITIALIZED = (80003, 'TP_ALREADYINITIALIZED', 'TP: Already initialized')#
- TP_BUFFERSMALL = (80004, 'TP_BUFFERSMALL', 'TP: Buffer is too small')#
- TP_CERT_ADDR_ERROR = (80023, 'TP_CERT_ADDR_ERROR', 'TP: Destination address of OEM certificate is invalid')#
- TP_CERT_ADDR_UNALIGNED = (80024, 'TP_CERT_ADDR_UNALIGNED', 'TP: Destination address of certificate is unaligned')#
- TP_CERT_OVERLAPPING = (80025, 'TP_CERT_OVERLAPPING', 'TP: OEM certificates are overlapping due to wrong destination addresses')#
- TP_CFPA_ERROR = (80016, 'TP_CFPA_ERROR', 'TP: CFPA page cannot be stored')#
- TP_CMPA_ERROR = (80017, 'TP_CMPA_ERROR', 'TP: CMPA page cannot be stored or ROTKH or SECU registers are invalid')#
- TP_COMMAND_ERROR = (80010, 'TP_COMMAND_ERROR', 'TP: ISP command arguments are invalid')#
- TP_CONTAINERENTRYINVALID = (80007, 'TP_CONTAINERENTRYINVALID', 'TP: Container entry invalid')#
- TP_CONTAINERENTRYNOTFOUND = (80008, 'TP_CONTAINERENTRYNOTFOUND', 'TP: Container entry not found in container')#
- TP_CONTAINERINVALID = (80006, 'TP_CONTAINERINVALID', 'TP: Container header or size is invalid')#
- TP_CONTAINER_ADDR_ERROR = (80019, 'TP_CONTAINER_ADDR_ERROR', 'TP: Container address in write context is invalid or there is no memory for entry storage')#
- TP_CONTAINER_ADDR_UNALIGNED = (80020, 'TP_CONTAINER_ADDR_UNALIGNED', 'TP: Container address in read context is unaligned')#
- TP_CONTAINER_BUFF_SMALL = (80021, 'TP_CONTAINER_BUFF_SMALL', 'TP: There is not enough memory to store the container')#
- TP_CONTAINER_NO_ENTRY = (80022, 'TP_CONTAINER_NO_ENTRY', 'TP: Attempt to sign an empty container')#
- TP_CRYPTO_CRITICAL_ERROR = (80102, 'TP_CRYPTO_CRITICAL_ERROR', 'TP: Error of crypto module which prevents proper functionality')#
- TP_CRYPTO_ERROR = (80001, 'TP_CRYPTO_ERROR', 'TP: Error during cryptographic operation')#
- TP_FLASH_ERROR = (80012, 'TP_FLASH_ERROR', 'TP: Flash erase/program/verify_erase failed')#
- TP_GENERAL_CRITICAL_ERROR = (80101, 'TP_GENERAL_CRITICAL_ERROR', 'TP: Critical error')#
- TP_GENERAL_ERROR = (80000, 'TP_GENERAL_ERROR', 'TP: General error')#
- TP_INVALIDSTATEOPERATION = (80009, 'TP_INVALIDSTATEOPERATION', 'TP: Attempt to process command in disallowed state')#
- TP_NULLPTR_ERROR = (80002, 'TP_NULLPTR_ERROR', 'TP: NULL pointer dereference or when buffer could not be allocated')#
- TP_PACKET_DATA_ERROR = (80027, 'TP_PACKET_DATA_ERROR', 'TP: Data in packet handle are invalid')#
- TP_PACKET_ERROR = (80026, 'TP_PACKET_ERROR', 'TP: Error during packet sending/receiving')#
- TP_PERIPHERAL_CRITICAL_ERROR = (80105, 'TP_PERIPHERAL_CRITICAL_ERROR', 'TP: Peripheral failure')#
- TP_PFR_CRITICAL_ERROR = (80104, 'TP_PFR_CRITICAL_ERROR', 'TP: Initialization of PFR or reading of activation code failed')#
- TP_PFR_ERROR = (80014, 'TP_PFR_ERROR', 'TP: Protected Flash Region operation failed')#
- TP_PRINCE_CRITICAL_ERROR = (80106, 'TP_PRINCE_CRITICAL_ERROR', 'TP: Error during PRINCE encryption/decryption')#
- TP_PUF_CRITICAL_ERROR = (80103, 'TP_PUF_CRITICAL_ERROR', 'TP: Initialization or start of the PUF periphery failed')#
- TP_PUF_ERROR = (80011, 'TP_PUF_ERROR', 'TP: PUF operation error')#
- TP_SB3_FILE_ERROR = (80029, 'TP_SB3_FILE_ERROR', 'TP: Error during processing SB3 file')#
- TP_SECRETBOX_ERROR = (80013, 'TP_SECRETBOX_ERROR', 'TP: SBKEK or USER KEK cannot be stored in secret box')#
- TP_SHA_CHECK_CRITICAL_ERROR = (80107, 'TP_SHA_CHECK_CRITICAL_ERROR', 'TP: SHA check verification failed')#
- TP_SUCCESS = (0, 'TP_SUCCESS', 'TP: SUCCESS')#
- TP_UNKNOWN_COMMAND = (80028, 'TP_UNKNOWN_COMMAND', 'TP: Unknown command was received')#
- TP_VERIFICATION_ERROR = (80015, 'TP_VERIFICATION_ERROR', 'TP: Container signature verification failed')#
- UNKNOWN_COMMAND = (10000, 'UnknownCommand', 'Unknown Command')#
- UNKNOWN_PROPERTY = (10300, 'UnknownProperty', 'Unknown Property')#
- UNSUPPORTED_COMMAND = (10006, 'UnsupportedCommand', 'Unsupported Command')#
- XSPINOR_WRITE_ALIGNMENT_ERROR = (20905, 'xSPINORWriteAlignmentError', 'xSPINOR: Write Alignment Error')#
- spsdk.mboot.error_codes.stringify_status_code(status_code)#
Convert MBoot status code to human-readable string representation.
The method formats the status code as both decimal and hexadecimal values, and appends the corresponding description if available in StatusCode enum.
- Parameters:
status_code (
int) – The MBoot status code to convert.- Return type:
str- Returns:
Formatted string containing status code and its description.
MBoot Exceptions#
SPSDK MBoot exception classes and error handling utilities.
This module defines custom exception classes for the MBoot (MCU Boot) protocol implementation, providing structured error handling for bootloader communication, command execution, and data transfer operations.
- exception spsdk.mboot.exceptions.McuBootCommandError(cmd, value)#
Bases:
McuBootErrorMcuBootCommandError exception for MBoot command failures.
This exception is raised when an MBoot command execution is interrupted or fails, providing detailed error information including the command name and error description based on status codes.
- Variables:
fmt – Format string template for error message display.
Initialize the Command Error exception.
- Parameters:
cmd (
str) – Name of the command causing the exception.value (
int) – Response value causing the exception.
- fmt = 'MBoot: {cmd_name} interrupted -> {description}'#
- exception spsdk.mboot.exceptions.McuBootConnectionError(desc=None)#
Bases:
SPSDKConnectionError,McuBootErrorMcuBoot connection error exception.
This exception is raised when communication issues occur during McuBoot operations, such as device connection failures, timeout errors, or communication protocol problems.
- Variables:
fmt – Error message format template for connection-related issues.
Initialize the base SPSDK Exception.
- Parameters:
desc (
Optional[str]) – Optional description of the exception.
- fmt = 'MBoot: Connection issue -> {description}'#
- exception spsdk.mboot.exceptions.McuBootDataAbortError(desc=None)#
Bases:
McuBootErrorMcuBootDataAbortError exception for data phase abortion scenarios.
This exception is raised when the data transmission phase is aborted by the sender during MCU boot operations, indicating an interruption in the data transfer process.
- Variables:
fmt – Default error message format for data abortion scenarios.
Initialize the base SPSDK Exception.
- Parameters:
desc (
Optional[str]) – Optional description of the exception.
- fmt = 'Mboot: Data aborted by sender'#
- exception spsdk.mboot.exceptions.McuBootError(desc=None)#
Bases:
SPSDKErrorBase exception class for MCU Boot operations.
This exception serves as the foundation for all MCU Boot related errors in the SPSDK library, providing standardized error formatting and handling.
- Variables:
fmt – Default error message format template.
Initialize the base SPSDK Exception.
- Parameters:
desc (
Optional[str]) – Optional description of the exception.
- fmt = 'MBoot: {description}'#
MBoot Protocol#
SPSDK MBoot protocol base implementation.
This module provides the base protocol class for MBoot communication, defining the fundamental interface and common functionality for MBoot protocol implementations across different transport layers.
- class spsdk.mboot.protocol.base.MbootProtocolBase(device)#
Bases:
ProtocolBaseMBoot protocol base class for secure provisioning operations.
This class serves as the foundation for MBoot protocol implementations, providing common functionality and configuration for communication with NXP MCU devices during secure provisioning processes.
- Variables:
allow_abort – Controls whether protocol operations can be aborted.
need_data_split – Indicates if large data transfers require splitting.
Initialize the MbootSerialProtocol object.
- Parameters:
device (
DeviceBase) – The device instance to be used for communication.
-
allow_abort:
bool= False#
-
need_data_split:
bool= True#
MBoot Bulk#
SPSDK MBoot bulk protocol implementation.
This module provides the bulk protocol interface for MBoot communication, enabling efficient data transfer operations between host and target devices. The module implements the ReportId enumeration for protocol identification and MbootBulkProtocol class for handling bulk transfer operations.
- class spsdk.mboot.protocol.bulk_protocol.MbootBulkProtocol(device)#
Bases:
MbootProtocolBaseMboot Bulk Protocol implementation for USB/HID communication.
This class provides bulk transfer protocol implementation for Mboot communication over USB HID interfaces. It handles frame encapsulation, data transmission, and abort detection for reliable MCU boot operations.
Initialize the MbootSerialProtocol object.
- Parameters:
device (
DeviceBase) – The device instance to be used for communication.
- close()#
Close the interface.
Closes the underlying device connection and releases any associated resources.
- Return type:
None
- property is_opened: bool#
Indicates whether the bulk protocol interface is open.
- Returns:
True if interface is open, False otherwise.
- open()#
Open the interface.
Establishes connection to the bulk protocol device interface.
- Raises:
SPSDKError – If the device interface fails to open.
- Return type:
None
- read(length=None)#
Read data from device.
Reads up to 1024 bytes from the connected device and parses the received frame into a command response or raw bytes.
- Parameters:
length (
Optional[int]) – Maximum number of bytes to read (currently unused, reads fixed 1024 bytes).- Return type:
Union[CmdResponse,bytes]- Returns:
Parsed command response or raw bytes data from device.
- Raises:
SPSDKTimeoutError – When timeout occurs or no data can be read from device.
- write_command(packet)#
Encapsulate command into frames and send them to device.
- Parameters:
packet (
CmdPacketBase) – Command packet object to be sent- Raises:
SPSDKAttributeError – Command packet contains no data to be sent
- Return type:
None
- write_data(data)#
Encapsulate data into frames and send them to device.
The method creates a frame from the provided data and sends it to the device. If abort functionality is enabled, it first checks for any abort data from the device before sending the frame.
- Parameters:
data (
bytes) – Data to be sent to the device.- Raises:
McuBootConnectionError – If there’s a communication error with the device.
McuBootDataAbortError – If abort data is received from the device.
- Return type:
None
- class spsdk.mboot.protocol.bulk_protocol.ReportId(tag, label, description=None)#
Bases:
SpsdkEnumHID Report ID enumeration for bulk protocol communication.
This enumeration defines the standard HID report identifiers used in bulk protocol operations for command and data transfer between host and device.
- CMD_IN = (3, 'CMD_IN')#
- CMD_OUT = (1, 'CMD_OUT')#
- DATA_IN = (4, 'DATA_IN')#
- DATA_OUT = (2, 'DATA_OUT')#
MBoot Serial#
SPSDK Mboot serial protocol implementation.
This module provides the serial communication protocol implementation for Mboot, including protocol handling, response parsing, and serial interface management for NXP MCU bootloader communication.
- class spsdk.mboot.protocol.serial_protocol.FPType(tag, label, description=None)#
Bases:
SpsdkEnumFrame Protocol Type enumeration for serial communication.
This enumeration defines the different types of frames used in the serial communication protocol, including acknowledgment, data transfer, and control frames.
- ABORT = (163, 'ABORT')#
- ACK = (161, 'ACK')#
- CMD = (164, 'CMD')#
- DATA = (165, 'DATA')#
- NACK = (162, 'NACK')#
- PING = (166, 'PING')#
- PINGR = (167, 'PINGR')#
- class spsdk.mboot.protocol.serial_protocol.MbootSerialProtocol(device)#
Bases:
MbootProtocolBaseMboot Serial Protocol implementation for UART communication.
This class provides serial communication protocol implementation for Mboot operations over UART interface. It handles frame encapsulation, device connection management, and protocol-specific communication patterns.
- Variables:
FRAME_START_BYTE – Start byte marker for serial frames.
PING_TIMEOUT_MS – Timeout in milliseconds for ping operations.
MAX_UART_OPEN_ATTEMPTS – Maximum number of attempts to open UART interface.
Initialize the MbootSerialProtocol object.
- Parameters:
device (
DeviceBase) – The device instance to be used for communication.
- FRAME_START_BYTE = 90#
- FRAME_START_NOT_READY_LIST = [0]#
- MAX_PING_RESPONSE_DUMMY_BYTES = 50#
- MAX_UART_OPEN_ATTEMPTS = 3#
- PING_TIMEOUT_MS = 500#
- close()#
Close the serial communication interface.
This method properly closes the underlying serial device connection and releases any associated resources.
- Raises:
SPSDKError – If closing the device fails.
- Return type:
None
- property is_opened: bool#
Indicates whether the serial interface is open.
- Returns:
True if the interface is open, False otherwise.
- open()#
Open the UART interface with retry mechanism.
Attempts to open the UART device connection up to MAX_UART_OPEN_ATTEMPTS times. Each attempt includes opening the device and performing a ping operation to verify connectivity. If any attempt fails, the interface is closed before retrying.
- Raises:
McuBootConnectionError – When UART open operation fails after all retry attempts or when an unexpected error occurs during the process.
- Return type:
None
-
options:
int= 0#
- ping_timeout(timeout=500)#
Context manager for temporarily changing UART timeout.
Temporarily sets a new timeout value for the UART device, ensuring it doesn’t exceed the original timeout. The device driver is reconfigured after timeout changes with small delays to ensure proper operation.
- Parameters:
timeout (
int) – New temporary timeout in milliseconds, defaults to PING_TIMEOUT_MS- Return type:
Generator[None,None,None]
-
protocol_version:
int= 0#
- read(length=None)#
Read data from device using the serial protocol.
The method reads a complete frame including header, length, CRC, and data payload. It validates the frame integrity and returns either a parsed command response or raw data.
- Parameters:
length (
Optional[int]) – Optional parameter (currently unused in implementation).- Return type:
Union[CmdResponse,bytes]- Returns:
Parsed command response if frame type is CMD, otherwise raw data bytes.
- Raises:
McuBootDataAbortError – Indicates data transmission abort when length is zero.
McuBootConnectionError – When received CRC doesn’t match calculated CRC.
- write_command(packet)#
Encapsulate command into frames and send them to device.
- Parameters:
packet (
CmdPacketBase) – Command packet object to be sent- Raises:
SPSDKAttributeError – Command packet contains no data to be sent
- Return type:
None
- write_data(data)#
Encapsulate data into frames and send them to device.
This method takes raw data bytes, wraps them in a protocol frame with DATA type, and transmits the frame to the connected device using the serial interface.
- Parameters:
data (
bytes) – Raw data bytes to be encapsulated and transmitted to device.- Return type:
None
- class spsdk.mboot.protocol.serial_protocol.PingResponse(version: int, options: int, crc: int)#
Bases:
NamedTupleMcuBoot ping command response data structure.
This NamedTuple represents the structured response from an MCU ping command, containing version information, options flags, and CRC validation data.
Create new instance of PingResponse(version, options, crc)
-
crc:
int# Alias for field number 2
-
options:
int# Alias for field number 1
- classmethod parse(data)#
Parse raw data into PingResponse object.
The method unpacks binary data containing version, options, and CRC16 checksum into a structured PingResponse object using little-endian format.
- Parameters:
data (
bytes) – Raw bytes to be unpacked (4B version, 2B options, 2B CRC16).- Raises:
McuBootConnectionError – Received invalid ping response format.
- Return type:
Self- Returns:
PingResponse object with parsed data.
-
version:
int# Alias for field number 0
-
crc:
- spsdk.mboot.protocol.serial_protocol.to_int(data, little_endian=True)#
Convert bytes into single integer.
The method converts a byte sequence to an integer value using specified endianness.
- Parameters:
data (
bytes) – Bytes to convert to integer.little_endian (
bool) – Indicate byte ordering in data, defaults to True.
- Return type:
int- Returns:
Converted integer value.