PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Sun Mar 06, 2016 9:28 am

spi-bcm2835 selects the upstream SPI driver. I'm not saying there is anything wrong with it, but everybody else is using the downstream driver. It looks like the action of an advanced user, and you don't strike me as one.
As I said it works perfectly on wheezy 2015-05.
Perhaps that's because the spi-bcm2835 overlay didn't exist until 2015-08, so trying to load it will do nothing.
Tried without "-overlay", but no success.
Really? How old is your firmware?

Code: Select all

vcgencmd version
If what DirkS says is correct, all you should need in your config.txt is:

Code: Select all

dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25
All the rest is noise.

Kvach
Posts: 9
Joined: Mon Dec 23, 2013 5:32 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Sun Mar 06, 2016 9:38 am

I have edited last post, but maybe u didn`t see:

[email protected]:~ $ cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

Can be is there problem? No modules are loading.

So from 3 lines:
dtparam=spi=on
dtoverlay=spi-bcm2835
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25

need to leave only:
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25 ?!

[email protected]:~ $ vcgencmd version
Mar 4 2016 17:53:16
Copyright (c) 2012 Broadcom
version 764f403f69e25e8a014c24f8a26f057960331205 (clean) (release)

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Sun Mar 06, 2016 9:54 am

I didn't see that you had edited your previous post - it doesn't help that it is now on the previous page. In general editing is a bad idea because people don't receive notifications.

/etc/modules contains the names of modules that the user wants the kernel to load, but there are other reasons that the kernel may want to load a module - Device Tree is the most important one. That one dtoverlay line:

Code: Select all

dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25
does many things:

1) It enables the SPI subsystem and causes the spi-bcm2835 driver to be loaded (I double checked, and the upstream driver is now the default so loading the spi-bcm2835 overlay should do absolutely nothing).
2) It disables the 0.0 spidev instance.
3) It loads and configures the mcp2515 driver to use spi 0.0.

Please try again with just that one config.txt line listed above. If it doesn't work, run:

Code: Select all

sudo vcdbg log msg |& grep -v -E "(HDMI|gpioman)"
after booting and post the output.

Kvach
Posts: 9
Joined: Mon Dec 23, 2013 5:32 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Sun Mar 06, 2016 10:00 am

[email protected]:~ $ dmesg |grep spi
[ 11.008964] spi spi0.0: setting up native-CS0 as GPIO 8
[ 11.009269] spi spi0.1: setting up native-CS1 as GPIO 7

Nothing doesn`t change, not getting bit timing error.

[email protected]:~ $ sudo vcdbg log msg |& grep -v -E "(HDMI|gpioman)"
000698.991: clock: clock_set_clock: dst: CLK_H264, source: XOSC, div: 0.000000
000699.028: clock: clock_set_clock: dst: CLK_ISP, source: XOSC, div: 0.000000
000699.067: clock: clock_set_clock: dst: CLK_H264, source: XOSC, div: 0.000000
000699.103: clock: clock_set_clock: dst: CLK_ISP, source: XOSC, div: 0.000000
000699.144: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 1.000000
000699.177: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 0.000000
000711.884: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 1.000000
000711.918: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 0.000000
000880.221: clock: Set PLLB_VCO to 640000000
000880.332: clock: clock_set_clock: dst: CLK_ARM, source: PLLB_ARM, div: 1.000000
000880.367: clock: clock_set_clock: dst: CLK_ARM, source: XOSC, div: 0.000000
000880.404: clock: clock_set_clock: dst: CLK_ARM, source: XOSC, div: 1.000000
000880.436: clock: clock_set_clock: dst: CLK_ARM, source: XOSC, div: 0.000000
000880.462: clock: Set PLLB_VCO to 640000000
000880.569: clock: clock_set_clock: dst: CLK_ARM, source: PLLB_ARM, div: 1.000000
000880.598: clock: Set PLLB_VCO to 1200000000
000880.671: clock: clock_set_clock: dst: CLK_ARM, source: PLLB_ARM, div: 1.000000
000897.765: clock: clock_set_clock: dst: CLK_ARM, source: XOSC, div: 0.000000
000902.525: clock: clock_set_clock: dst: CLK_H264, source: XOSC, div: 0.000000
000902.563: clock: clock_set_clock: dst: CLK_ISP, source: XOSC, div: 0.000000
000902.601: clock: clock_set_clock: dst: CLK_H264, source: XOSC, div: 0.000000
000902.637: clock: clock_set_clock: dst: CLK_ISP, source: XOSC, div: 0.000000
000902.679: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 1.000000
000902.710: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 0.000000
000915.499: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 1.000000
000915.530: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 0.000000
000915.628: clock: clock_set_clock: dst: CLK_H264, source: XOSC, div: 0.000000
000915.665: clock: clock_set_clock: dst: CLK_ISP, source: XOSC, div: 0.000000
000915.702: clock: clock_set_clock: dst: CLK_H264, source: XOSC, div: 0.000000
000915.736: clock: clock_set_clock: dst: CLK_ISP, source: XOSC, div: 0.000000
000915.777: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 1.000000
000915.810: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 0.000000
000928.563: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 1.000000
000928.595: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 0.000000
000928.726: clock: clock_set_clock: dst: CLK_H264, source: XOSC, div: 0.000000
000928.760: clock: clock_set_clock: dst: CLK_ISP, source: XOSC, div: 0.000000
000928.799: clock: clock_set_clock: dst: CLK_H264, source: XOSC, div: 0.000000
000928.835: clock: clock_set_clock: dst: CLK_ISP, source: XOSC, div: 0.000000
000928.874: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 1.000000
000928.905: clock: clock_set_clock: dst: CLK_VEC, source: XOSC, div: 0.000000
000929.094: clock: Set PLLH_VCO to 864000000
000929.258: clock: clock_set_clock: dst: CLK_VEC, source: PLLH_AUX, div: 2.000000
000929.628: clock: clock_set_clock: dst: CLK_TSENS, source: XOSC, div: 9.600000
000929.697: *** Restart logging
000930.615: Read command line from file 'cmdline.txt'
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
000930.821: clock: clock_set_clock: dst: CLK_UART, source: PLLD_PER, div: 166.666700
000931.439: Loading 'kernel.img' from SD card
001163.963: Kernel trailer DTOK property says yes
001164.078: Loading 'bcm2708-rpi-b.dtb' from SD card
001197.331: dtparam: uart0_clkrate=3000000
001203.919: dtparam: audio=on
001215.573: Loaded overlay 'mcp2515-can0'
001215.592: dtparam: oscillator=8000000
001216.159: dtparam: interrupt=25
001263.678: dtparam: arm_freq=700000000
001265.159: Unknown dtparam 'arm_freq' - ignored
001265.189: dtparam: core_freq=250000000
001270.399: dtparam: cache_line_size=32
001280.179: clock: Set PLLB_VCO to 1400000000
001280.297: clock: clock_set_clock: dst: CLK_ARM, source: PLLB_ARM, div: 1.000000
001280.378: clock: clock_set_clock: dst: CLK_VPU, source: PLLC_CORE0, div: 4.000000
001280.438: clock: clock_set_clock: dst: CLK_EMMC, source: PLLC_PER, div: 4.000000
001280.509: clock: Set PLLA_VCO to 2000000000
001280.615: clock: clock_set_clock: dst: CLK_V3D, source: PLLA_CORE, div: 4.000000
001280.677: clock: clock_set_clock: dst: CLK_H264, source: PLLA_CORE, div: 4.000000
001280.740: clock: clock_set_clock: dst: CLK_ISP, source: PLLA_CORE, div: 4.000000
001281.685: clock: Set PLLB_VCO to 640000000
001281.758: clock: clock_set_clock: dst: CLK_ARM, source: PLLB_ARM, div: 1.000000
001281.787: clock: Set PLLB_VCO to 1400000000
001281.860: clock: clock_set_clock: dst: CLK_ARM, source: PLLB_ARM, div: 1.000000
001281.898: clock: clock_set_clock: dst: CLK_ARM, source: XOSC, div: 1.000000
001281.934: clock: clock_set_clock: dst: CLK_ARM, source: XOSC, div: 0.000000
001281.961: clock: Set PLLB_VCO to 1400000000
001282.077: clock: clock_set_clock: dst: CLK_ARM, source: PLLB_ARM, div: 1.000000
002866.602: vchiq_core: vchiq_init_state: slot_zero = 0x5b880000, is_master = 1

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Sun Mar 06, 2016 12:20 pm

That all looks fine - is it working now? If not, please make clear the difference between what you expect and what you observe.

Kvach
Posts: 9
Joined: Mon Dec 23, 2013 5:32 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Sun Mar 06, 2016 12:52 pm

I need to get and send message on can bus, through spi communication on PI.
http://qiita.com/mt08/items/535ab4690eecbcf5375d
Now I can add can interface, but I cannot send or receive any message.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Sun Mar 06, 2016 1:54 pm

So what happens when you follow the rest of the tutorial? If you don't tell me, I can't help you.

Kvach
Posts: 9
Joined: Mon Dec 23, 2013 5:32 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Sun Mar 06, 2016 3:58 pm

NOTHING. Messages dont flow across can bus network.
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

hhh321
Posts: 17
Joined: Fri Apr 22, 2016 12:41 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 12:30 pm

Hi.
I'm using RPi 3 with kernel:

Code: Select all

Linux pi 4.4.10-v7+ #885 SMP Fri May 13 15:44:27 BST 2016 armv7l GNU/Linux
I've got quite similar problem to Kvach's one. I want connect via SPI to my CAN controller. I cannot create can0 interface. I put this line to my boot/config.txt:

Code: Select all

dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
My logs:
dmesg | grep spi

Code: Select all

[    7.123488] Modules linked in: brcmfmac brcmutil cfg80211 rfkill mcp251x can_dev snd_bcm2835 snd_pcm snd_timer snd spi_bcm2835 bcm2835_gpiomem bcm2835_wdt uio_pdrv_genirq uio fuse ipv6
sudo vcdbg log msg |& grep -v -E "(HDMI|gpioman)"

Code: Select all

000994.528: *** Restart logging
000996.113: Read command line from file 'cmdline.txt'
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
001250.089: Loading 'kernel7.img' to 0x8000 size 0x406fa8
001253.731: Kernel trailer DTOK property says yes
001253.746: Kernel trailer DDTK property says yes
001257.206: Loading 'bcm2710-rpi-3-b.dtb' to 0x40efa8 size 0x39fd
001331.113: dtparam: uart0_clkrate=48000000
001344.667: dtparam: audio=on
001377.611: Loaded overlay 'mcp2515-can0'
001377.631: dtparam: oscillator=16000000
001378.405: dtparam: interrupt=25
001434.433: dtparam: uart1=off
001505.380: dtparam: arm_freq=1200000000
001547.857: dtparam: core_freq=400000000
001559.671: dtparam: cache_line_size=64
001585.586: Device tree loaded to 0x2fffbf00 (size 0x408d)
003324.201: vchiq_core: vchiq_init_state: slot_zero = 0xfac80000, is_master = 1
I don't know how to fix it. Any suggestions?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 2:31 pm

Is your wiring correct? I don't have an MCP2515 or the devices to test one, but I can see the code getting as far as trying to initialise the SPI device and failing with ENODEV.

hhh321
Posts: 17
Joined: Fri Apr 22, 2016 12:41 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 3:01 pm

I saw some mistake in wiring, but logs seems to look same, but maybe i can't see difference so:
sudo vcdbg log msg |& grep -v -E "(HDMI|gpioman)"

Code: Select all

000993.858: *** Restart logging
000995.443: Read command line from file 'cmdline.txt'
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
001249.422: Loading 'kernel7.img' to 0x8000 size 0x406fa8
001253.064: Kernel trailer DTOK property says yes
001253.079: Kernel trailer DDTK property says yes
001256.534: Loading 'bcm2710-rpi-3-b.dtb' to 0x40efa8 size 0x39fd
001330.435: dtparam: uart0_clkrate=48000000
001343.754: dtparam: audio=on
001376.697: Loaded overlay 'mcp2515-can0'
001376.717: dtparam: oscillator=16000000
001377.491: dtparam: interrupt=25
001433.522: dtparam: uart1=off
001504.477: dtparam: arm_freq=1200000000
001546.951: dtparam: core_freq=400000000
001558.767: dtparam: cache_line_size=64
001584.685: Device tree loaded to 0x2fffbf00 (size 0x408d)
003329.568: vchiq_core: vchiq_init_state: slot_zero = 0xfac80000, is_master = 1
dmesg | grep spi

Code: Select all

[    7.085896] Modules linked in: brcmfmac brcmutil cfg80211 rfkill mcp251x can_dev snd_bcm2835 snd_pcm snd_timer snd bcm2835_gpiomem spi_bcm2835 bcm2835_wdt uio_pdrv_genirq uio fuse ipv6
My connections:
- SCK - GPIO11(SPI0_SCLK),
- SO - GPIO9(SPI0_MISO),
- SI - GPIO10(SPI0_MOSI),
- INT - GPIO25,
- CS - GPIO8(SPI0_CE0_N),
- GND - PIN25,
- VCC - PIN4 (5V).
Also i'm using level shifter so i've got 3.3v on GPIO ports.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 3:23 pm

We're using the upstreamed bcm2835_spi driver which doesn't announce itself in the kernel log, so grepping for spi won't show anything. lsmod will, and /dev/spidev0.1 should exist. You could try "dmesg | grep -i can" and see if it has appeared.

hhh321
Posts: 17
Joined: Fri Apr 22, 2016 12:41 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 3:26 pm

So i've got :
dmesg | grep -i can

Code: Select all

[    4.288643] CAN device driver interface
[    7.085896] Modules linked in: brcmfmac brcmutil cfg80211 rfkill mcp251x can_dev snd_bcm2835 snd_pcm snd_timer snd bcm2835_gpiomem spi_bcm2835 bcm2835_wdt uio_pdrv_genirq uio fuse ipv6
ls /dev/spi*

Code: Select all

/dev/spidev0.1
lsmod | grep spi

Code: Select all

spi_bcm2835             7286  0

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 3:32 pm

That looks good. Now load the other modules you need:

Code: Select all

sudo modprobe can
sudo modprobe can-raw
sudo modprobe can-bcm

hhh321
Posts: 17
Joined: Fri Apr 22, 2016 12:41 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 3:37 pm

After running this commands i still receive :
Cannot find device "can0"
For:

Code: Select all

sudo ip link set can0 up type can bitrate 250000

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 3:42 pm

What messages do you get when you load the modules?

[ I don't have one of these devices - I'm just Googling the way you could ]

hhh321
Posts: 17
Joined: Fri Apr 22, 2016 12:41 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 3:46 pm

After loading modules I don't get any response it just bring me back to prompt. There's datasheet for MCP http://ww1.microchip.com/downloads/en/D ... 21801e.pdf, and scheme for my device(it also includes TJA1050) http://elty.pl/pl/p/file/e6f9cc8afd8b6b ... module.pdf.
Last edited by hhh321 on Wed May 18, 2016 3:48 pm, edited 1 time in total.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 3:48 pm

And in dmesg?

hhh321
Posts: 17
Joined: Fri Apr 22, 2016 12:41 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 3:50 pm

In dmesg it logged something after loading:

Code: Select all

[  148.656123] can: controller area network core (rev 20120528 abi 9)
[  148.656228] NET: Registered protocol family 29
[  148.721725] can: raw protocol (rev 20120528)
[  148.780860] can: broadcast manager protocol (rev 20120528 t)
After rebooting it looks same as before(without any new can logs).

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 4:04 pm

I think it's wiring or power. The next messages should be something like:

Code: Select all

[  593.259813] mcp251x spi0.0: CANSTAT 0x80 CANCTRL 0x07
[  593.266881] mcp251x spi0.0: probed
[  638.710821] mcp251x spi0.0: CNF: 0x03 0xb5 0x01
Perhaps try creating a new thread where people using the MCP2515 might see it.

hhh321
Posts: 17
Joined: Fri Apr 22, 2016 12:41 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Wed May 18, 2016 4:08 pm

Thank you for help, is it possible that something broke while i tried before to connect 5v pins to RPi ? I did tested SPI and it turned out to be OK.

vidal
Posts: 4
Joined: Fri May 15, 2015 1:01 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Tue Jun 14, 2016 7:41 am

No i2c devices with any method :cry:

Hi I have read this post and the README in overlays section and many posts on i2c management and boot configuration without any success.

I have tried all recommended configurations from the README file in /boot/firmware/overlays, almost anything from
1. returning to old method
with /boot/config.txt containing

Code: Select all

device_tree=
with /etc/modules containing

Code: Select all

i2c-bcm2708
i2c-dev
i2c-gpio
and /etc/udev/rules.d/60-i2c-tools.rules containing

Code: Select all

KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660"
to
2. data tree configuration
with /boot/config.txt

Code: Select all

# add i2c bus
dtparam=i2c_arm=on
with empty /etc/modules and no /etc/udev/rules.d file

I have tried probably all other possible combinations that look reasonable for me with parameters in config.txt like

Code: Select all

dtoverlay=i2c-gpio
dtoverlay=i2c0-bcm2708
dtoverlay=i2c1-bcm2708
At best I get a message in the log :
[ 10.569376] i2c /dev entries driver
but nothing more. I have never been able to get any i2c device . I am using a debian image.
Any help will be greatly appreciated to trace out the problem and find a solution.

Thanks
edit 1 : sorry I forgot the uname
Linux gerzeh 4.4.13-v7+ #1 SMP Mon Jun 13 17:31:18 CEST 2016 armv7l GNU/Linux
Last edited by vidal on Tue Jun 14, 2016 9:20 am, edited 1 time in total.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Tue Jun 14, 2016 8:28 am

I'm going to assume you are on a recent image using a 4.4 kernel - you don't say.

Device Tree is required when using our 4.4 kernels, so attempts to disable it will be ignored.

Follow these steps carefully:

Code: Select all

grep i2c /etc/modprobe.d/*
Delete any occurences.

Code: Select all

grep i2c-dev /etc/modules
If you don't find "i2c-dev", add it. Any other matches, delete them.
In config.txt:

Code: Select all

dtparam=i2c_arm=on
Delete or comment out anything else i2c-related.

Now reboot, and it should be working:

Code: Select all

[email protected]:~$ ls /dev/i2c*
/dev/i2c-1
We could instead have take advantage of the 4.4 kernel's ability to load overlays at runtime and, instead of adding dtparam=i2c_arm=on to config.txt, (assuming you've rebooted) run:

Code: Select all

[email protected]:~$ sudo dtparam i2c_arm=on
[email protected]:~$ ls /dev/i2c*
The result should be the same.

vidal
Posts: 4
Joined: Fri May 15, 2015 1:01 pm

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Tue Jun 14, 2016 9:54 am

I have kernel 4.4.13-v7+ I tried all you have said (don't be bothered by € sign it is just replacement of the $ in .bashrc I am european ;) )

Code: Select all

vidal[~] gerzeh.€ : cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

i2c-dev

vidal[~] gerzeh.€ : tail -5 /boot/config.txt
# boot u-boot kernel
kernel=u-boot.bin

# add i2c bus
dtparam=i2c_arm=on
And it is still the same situation no i2c device :cry:

Code: Select all

vidal[~] gerzeh.€ : ls /dev/*i2c*
ls: cannot access /dev/*i2c*: No such file or directory
vidal[~] gerzeh.€ : dmesg | grep i2c
[   10.711233] i2c /dev entries driver
you did not say anything for the udev rules that came with i2c-tools package, I copied it from /lib/udev/rules.d/60-i2c-tools.rules to /etc/udev/rules.d and left it as it was.

Code: Select all

vidal[~] gerzeh.€ : cat /etc/udev/rules.d/60-i2c-tools.rules 
KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660"
I tried also the dtparam command as ordinary user, it had no effect.
when I tried with root command is not found

Code: Select all

[email protected]:/home/vidal# dtparam i2c_arm=on
bash: dtparam: command not found
Maybe a missing package?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1878
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Tue Jun 14, 2016 11:07 am

Why didn't you mention that you are using u-boot and something other than Raspbian?

The dtparam directive in config.txt constructs a device tree in memory, then passes its address to the kernel. If your kernel is u-boot then it is likely that the message isn't getting through. You'll have to ask the maintainers of your distribution what to do. If your u-boot is expecting the device-tree at 0x100 then you might be able to use:

Code: Select all

device_tree_address=0x100
in config.txt. The correct technique is for u-boot to either specify the required DTB load address using a custom stub file or to read the actual load address from address 0xf8 (see https://github.com/raspberrypi/tools/tr ... r/armstubs).

Return to “Troubleshooting”