Reidmere
Posts: 13
Joined: Tue Aug 27, 2013 9:26 am

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

Fri Oct 16, 2015 4:51 am

I too am having issues getting I2C to work on my RPi2 since the updates. My last firmware update that I recall my I2C working I believe was before or around the time of release of the B+, before the device tree.

Long story short, I'm 95% sure it's not a hardware problem because I've tried 3 different pie models (RPi B, Banana Pi, and the RPi2 I just bought) and 2 different PicAxe Boards and chips on I2C. Both PicAxes and boards used to be detected, though was only able to bidirectionally communicate the one due to requiring a higher baudrate on the PicAxe chip.

I've worked on it countless hours since Monday. I really need help on getting this working, as I want to use it as part of a home defense system (new property manager thinks that a lease saying he can enter at any time written by a lawyer of another state overrides state laws requiring over 24 hours notice).

Information:
My I2C device is a PicAxe 28x2, which as I said used to work. I can still read and write to it well through USB.
To get it working before, I set [ SETFREQ m16 ] which sets the PicAxe I2C frequency to 16MHz.
When I did't have it set at M16, I could see the device listed with i2cdetect, but couldn't communicate bidirectionally.
My PicAxe 28x1 could also be seen by I2C detect, but doesn't have M16 available to communicate properly.
The Pi with upgrades does not see either board when connected.
I enabled I2C and Device Tree from Raspi-Config
I do not have any other I2C devices besides PicAxes and Pis to test.

Modules:

Code: Select all

snd-bcm2835
i2c-dev
i2c-bcm2708
My uncommented lines config.txt on my pi:

Code: Select all

arm_freq=1000
core_freq=500
sdram_freq=500
over_voltage=2
dtparam=i2c_arm=on
I'm using the Jessie distro I got on the main site over the past week.
I'm also at wits end enough, that if nobody has a clue what to do here, I'd be willing to download an image with I2C proven to be working, if anyone could make one... which is a big deal, because my DL speed caps at 3mbps where I live.

Thanks, and while I know this was long, I wanted to give all the information on it I could, and still condensed it. XD

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

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

Fri Oct 16, 2015 8:09 am

Apart from having "i2c-bcm2708" in your /etc/modules (take it out - it doesn't need to be there), your configuration looks OK.

Although lengthy, your post is lacking some important details:

1) Please show or describe all wiring, indicating which pins are used on both sides.

2) Please show all commands you've typed, and what the output is.

3) To possibly save time, run "dmesg > bootup.txt" after booting and attach the resulting file.

Reidmere
Posts: 13
Joined: Tue Aug 27, 2013 9:26 am

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

Fri Oct 16, 2015 2:55 pm

Sorry, I intended to put the wiring in.
I just woke up and am booting my Pi now to remove i2c-bcm2708 from modules, I just know I used to have to add it. XD

PicAxe -> RPi
OutC3/I2C SCL -> GPIO5/I2C1 SCL (Green wire for identification).
OutC4/I2C SDA -> GPIO3/I2C1 SDA (Yellow wire for identification).

As I said, my PicAxe speed is listed as 16MHz.
It can drop to lower speeds if needed, but I raised it to make it work on the RPi1.
Has perhaps the baudrate changed on the RPi in the kernel, or wouldn't that matter?

lsmod | grep i2c lists i2c-bcm2708 and i2c-dev (even after removing bcm from modules and rebooting).
lsmod alone also shows bcm2835_gpiomem
i2cdetect -l returns i2c-l i2c 3f804000.i2c i2cadapter
i2cdetect -y 1 shows -- under every single value.

I tried attaching bootup.txt, but even after removing the extension as it says it's not allowed to upload txt files.

I will also say, there's probably some basic Linux stuff I still don't know. I'm probably not "newb" but am still a beginner.

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

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

Fri Oct 16, 2015 3:20 pm

I presume you mean pins 3 and 5, which correspond to GPIOs 2 and 3 - try to stick to the Broadcom numbering. Do you have a shared ground as well?

By default the I2C ports are configured to be 100KHz. You can change this using a DT parameters:

Code: Select all

dtparam=i2c_arm_baudrate=16000000
N.B. I've not tried I2C at this speed, but this is how you would ask for it.

Reidmere
Posts: 13
Joined: Tue Aug 27, 2013 9:26 am

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

Fri Oct 16, 2015 5:33 pm

I tried what you told me with the baudrate. Pi still boots, but no listing at all under i2cdetect.
Also, I'll bring up again that even though I could see the device before, when they were different speeds, I needed to use M16 to make it read bidirectional. Also, even after removing i2c-bcm2708 from modules, it still shows lsmod.
Could that be doing something like loading drivers, so they're not available to i2cdetect/device tree or whatever?

Nothing on the Picaxe board to put a load on.
The pi is powered though the USB, and has 2 devices powered though a 2A powered hub:
Mouse/Keyboard (even though I usually WinSCP), and a wifi module, both which seems to work flawlessly.

I'm really hoping someone has a proven/working I2C image I can download, to just make sure it's not hardware somewhere, so I don't keep hitting my head on the desk trying to set up software, if something else is a problem?
It seems to me hosting an image with I2C enabled would be a good thing to consider, considering all the issues I've seen people have. I will admit sometimes I do mess up on directions until I actually understand how something works... a legal/learning disability actually.

Thanks for your time!
____
Edit: Since my last post I made a clean SD Image install, and followed your instructions.

Nothing listed still, so I considered your statement:
"if for some reason your bit of hardware doesn't yet have a suitable overlay, add "device_tree=""

When I added that, I have a device showing UU (reserved from what I understand) with i2cdetect -y 1 at 1b.
lsmod also still shows i2c_bcm2708. I have not directly edited the modules file.
Lastly, I connected my PicAxe to a 1A power source, rather than the GPIO power pins. I2C is still wired as before.

The fact something is showing as UU though, I'd think it's a step in the right direction, but I'm unsure.
It really seems like something might still be causing it to not read the GPIO as I2C maybe?

Reidmere
Posts: 13
Joined: Tue Aug 27, 2013 9:26 am

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

Fri Oct 16, 2015 10:44 pm

A couple ideas:
-Perhaps i2ctools doesn't work as for your new way of doing things?
-Perhaps there's something else I'm missing an install of to get it working (for I2C or GPIOs in general?)
After all, I'm using a fresh install, and have to install i2ctools manually, which isn't in your instructions.

I found an Arduino Uno to run some I2C tests with on the Pi.
This does not show up as listed on i2cdetect, either.
https://www.arduino.cc/en/Tutorial/MasterReader

While I'm hoping for more ideas, if there's no possibly way to get my PicAxe working with the Pi for now, what's the latest version of Raspian that does not have device tree, and will it work alright with the RPi2? Also, I'm assuming I should be able to use apt-get update, but not apt-get upgrade, am I correct?

Reidmere
Posts: 13
Joined: Tue Aug 27, 2013 9:26 am

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

Tue Oct 20, 2015 6:55 pm

I know this comes with "no warranty", but I would hope for a little more help considering I helped in pointing out that there are some details missing from your post (installing i2c-utils). After my suggesting the idea of making a pre-configured working I2C image, I haven't received a response in 4 days, when responses used to be every few hours and you also on and posted yesterday.

I understand if you're busy or backed up, but you shouldn't avoid providing support because it's a difficult issue.

I gave at least one clear way you can help not just me, but many people who also have unresolved issues. Paul McWhorter said in a video review, Linux guys seem angry if you're not a Linux expert, or just don't seem to want to help. He contrasted this Arduino users seem to want to help more like a grandpa: "Here son, I remember having trouble with this, let me help you out". How can the Raspberry Pi really hope to compete with other platforms, past and future, if this is how tougher new issues get treated? A developer adds something that breaks features for some people, even when it's disabled, and doesn't provide much effort for support?

I've asked for help on 3 things on the in these forums. One got no response, one got a link to specs but didn't clarify my question, then this one. If you're actually working on something for it, it's nice to know, but it seems like a brush-off.
I'm not expecting a positive response about my message here. It's not that I don't care about the bad response, it's that as Paul said in the same video, a bad response is better than no response (in reference to the Beaglebone Black).

If you're just going to ignore someone because the question seems too hard, what are you going to do if your project gains even more popularity (possibly tying the Arduino) and the knowledge/experience of it's users passes your own? Are you still going to snob ideas or suggestions because it would take too much time to do or research? Your article might clearly help people who had I2C working before an update, but doesn't help people to get it working on a clean install... unless possibly they're Linux experts. If your instructions really work so well, you should practice what you preach and prove it works: There's a number of people here complaining it doesn't.

I have my experience programming, but I concede that I need to learn more of Linux. I should not be ignored for my lack of knowledge if you want your community to actually grow. I'd like to see this community take off more. I had plans for mass productions of robots at some point using your platform, which is my current reason for needing I2C working. I also have a friend working on welding a life-sized Zoid who wanted my to do the wiring/programming for it. The Raspi was going to be the platform for these and his bulletproof Iron Man costume.
I'm considering moving to the BeagleBone Black, because I'll probably get as much support, but at least it probably won't change how it works every few months and disable features.

I'm not trying to sound snippy, but I actually took the time to type this up to make a point that someone has to call our a spade as a spade to hopefully light a fire to fix things. I saw other people in this thread who said it your instructions didn't help them.

BobKruse
Posts: 10
Joined: Thu May 21, 2015 6:26 pm

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

Sun Nov 29, 2015 3:49 am

Hello Reidmere,

I'm not familiar with the device you are interfacing to your PI. You mentioned that it uses a 16Mhz clock. I don't think the Broadcom 2835/36 supports any I2C clock speeds other than 100KHz and 400KHz.
See the peripherals manual http://www.farnell.com/datasheets/1521578.pdf.

16Mhz seems more like a SPI clock speed than an I2C clock.

good luck,

Bob

napajedlaci.cz
Posts: 85
Joined: Mon Apr 13, 2015 1:13 am

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

Thu Dec 17, 2015 1:11 pm

Please help. I do not know what to do.

Code: Select all

i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory

Code: Select all

sudo rpi-config
Advanced options -> I2C -> 2x yes

Code: Select all

sudo apt-get install python-smbus
sudo apt-get install i2c-tools

Code: Select all

sudo nano /boot/config.txt
# Uncomment some or all of these to enable the optional hardware interfaces

Code: Select all

dtparam=i2c1=on
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on

Code: Select all

sudo modprobe i2c_dev
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.1.15-v7+/modules.dep.bin'

User avatar
DougieLawson
Posts: 32053
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

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

Thu Dec 17, 2015 1:15 pm

napajedlaci.cz wrote:

Code: Select all

sudo modprobe i2c_dev
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.1.15-v7+/modules.dep.bin'
Why did you run sudo rpi-update when you don't know what rpi-update does or how to recover from rpi-update failures?

You'll need to re-run it
sudo rm /boot/.firmware*
sudo rpi-update
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3B*3, 3B+

Please post ALL technical questions on the forum. Do not send private messages.

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

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

Thu Dec 17, 2015 1:18 pm

What do:

Code: Select all

uname -a
,

Code: Select all

ls -l /lib/modules
and

Code: Select all

ls -l /lib/modules/`uname -r`
show?

If you have run rpi-update (quiet at the back, Lawson), have you rebooted since?

napajedlaci.cz
Posts: 85
Joined: Mon Apr 13, 2015 1:13 am

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

Thu Dec 17, 2015 1:22 pm

Code: Select all

uname -a
Linux raspberrypi 4.1.15-v7+ #830 SMP Tue Dec 15 17:02:45 GMT 2015 armv7l GNU/Linux

Code: Select all

ls -l /lib/modules
total 16
drwxr-xr-x 3 root root 4096 Nov 21 21:32 4.1.13+
drwxr-xr-x 3 root root 4096 Nov 21 21:32 4.1.13-v7+
drwxr-xr-x 3 root root 4096 Dec 17 09:43 4.1.15+
drwxr-xr-x 3 root root 4096 Dec 17 09:43 4.1.15-v7+

Code: Select all

ls -l /lib/modules/`uname -r`
total 4
drwxr-xr-x 6 root root 4096 Dec 17 09:43 kernel
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.alias
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.alias.bin
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.builtin
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.builtin.bin
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.dep
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.dep.bin
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.devname
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.order
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.softdep
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.symbols
-rw-r--r-- 1 root root 0 Dec 17 09:43 modules.symbols.bin
If you have run rpi-update (quiet at the back, Lawson), have you rebooted since?
Yes, sudo update-RPI I was doing, and then at each operation rebooted

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

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

Thu Dec 17, 2015 1:25 pm

Hmm. What does

Code: Select all

df
say?

User avatar
DougieLawson
Posts: 32053
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

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

Thu Dec 17, 2015 1:30 pm

napajedlaci.cz wrote: Yes, sudo update-RPI [sic] I was doing, and then at each operation rebooted
DO NOT do that. It's not needed. The stable kernel is shipped as a normal apt-get package. It's only in very special cases that you ever need to run rpi-update and only when someone who is an expert tells you to run it.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3B*3, 3B+

Please post ALL technical questions on the forum. Do not send private messages.

napajedlaci.cz
Posts: 85
Joined: Mon Apr 13, 2015 1:13 am

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

Thu Dec 17, 2015 1:46 pm

Code: Select all

df

Code: Select all

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root        7625896 3636120   3624052  51% /
devtmpfs          469760       0    469760   0% /dev
tmpfs             474076       0    474076   0% /dev/shm
tmpfs             474076    6356    467720   2% /run
tmpfs               5120       4      5116   1% /run/lock
tmpfs             474076       0    474076   0% /sys/fs/cgroup
/dev/mmcblk0p1     61384   20224     41160  33% /boot
tmpfs              94816       0     94816   0% /run/user/1000

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

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

Thu Dec 17, 2015 2:12 pm

It looks as though the update process has failed. There are no modules for your kernel, and all of the auxilliary files are empty. I had wondered if your card was full, but that doesn't appear to be the case.

I suggest you use "sudo apt-get update; sudo apt-get upgrade" to get back to a sane system. If that works, and if you really need a feature that isn't supported by that kernel then you could try "sudo rpi-update" again, after a reboot of course, but this time read the messages to check for errors.

napajedlaci.cz
Posts: 85
Joined: Mon Apr 13, 2015 1:13 am

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

Thu Dec 17, 2015 6:14 pm

I2C functions and detects correctly :)

Code: Select all

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
When I try to read the data ... Error: Read failed

Code: Select all

i2cget -y 1 0X29

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

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

Fri Dec 18, 2015 8:39 am

That's the kind of error you would expect if there was no response to the read. Which device are you using, and how is it wired to data pins and power?

It might also be worth passing in a valid register address as well, just in case:

Code: Select all

i2cget -y 1 0x29 0x00

napajedlaci.cz
Posts: 85
Joined: Mon Apr 13, 2015 1:13 am

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

Sun Dec 20, 2015 11:08 am

Code: Select all

i2cdump -y 1 0x29 b

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX 1e 1f    XXXXXXXXXXXXXX??
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f     !"#$%&'()*+,-./
30: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f    0123456789:;<=>?
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f    @ABCDEFGHIJKLMNO
50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f    PQRSTUVWXYZ[\]^_
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f    `abcdefghijklmno
70: 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f    pqrstuvwxyz{|}~?
80: 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ?...............
90: 00 01 50 00 00 00 00 00 1a e0 c0 41 00 00 00 00    .?P.....???A....
a0: 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ?...............
b0: 00 01 50 00 00 00 00 00 1a e0 c0 41 00 00 00 00    .?P.....???A....
c0: 00 00 00 00 00 7f 00 00 00 00 00 00 00 00 00 44    .....?.........D
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
I install python aplication from Github, but I have problem: https://github.com/maxlklaxl/python-tsl2591/issues/1

Unfortunately, I'm a newbie and do not know what to do now. Google I have searched and nothing found Raspberry PI.

Image
Image

User avatar
DougieLawson
Posts: 32053
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

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

Sun Dec 20, 2015 11:37 am

Your wiring looks OK.

Try driving it with the python code at https://github.com/maxlklaxl/python-tsl2591
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3B*3, 3B+

Please post ALL technical questions on the forum. Do not send private messages.

napajedlaci.cz
Posts: 85
Joined: Mon Apr 13, 2015 1:13 am

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

Sun Dec 20, 2015 7:21 pm

I can not read the datasheet, but hopefully it will not be so difficult. There is a sensor datasheet TLS2591 (PDF).

There is example:

Code: Select all

Address | Register | Name | R/W | Register Function | Reset Value
0x13 | STATUS | R | Device | status | 0x00
So that to obtain status should I use cmd:

Code: Select all

i2cget -y 1 0x29 0x13
But this cmd have error: Error: Read failed

I do not know what can I do :cry:

Code: Select all

pi@raspberrypi ~ $ dmesg|grep i2c
[    3.982111] bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq 79) (baudrate 100000)
[    6.420761] i2c /dev entries driver

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

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

Sat Mar 05, 2016 11:03 pm

Pi 1 B, Jessie Lite, SPI-canbus controller doesn`t work. On jessie /dev see only spi0.1, have tried both pins, but no result. Where is the problem?
Have checked on wheezy and it works perfectly.

grep spi /boot/config.txt

#dtparam=spi=on
#dtparam=spi=on
dtparam=spi=on
dtoverlay=spi-bcm2835-overlay

pi@raspberrypi:~ $ lsmod|grep spiPi 1 B, Jessie Lite, SPI-canbus controller doesn`t work. On jessie /dev
spi_bcm2835 7868 0

pi@raspberrypi:~ $ ls -l /dev/spi*
crw-rw---- 1 root spi 153, 0 Mar 5 20:32 /dev/spidev0.1

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.1.18+ #848 Mon Feb 29 13:55:31 GMT 2016 armv6l GNU/Linux

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

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

Sun Mar 06, 2016 7:52 am

1) Don't grep for spi - either grep for dt or include the whole log.

2) Why are you loading spi-bcm2835?

3) Don't include the -overlay in the overlay name - that is implicit.

DirkS
Posts: 7733
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

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

Sun Mar 06, 2016 9:04 am

Kvach wrote:Pi 1 B, Jessie Lite, SPI-canbus controller doesn`t work. On jessie /dev see only spi0.1, have tried both pins, but no result. Where is the problem?
From http://raspberrypi.stackexchange.com/qu ... oesnt-work I gather that you're using

Code: Select all

dtoverlay=mcp2515-can0-overlay,oscillator=8000000,interrupt=25
That overlay disables /dev/spidev0.1 . That's normal.

As PhilE says: post full info (/boot/config.txt, /etc/modules, output of lsmod)

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:16 am

Why not 2835? I have just tried everything what can find on in the internet. in /boot config.txt:

# Added for SPI-mcp2515
dtparam=spi=on
dtoverlay=spi-bcm2835-overlay
dtoverlay=mcp2515-can0-overlay,oscillator=8000000,interrupt=25

As I said it works perfectly on wheezy 2015-05. Tried without "-overlay", but no success.
pi@raspberrypi:~ $ lsmod

Code: Select all

Module                  Size  Used by
cfg80211              479279  0 
rfkill                 21508  1 cfg80211
mcp251x                 9586  0 
can_dev                13101  1 mcp251x
evdev                  10534  2 
spi_bcm2835             7868  0 
bcm2835_gpiomem         3703  0 
bcm2835_rng             2207  0 
snd_bcm2835            22502  0 
snd_pcm                92829  1 snd_bcm2835
snd_timer              22164  1 snd_pcm
snd                    67534  3 snd_bcm2835,snd_timer,snd_pcm
uio_pdrv_genirq         3526  0 
uio                    10078  1 uio_pdrv_genirq
ipv6                  358702  24 
When it works I get error that bit timing not specified:
pi@raspberrypi:~$ dmesg | grep spi

Code: Select all

[    5.383449] spi spi0.0: setting up native-CS0 as GPIO 8
[    5.409457] spi spi0.1: setting up native-CS1 as GPIO 7
[   20.347837] mcp251x spi0.0 can0: bit-timing not yet defined
[   20.347879] mcp251x spi0.0: unable to set initial baudrate!
On jessi I haven`t got any error, and when set up timing can network doesn`t appear in network interfaces.

pi@raspberrypi:~ $ cat /etc/modules

Code: Select all

# /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.
It seems like no one module is booting?
Last edited by Kvach on Sun Mar 06, 2016 9:30 am, edited 1 time in total.

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 19 guests