Chip ID
The ChipId class parses and provides access to chip identification information from the TROPIC01 secure element.
- class tropicsquare.chip_id.ChipId(data)[source]
Bases:
objectTROPC01 Chip ID structure parser
This class parses the 128-byte chip identification structure that contains comprehensive information about the chip including manufacturing data, provisioning information, firmware versions, and serial number.
The structure follows the lt_chip_id_t layout from libtropic with all fields properly parsed and exposed as attributes.
Structure layout (128 bytes total):
Bytes 0-3: Chip ID version (4 bytes)
Bytes 4-19: Factory level chip info (16 bytes)
Bytes 20-27: Functional test info (8 bytes)
Bytes 28-31: Silicon revision (4 bytes, ASCII)
Bytes 32-33: Package type ID (2 bytes, big-endian)
Bytes 34-35: Reserved field 1 (2 bytes)
Bytes 36-39: Provisioning info - version/fab/part number (4 bytes, big-endian)
Bytes 40-41: Provisioning date (2 bytes, big-endian)
Bytes 42-45: HSM version (4 bytes)
Bytes 46-49: Program version (4 bytes)
Bytes 50-51: Reserved field 2 (2 bytes)
Bytes 52-67: Serial number structure (16 bytes)
Bytes 68-83: Part number data (16 bytes)
Bytes 84-85: Provisioning template version (2 bytes, big-endian)
Bytes 86-89: Provisioning template tag (4 bytes)
Bytes 90-91: Provisioning specification version (2 bytes, big-endian)
Bytes 92-95: Provisioning specification tag (4 bytes)
Bytes 96-100: Batch ID (5 bytes)
Bytes 101-103: Reserved field 3 (3 bytes)
Bytes 104-127: Reserved field 4 / Padding (24 bytes)
- Parameters:
data (bytes)
- serial_number
Parsed serial number structure
- Type:
- __init__(data)[source]
Parse chip ID from raw bytes
- Parameters:
data (bytes) – Raw chip ID bytes (must be exactly 128 bytes)
- Raises:
ValueError – If data length is not 128 bytes
- __str__()[source]
Get human-readable multi-line string representation
- Returns:
Multi-line formatted string with key chip ID information
- Return type:
Chip ID Structure
The chip ID contains:
Serial number - Unique chip identifier
Hardware revision - Chip hardware version
Firmware version - Chip firmware version
Manufacturing data - Additional manufacturing information
See Also
Serial Number - Serial number utilities
TropicSquare Core Class - TropicSquare.chip_id property