You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kernels >= 3.10: w1_gpio destroys i2c bus 0 (raspicam doesn't work anymore) #435
I've had a quick look and can reproduce the problem.
The problem is that the 1-wire module overwrite the gpio function selection for the I2C pins.
Before 1-wire is loaded *0x20200000 = 0x48024 and I2C works (GPIO0 and GPIO in I2C alt function)
After 1-wire is loaded *0x20200000 = 0x48921 and I2C fails (GPIO0 is set to an output)
No idea yet why that happens yet, but that explains why I2C (and camera) stops working.
A workaround is to load first the 1wire modules and afterwards the i2c modules.
I2c initialization overwrites the 1wire quirks for bus 0, cam and w1 sensors work fine now.
@crashmaster1
Are you aware of where in the code register 0x20200000 gets written when 1-wire is loaded?
I noticed that the 3.10 1-wire driver does some pin-muxing calls that 3.6 didn't do, but I assumed we have no pin muxing driver, so that would be a no-op.
sorry if this is a dumb question - trying to work around this issue - i'm using the rpi camera, 1-wire temp probes, and i2c (for running an lcd display, AD converter, etc.). I assume that if i blacklist spi and i2c that they'll stop working?
thanks - made that change and restarted, but unhappily I'm still getting the same error. I've updated to the latest using apt-get update, apt-get upgrade, and rpi-update. Any suggestions?
Width 1024, Height 768, quality 85, filename test.jpg
Time delay 0, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Link to latest frame enabled no
Full resolution preview No
Capture method : Run forever
Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'backlit', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates
At first I've also got the ENOSPC failure. In my case I commented all "cma_" params i had made in "config.txt" and it helped. Probably you don't have them, but in my opinion you should look there to find out proper values for memory usage and you should have the latest firmware installed.
Thanks, I don't have any "cms_" params in config.txt - i am pretty sure that i've never edited that file. the only uncommented lines are:
start_x=1
gpu_mem=128
when i run "i2cdetect -y 0" the output shows increasing numbers instead of dashes.
By the way, if the camera uses i2c bus 0, i'm a bit confused about how we can use the suggested workaround above, when changing the order in /etc/modules doesn't work:
"The i2c-bcm2708 *is* blacklisted in your /etc/modprobe.d/raspi-blacklist.conf"
OK. i uncommented "blacklist i2c-bcm2708" in /etc/modprobe.d/raspi-blacklist.conf and now it appears that everything works (i2c, the 1-wire temperature probes, and the pi camera). I assume I misunderstood your suggestion above, and I'm going to leave well enough alone :-). Thanks for your help!
@crashmaster1 Please can you explain the steps required in order to fix my raspberry pi camera in a more simple way as i have just started programming and using the pi. Thanks for your help - much appreciated!
Indeed, please use the forums to get advice and help for this sort of
thing. The camera is known to work with the latest boards and
firmware/kernel.
On 11 Aug 2014 15:43, "crashmaster1" notifications@github.com wrote:
@geckohttps://github.com/gecko: Sorry, i can't because i'm using Arch
on my RPi's (not Raspbian). I think, it's better you ask for this in the
Raspberry forum.
—
Reply to this email directly or view it on GitHub #435 (comment).
I had the same problem and I found probably the cause because I was able to reproduce it.
For me it was a hardware problem. One of the wires on de flex cable (from raspberry to camera module) was broken.
When I bow the cable the above problem was shown. This was because the connection was broken.
When I put the cable straight, the camera was working correctly.
I think it is the most left wire when camera is pointing to me.
I am still encounter this issue. how should i do to solve this issue? pi@raspberrypi:~$ raspistill -o 1.jpg -v
raspistill Camera App v1.3.11
Width 3280, Height 2464, quality 85, filename 1.jpg
Time delay 5000, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Link to latest frame enabled no
Full resolution preview No
Capture method : Single capture
Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates
You've got the latest firmware but your configuration was obsoleted 2 years ago with the switch to Device Tree. Try this:
Remove everything from /etc/modules except this:
i2c-dev
Delete /etc/modprobe.d/raspi-blacklist.conf - you shouldn't need it.
Enable the camera using raspi-config:
sudo raspi-config
# Open Interfacing Options
# Select Camera
# Choose Yes to enable the camera
This will add start_x=1 and gpu_mem=64 to /boot/config.txt.
If you are using a onewire device such as a DS18B20 (you don't say) then edit /boot/config.txt and add this line:
dtoverlay=w1-gpio,gpiopin=16,pullup
substituting your own pin number. Note that if your wiring to the onewire device includes a 3.3V line (which I recommend if you can), i.e. if it isn't using the phantom powering feature, then you just need:
dtoverlay=w1-gpio,gpiopin=16
Reboot.
Reacted by Pi Home Server, mateusmcorrea and G0a19
Activity
JamesH65 commentedon Nov 18, 2013
I think this is a dupe of #434
crashmaster1 commentedon Nov 19, 2013
I didn't think so because it also affects the official kernel 3.10.x.
popcornmix commentedon Nov 20, 2013
I've had a quick look and can reproduce the problem.
The problem is that the 1-wire module overwrite the gpio function selection for the I2C pins.
Before 1-wire is loaded *0x20200000 = 0x48024 and I2C works (GPIO0 and GPIO in I2C alt function)
After 1-wire is loaded *0x20200000 = 0x48921 and I2C fails (GPIO0 is set to an output)
No idea yet why that happens yet, but that explains why I2C (and camera) stops working.
crashmaster1 commentedon Nov 21, 2013
Thanks popcornmix.
A workaround is to load first the 1wire modules and afterwards the i2c modules.
I2c initialization overwrites the 1wire quirks for bus 0, cam and w1 sensors work fine now.
popcornmix commentedon Nov 21, 2013
@crashmaster1
Are you aware of where in the code register 0x20200000 gets written when 1-wire is loaded?
I noticed that the 3.10 1-wire driver does some pin-muxing calls that 3.6 didn't do, but I assumed we have no pin muxing driver, so that would be a no-op.
crashmaster1 commentedon Nov 21, 2013
Sorry, i'm not aware of that.
serial: imx: Fix serial clock unbalance
chtitux commentedon Dec 19, 2013
The workaround of @crashmaster1 DOES work (thank you !), at least on
3.10.24+kernel.If if does not work, verify that :
The
i2c-bcm2708is blacklisted in your/etc/modprobe.d/raspi-blacklist.confThe modules are in this order in your
/etc/modulesdkossman commentedon Dec 20, 2013
sorry if this is a dumb question - trying to work around this issue - i'm using the rpi camera, 1-wire temp probes, and i2c (for running an lcd display, AD converter, etc.). I assume that if i blacklist spi and i2c that they'll stop working?
my /etc/modules currently looks like this:
w1-gpio pullup=1
w1_therm
snd-bcm2835
spi-bcm2708
i2c-bcm2708
i2c-dev
and raspi-blacklist.conf:
#blacklist spi-bcm2708
#blacklist i2c-bcm2708
thanks
crashmaster1 commentedon Dec 20, 2013
You should not change your blacklist but in etc/modules try this order:
w1-therm
w1-gpio pullup=1
i2c-dev
i2c-bcm2708
spi-bcm2708
snd-bcm2835
dkossman commentedon Dec 20, 2013
thanks - made that change and restarted, but unhappily I'm still getting the same error. I've updated to the latest using apt-get update, apt-get upgrade, and rpi-update. Any suggestions?
pi@raspberrypi ~ $ /usr/bin/raspistill -v -ex auto -mm backlit -w 1024 -h 768 -t 0 -o test.jpg
raspistill Camera App v1.3.5
Width 1024, Height 768, quality 85, filename test.jpg
Time delay 0, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Link to latest frame enabled no
Full resolution preview No
Capture method : Run forever
Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'backlit', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates
crashmaster1 commentedon Dec 21, 2013
At first I've also got the ENOSPC failure. In my case I commented all "cma_" params i had made in "config.txt" and it helped. Probably you don't have them, but in my opinion you should look there to find out proper values for memory usage and you should have the latest firmware installed.
dkossman commentedon Dec 21, 2013
Thanks, I don't have any "cms_" params in config.txt - i am pretty sure that i've never edited that file. the only uncommented lines are:
start_x=1
gpu_mem=128
when i run "i2cdetect -y 0" the output shows increasing numbers instead of dashes.
By the way, if the camera uses i2c bus 0, i'm a bit confused about how we can use the suggested workaround above, when changing the order in /etc/modules doesn't work:
can anyone explain? or did i misunderstand?
thanks
Don
dkossman commentedon Dec 21, 2013
OK. i uncommented "blacklist i2c-bcm2708" in /etc/modprobe.d/raspi-blacklist.conf and now it appears that everything works (i2c, the 1-wire temperature probes, and the pi camera). I assume I misunderstood your suggestion above, and I'm going to leave well enough alone :-). Thanks for your help!
pi@raspberrypi ~ $ cat /etc/modprobe.d/raspi-blacklist.conf
blacklist spi and i2c by default (many users don't need them)
#blacklist spi-bcm2708
blacklist i2c-bcm2708
15 remaining items
hilmanshini commentedon Jul 26, 2014
How is it now? is it solved yet?
me either not works. 2 month struggling this,
i have tried new rpi and new camera with following the instruction, but still rpi camera not working.
joshhankins commentedon Aug 11, 2014
@crashmaster1 Please can you explain the steps required in order to fix my raspberry pi camera in a more simple way as i have just started programming and using the pi. Thanks for your help - much appreciated!
crashmaster1 commentedon Aug 11, 2014
@gecko: Sorry, i can't because i'm using Arch on my RPi's (not Raspbian). I think, it's better you ask for this in the Raspberry forum.
JamesH65 commentedon Aug 11, 2014
Indeed, please use the forums to get advice and help for this sort of
thing. The camera is known to work with the latest boards and
firmware/kernel.
On 11 Aug 2014 15:43, "crashmaster1" notifications@github.com wrote:
kimbongzo commentedon Sep 17, 2014
Solution~
Open /etc/modules -> sudo nano /etc/modules
and below add two #
snd-bcm2835
i2c-dev
#w1-gpio
#w1-therm
lirc_dev
lirc_rpi gpio_out_pin=7
and reboot. then GPIO Collision deleted.
bootor commentedon Sep 21, 2014
... and 1-wire will stop working...
popcornmix commentedon Sep 22, 2014
@bootor
If you want to use 1-wire with a camera you need to set the GPIO pin to use. E.g. add to cmdline.txt
You can also code it in /etc/modules
w1-gpio-gpiopin=16
Problem is by default w1 modules uses GPIO4 which is needed by camera.
GertjanvanhetHof commentedon Mar 26, 2016
I had the same problem and I found probably the cause because I was able to reproduce it.
For me it was a hardware problem. One of the wires on de flex cable (from raspberry to camera module) was broken.
When I bow the cable the above problem was shown. This was because the connection was broken.
When I put the cable straight, the camera was working correctly.
I think it is the most left wire when camera is pointing to me.
Ruffio commentedon Aug 10, 2016
@crashmaster1 has this issue been resolved? If yes, then please close this issue.
kenxausten commentedon Sep 15, 2017
I am still encounter this issue. how should i do to solve this issue?
pi@raspberrypi:~$ raspistill -o 1.jpg -v
raspistill Camera App v1.3.11
Width 3280, Height 2464, quality 85, filename 1.jpg
Time delay 5000, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Link to latest frame enabled no
Full resolution preview No
Capture method : Single capture
Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates
pi@raspberrypi:~$ cat /etc/modprobe.d/raspi-blacklist.conf
blacklist spi and i2c by default (many users don't need them)
#blacklist spi-bcm2708
#blacklist i2c-bcm2708
pi@raspberrypi:~$ uname -a
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
pi@raspberrypi:~$ 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.
w1-therm
w1-gpio pullup=1
w1-gpio-gpiopin=16
bcm2708.w1_gpio_pin=16
i2c-bcm2078
i2c-dev
snd-bcm2835
bcm2708_wdog
pelwell commentedon Sep 15, 2017
You've got the latest firmware but your configuration was obsoleted 2 years ago with the switch to Device Tree. Try this:
/etc/modulesexcept this:This will add
start_x=1andgpu_mem=64to/boot/config.txt./boot/config.txtand add this line:substituting your own pin number. Note that if your wiring to the onewire device includes a 3.3V line (which I recommend if you can), i.e. if it isn't using the phantom powering feature, then you just need:
net/smc: fix wrong list_del in smc_lgr_cleanup_early
net/smc: fix wrong list_del in smc_lgr_cleanup_early
net/smc: fix wrong list_del in smc_lgr_cleanup_early