2

I have a custom system running on a Raspberry Pi B+ V1.2, based on Debian Jessie (buildroot, systemd, udev) - not Raspbian - and a custom built 3.19.3 Kernel chainloaded by U-Boot and a custom init script (you see I am not unfamiliar with Linux low-level stuff - although I have little experience with I²C under Linux).

Everything is working fine (including HDMI, USB, Ethernet), but I can't get I²C working (which I do need for a DS3231 RTC). Both /sys/class/i2c-adapter and /sys/class/i2c-dev remain empty no matter what I do and no /dev/i2c* device wants to appear.

Obviously i2cdetect aborts with an error, too, because the I²C devices are missing.

I guess it's some simple config I'm missing, but I can't find out what it is.

My bootloader config.txt contains only a few entries:

dtparam=i2c_arm=on
dtparam=spi=on
dtoverlay=i2c-rtc,ds3231
kernel=u-boot.bin

Relevant I2C Kernel configs:

cat .config  | grep -F I2C | grep -v "^#"
CONFIG_REGMAP_I2C=m
CONFIG_INPUT_AD714X_I2C=m
CONFIG_INPUT_ADXL34X_I2C=m
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=m
CONFIG_I2C_MUX=m
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_BCM2708=m
CONFIG_I2C_BCM2708_BAUDRATE=100000
CONFIG_STMPE_I2C=y
CONFIG_MFD_ARIZONA_I2C=m
CONFIG_I2C_SI470X=m
CONFIG_I2C_SI4713=m
CONFIG_VIDEO_IR_I2C=m
CONFIG_SND_SOC_I2C_AND_SPI=m
CONFIG_SND_SOC_PCM512x_I2C=m

Calling modprobe i2c-dev and modprobe i2c-bcm2708 succeeds without any error message. Kernel log just says i2c /dev entries driver.

What am I doing wrong? Any additional module necessary? Some important line in config.txt missing? ...?

Update

The problem probably is that in my case the Raspberry bootloader doesn't boot Linux directly. Instead, U-Boot is in between, which (1) doesn't care about the device tree settings of the earlier bootloader and (2) doesn't seem to support device tree overlays by itself. I opened a related question to perhaps solve that problem.

1 Answer 1

1

Provided your kernel supports device tree you just need dtoverlay=i2c-rtc,ds3231 in /boot/config.txt.

That should let the RTC work as it is accessed through the kernel.

If you want to access I2C devices from userland then you need dtparam=i2c_arm=on in /boot/config.txt and i2c-dev in /etc/modules.

Make sure i2c_bcm2708 is not in /etc/modules.

Device tree will automatically load i2c_bcm2708 (it will not load i2c_dev).

2
  • Thanks for your answer. I don't doubt it is correct what you say, but check my update in the question - in my case the problem is probably more complicated.
    – Udo G
    Commented Jan 21, 2016 at 10:18
  • @UdoG I'm afraid once you diverge from the standard kernels all bets are off. You need to hope that someone else who has done similar had the same problem.
    – joan
    Commented Jan 21, 2016 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.