Skip to main content

TECH VEDA

Corporate on-site training - Submit proposal Pick your modulesSharpen your kernel skills: deep dives, drivers, Yocto, CVEs, careers — updated daily. Read the blog →
Tool Spotlight

i2cdetect Bus Scan: Does the Chip Answer at Its Address?

An i2cdetect bus scan shows whether a chip answers at its I2C address. Commands in i2c-tools 4.4, a driver-probe workflow, and the limits.

i2cdetect Bus Scan: Does the Chip Answer at Its Address?

When a driver for an I2C chip does not probe, the first question is whether the chip answers at its address at all. An i2cdetect bus scan answers that from the shell of the target, and the other programs in the i2c-tools package read single registers and send complete transfers. This article covers the commands worth knowing in version 4.4, one workflow from a silent driver to a register value, and the limits of the tools.

A new board arrives, the kernel boots, and the temperature sensor that should appear under hwmon is missing. The fault may be in the device tree, in the kernel configuration, or on the board. A bus scan with i2cdetect separates the hardware question from the software question.

The problem: a driver that did not probe

When a driver fails to bind to an I2C chip, the kernel log often shows one error code or nothing. The TECH VEDA article on the I2C transfer timeout describes what the kernel does when a transfer is not completed. Before reading driver code, establish two facts from user space: does any chip acknowledge the address, and does it return the identification value given in its datasheet?

What i2c-tools is

i2c-tools is a set of user-space programs for Linux with a small library, libi2c. The source is kept on git.kernel.org. The current release is 4.4, tagged on 10 October 2024; the repository has no newer tag. Development continues: the newest commits on the master branch were committed on 16 November 2026. The manual pages name Jean Delvare as maintainer, and the recent commits were committed by Wolfram Sang.

Most tools are released under the GNU GPL version 2 or later, and the library under the LGPL version 2.1 or later.

Get it

On a target that runs Debian, the package is i2c-tools. Debian stable carries 4.4-2 and oldstable carries 4.3-2. Ubuntu carries the same source package. The command below changes the target by installing a package.

root@beagleplay:~# apt install i2c-tools

In a Yocto Project build the recipe is i2c-tools in openembedded-core (meta/recipes-devtools/i2c-tools, version 4.4 on the master branch). Add i2c-tools to IMAGE_INSTALL. In Buildroot the option is BR2_PACKAGE_I2C_TOOLS, also at 4.4, and it is visible only when BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is enabled.

There is no configure script. The 4.4 Makefile accepts the compiler and archiver on the command line:

raghu@techveda.org:~$ git clone https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git
raghu@techveda.org:~$ git -C i2c-tools checkout v4.4
raghu@techveda.org:~$ make -C i2c-tools CC=aarch64-linux-gnu-gcc AR=aarch64-linux-gnu-ar

The CROSS_COMPILE variable in the README of the master branch was added after 4.4.

The commands worth knowing, from an i2cdetect bus scan to one transfer

All five programs run on the target. Without -y, every form that accesses the bus prints a warning and waits for confirmation.

1. List the buses and their capabilities. These two forms send nothing to any chip.

root@beagleplay:~# i2cdetect -l
root@beagleplay:~# i2cdetect -F 2

-l lists the installed buses, one per line, with the bus number and the adapter name. -F prints the functions that the adapter of bus 2 implements, each marked yes or no. Use both first: the kernel documentation warns that adapter numbers can change from one boot to the next.

2. Scan one bus. This form sends a probe command to every address in the range.

root@beagleplay:~# i2cdetect -y 2

The bus scan prints a table of all 7-bit addresses and by default probes 0x08 to 0x77. According to the manual page each cell holds one of three symbols: -- means the address was probed and no chip answered; a hexadecimal number such as 48 means a chip was found there; UU means probing was skipped because a driver is using that address. I2C has no standard detection command, so the tool uses an SMBus quick write for most addresses and an SMBus receive byte for 0x30 to 0x37 and 0x50 to 0x5f.

3. Read one register.

root@beagleplay:~# i2cget -y 2 0x48 0x00 w

The arguments are bus, chip address, register address and mode. Mode b, the default, reads a byte; w reads a 16-bit word; i performs an I2C block read of 1 to 32 bytes.

4. Dump a range of registers.

root@beagleplay:~# i2cdump -y -r 0x00-0x0f 2 0x48

-r limits the dump to the registers you name. Use it always: a full dump reads registers whose side effects you may not know.

5. Send one complete transfer.

root@beagleplay:~# i2ctransfer -y 2 w1@0x48 0x00 r2

Each descriptor is r or w, a length, and an address that is given once and reused. This example writes one byte, the register pointer 0x00, then reads two bytes in the same transfer, joined by a repeated START. Use it when the pointer write and the read must stay together, or when the chip uses 16-bit register addresses.

The form that changes the chip. i2cset writes to a register. Read the register first with i2cget, and leave out -y so that the tool asks before it writes.

root@beagleplay:~# i2cset 2 0x48 0x01 0x60

This writes 0x60 to register 0x01. -m takes a mask so that only selected bits change, and -r reads the value back and compares it.

One workflow: is the sensor at 0x48 present?

The device tree declares a temperature sensor at address 0x48 on one of the I2C controllers of the SoC, and no hwmon device appears.

  1. Run i2cdetect -l and find the bus whose adapter name matches the controller. Assume it is bus 2.
  2. Run i2cdetect -F 2 and confirm that the line for SMBus Quick Command or SMBus Receive Byte says yes. Without one of them the bus scan cannot run.
  3. Run i2cdetect -y 2 and read the cell in row 40, column 8.
  4. If the cell shows 48, read the identification register named in the datasheet with i2cget and compare the value.

The content of that cell decides what to examine next. -- means nothing acknowledged the probe: check the supply, the reset line, the address pins, the pin multiplexing and the pull-up resistors. 48 with the correct identification value means the electrical path works and no driver holds the address: the driver is not built, or the device node does not match it. UU means a driver did bind, and the missing hwmon device has another cause. These conclusions are engineering reasoning, not statements from the manual page.

Limits

  • Kernel configuration. The tools open /dev/i2c-N, which exists only with CONFIG_I2C_CHARDEV built in or with the i2c-dev module loaded.
  • Adapter functions. i2ctransfer refuses to run unless the adapter reports plain I2C transfers, and it does not support 10-bit addresses.
  • A scan is not passive. The manual pages warn that probing can confuse a bus and that some chips take a read as a write. Do not run a bus scan on a deployed product without knowing which chips are attached.
  • A bound driver. The read and write tools refuse an address that a kernel driver controls. -f overrides this, and the manual page calls it dangerous.
  • What the tools cannot tell you. A number in the table shows that something acknowledged the address, not which chip it is, and -- does not say why nothing answered. Signal quality needs an oscilloscope or a logic analyser. To see the messages that a kernel driver sends, use the kernel trace events i2c_write, i2c_read, i2c_reply and i2c_result.
  • Version differences. Release 4.4 removed the SMBus block mode from i2cdump. Device file paths as the bus argument exist only on the master branch.

What was checked and what could not be verified

Checked on 21 November 2026: the repository tags and commit log; the README, CHANGES file, Makefile, five manual pages and tool sources at tag v4.4; the Debian package tracker; the openembedded-core recipe; the Buildroot package files; and the three Linux 7.3 files listed in the references.

Not verified: no command was run on a board, so no output is shown; the three symbols are taken from the manual page. No cross build was run. The README names no unsupported architecture, and none was tested. The Ubuntu binary package name was not confirmed. BusyBox provides programs with the same names; their options were not compared.

Key takeaways

  • Run i2cdetect -l and -F first; they send nothing to any chip.
  • A bus scan answers one question: does anything acknowledge this address?
  • Read before you write, and keep the confirmation prompt for i2cset.
Was this worth your time?

Frequently asked questions

What does UU mean in the i2cdetect table?

Probing of that address was skipped because a kernel driver is using it. The manual page says this strongly suggests that a chip is present at the address.

Which kernel option do the i2c-tools programs need?

They need CONFIG_I2C_CHARDEV, built in or loaded as the i2c-dev module, because they work through the /dev/i2c-N device files.

Is an i2cdetect bus scan safe on any board?

No. The scan sends a probe command to every address in the range, and the manual page warns that this can confuse a bus. The forms i2cdetect -l and i2cdetect -F send nothing to any chip.

References

RB
Raghu Bharadwaj

Founder, TECH VEDA — 20+ years teaching the Linux kernel, device drivers and embedded systems.

Follow on LinkedIn

Get new posts by email

Kernel, embedded Linux and AI-era engineering — a few sharp reads a month. No spam.

We email occasionally and never share your address.