...
Builds TLV-formatted payloads.
Writes the data into an EEPROM via I2C.
Supports custom-defined keys.
Calculates and appends a CRC checksum to ensure data integrity.
...
Anchor | ||||
---|---|---|---|---|
|
To ensure all required dependencies are installed, run:
Code Block |
---|
sudo apt update
sudo apt install python3 python3-smbus |
this will:
Install Python 3 if it is not already installed.
Install smbus for I2C communication.
...
Anchor | ||||
---|---|---|---|---|
|
...
We want to run the following command (Note that bus 3 address 0X50 is used in this example):
Code Block |
---|
python3 TLV_writeTLVwriter.py 3 0x50 TLV_CODE_SYS_NAME "MySystem" TLV_CODE_SYS_VERSION "1.0" |
Panel | ||
---|---|---|
| ||
eeprom example for this :
00: 54 6c 76 49 6e 66 6f 00 01 65 0030 0e 45 6d 62 TlvInfo.?e.0?Emb header version Total Payload Length (little endian) Type Length Value crc checksum TLV |
...
TLV Key | Max Length (bytes) | BIOS path |
TLV_CODE_FAMILY | 20 | - |
TLV_CODE_MANUF_DATE | 10 | - |
TLV_CODE_PLATFORM_NAME | 20 | - |
TLV_CODE_MANUF_NAME | 20 | - |
TLV_CODE_VENDOR_NAME | 20 | - |
TLV_CODE_SYS_NAME | 20- | Main → Detailed Configuration Information → Model |
TLV_CODE_SYS_SKU | 20 | Main screen |
TLV_CODE_SYS_SERIAL_NUMBER | 24 | Main screen |
TLV_CODE_SYS_VERSION | 5 | - |
NIO Information (SMBUS Type
...
2)
TLV Key | Max Length (bytes) |
TLV_CODE_NIO_NAME | 20 |
TLV_CODE_NIO_SERIAL_NUMBER | 24 |
TLV_CODE_NIO_VERSION | 5 |
Chassis Information (SMBUS Type
...
3)
TLV Key | Max Length (bytes) |
TLV_CODE_CHS_SERIAL_NUMBER | 24 |
TLV_CODE_CHS_VERSION | 5 |
TLV Key | Max Length (bytes) | BIOS path |
TLV_CODE_CONFIG_CODE | 200 |
...
This entry will only be displayed in BIOS main menu.
Main → Detailed Configuration Information → Configuration String |
...
Anchor | ||||
---|---|---|---|---|
|
...
Error Message | Cause |
| Provided TLV key is not in the supported list. |
| Input exceeds the maximum allowed length. |
| Incorrect MAC format. |
| I2C communication issue during EEPROM write. |
| Data is too large for EEPROM storage. |
...
Code Block |
---|
sudo apt update
sudo apt install python3 python3-smbus |
this will:
Install Python 3 if it is not already installed.
Install smbus for I2C communication.
The script also requires the following Python modules, which are typically built-in:
sys
struct
binascii
time
To verify that all required Python modules are available, run:
Code Block |
---|
python3 -c "import struct, binascii, sys, time; print('All built-in modules are available')" |
...
. |
...