i2c-tools
Heterogeneous set of I2C tools for Linux including bus probing, chip dumping, register access, and EEPROM decoding. Provides userspace access to I2C devices and related protocols.
Description
i2c-tools is a package containing various utilities for interacting with I2C buses on Linux systems. It includes tools for detecting chips, dumping registers, reading and writing data, and decoding EEPROM contents from memory modules or specific hardware like Sony Vaio laptops. These tools are essential for hardware debugging, firmware analysis, and low-level device communication.
Use cases include probing I2C buses to identify connected devices, examining register contents for reverse engineering, and extracting configuration data from EEPROMs. The package also offers development libraries for custom I2C programming and Python bindings for SMBus access, enabling scripted interactions without kernel driver dependencies.
Related components like libi2c-dev and python3-smbus extend functionality for compiling user-space I2C applications and integrating with Python scripts on hosts with I2C kernel support.
How It Works
The tools operate through the Linux I2C /dev interface, leveraging kernel I2C support, device interfaces, and bus adapter drivers. Utilities like i2cdetect probe buses for chip addresses, i2cdump reads registers in modes such as byte, word, or block with optional SMBus PEC. i2cget/i2cset handle read/write operations on registers, while i2ctransfer sends custom message sequences. Decoding scripts parse hex dumps from EEPROMs, accounting for endianness issues in formats like hexdump -C. Userspace libraries bypass kernel drivers for direct adapter access.
Installation
sudo apt install i2c-toolsFlags
Examples
decode-dimms -hdecode-vaio -hi2c-stub-from-dump -hi2cdetect -hi2cdump -hi2cget -hi2cset -hi2ctransfer 0 w1@0x50 0x64 r8