LinuxCommandLibrary

i2cdump

Dump I2C device registers

TLDR

Dump all registers of an I2C device

$ i2cdump [i2cbus] [device_address]
copy

Dump all registers of an I2C device without asking for confirmation
$ i2cdump -y [i2cbus] [device_address]
copy

Dump all registers of an I2C device using a specific mode
$ i2cdump [i2cbus] [device_address] [b|w|c|s|i]
copy

Dump registers from start to end of an I2C device
$ i2cdump -r [start]-[end] [i2cbus] [device_address]
copy

SYNOPSIS

i2cdump [OPTION]... I2CBUS ADDRESS [MODE]

PARAMETERS

-D name, --device=name
    Use specific I2C device file (e.g. /dev/i2c-3) instead of probing

-f, --force
    Force access to device even if adapter driver reports errors or exclusive control

-y, --yes
    Disable interactive prompts for confirmation

-r first-last, --repeat=first,last
    Repeat dump only from register first to last (hexadecimal)

-V, --version
    Display version information and exit

-h, --help
    Show help message and exit

DESCRIPTION

i2cdump is a command-line utility from the i2c-tools package designed to read and display the contents of registers from I2C (Inter-Integrated Circuit) slave devices on Linux systems. It is primarily used for debugging, inspecting, and verifying data on I2C peripherals such as EEPROMs, temperature sensors, accelerometers, real-time clocks, and PMICs.

The tool connects to a specified I2C bus (via /dev/i2c-N devices) and performs read operations from the slave's address, dumping register values in a formatted hexadecimal output resembling a memory dump. By default, it probes registers from 0x00 to 0xFF, but ranges can be limited. It supports various read modes to match device protocols: byte, word, sequential, or block reads.

Access typically requires root privileges or membership in the i2c group. It handles SMBus extensions like PEC (Packet Error Checking) if the adapter supports it. Common use cases include checking EEPROM contents during firmware updates, reading sensor calibration data, or diagnosing communication failures in embedded systems. Output can be redirected to files for analysis with tools like hexdump or xxd.

While read-only, aggressive probing on active devices may cause temporary glitches, so caution is advised on production hardware.

CAVEATS

Requires root or i2c group access to /dev/i2c-*; forcing access (-f) may interfere with drivers; probing sensitive devices risks glitches or data corruption; not all adapters support all modes.

MODES

MODE controls dump format: b (byte), w (word, 16-bit), s (sequential byte block), i (I2C block); append 0 for SMBus PEC block reads (e.g. b0). Default: b.

EXAMPLE

i2cdump -y 1 0x50
Dumps EEPROM at address 0x50 on bus 1 without prompts.
i2cdump -f -r 0x00-0x1f 2 0x68 w
Forces word dump of registers 0x00-0x1F on bus 2, address 0x68.

HISTORY

Developed as part of i2c-tools package, initially by Frodo Looijaard in early 2000s for Linux I2C/SMBus support; maintained by Jean Delvare and others; integrated into kernel's I2C subsystem evolution, with stable features since kernel 2.6 era.

SEE ALSO

i2cdetect(1), i2cget(1), i2cset(1), i2ctransfer(1)

Copied to clipboard