[Solved] I2C on Raspberry Pi 3 target not working

Has anyone got I2C working on a Raspberry Pi 3 ?
I am using openwrt-18.06.2 stable release.
I have looked at the /boot/config.txt file and i2c is enabled (dtparam=i2c1=on)
I compiled raspi-gpio from sources (had to modify it to work) and it shows i2c not enabled on any GPIO pins.
What am I missing here?

I have found the solution!

First of all I went back to 32 bit Raspberry Pi target - bcrm2708 - bcrm2709 - Raspberry Pi 3 / 3B / CM3 32 bit. The image will have rpi2 in its name, but it still runs on rpi3 /cm3.

Then I installed the packages:
+kmod-i2c-bcm2835
+kmod-i2c-core
+kmod-spi-bcm2835
+kmod-spi-bcm2835-aux
+kmod-spi-dev

this allowed pin alternate functions - like I2C and SPI - on the relevant pins.

my final goal was to compile sc16is7xx.c, and you need to comment (#) out the dtparams in the /boot/config.txt in order to change the pins from dev/user mode, to kernel driver mode.

adding dtoverlay=sc16is752-spi1 is not enough, you still need to compile the sc16is7xx.c to a *.ko file, which i did with an edit to the Makefile, then place it in the /lib/modules/4.9.xxx/ folder.

If anyone still needs clarification on this I am happy to answer any questions.

Cheers, KK.

3 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.