Monday, February 2, 2015

Problem with I2C on Raspberry Pi after Raspbian update

Problem with I2C on Raspberry Pi after Raspbian update 

 Problem

My DS3231 does not work on Raspberry Pi after update for Linux 3.18.5+ :(

Solution

The latest firmware implements device tree support. That will have broken things like I2C, SPI, and 1-wire bus.



All that we need to do for I2C enabling - add one string to /boot/config.txt
We can edit this file with this command:

sudo nano /boot/config.txt

we need add this string (for Rasberry Pi model B rev. 2 or other older devices):

dtparam=i2c0=on 

or this one (for newer devices):

dtparam=i2c1=on

and reboot after that:

sudo reboot

That's all. Enjoy!

More info about new /boot/config.txt possibilities:

Add one or more of the following to your /boot/config.txt and reboot.

I2C
Add dtparam=i2c1=on (or dtparam=i2c0=on on old models)

SPI
Add dtparam=spi=on

I2S
Add dtparam=i2s=on

lirc-rpi
Add dtoverlay=lirc-rpi
Add module parameters to the end of the dtoverlay line,
e.g. dtoverlay=lirc-rpi,gpio_in_pin=16,gpio_in_pull=high

w1-gpio
If you require the external pullup
dtoverlay=w1-gpio-pullup,gpiopin=x,pullup=y
otherwise
dtoverlay=w1-gpio-pullup,gpiopin=x
(where x and y are gpios).

Audio card
Add one of the following
dtoverlay=hifiberry-dac
dtoverlay=hifiberry-dacplus
dtoverlay=hifiberry-digi
dtoverlay=iqaudio-dac
dtoverlay=iqaudio-dacplus

heartbeat LED
dtparam=act_led_trigger=heartbeat


No comments:

Post a Comment