NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

CM3 with Cameras [solved]

Mon Feb 13, 2017 12:03 am

Hello Everyone,

I'm struggling to get my CM3 to work with the raspberry pi camera. I've been following this tutorial:

https://www.raspberrypi.org/documentati ... -camera.md

But it seems I have hit a wall and still receive the typical 'failed to create the camera component' message with either cam0 or cam 1. I have the IO jumpers in place. I have tried 3 cameras (2 V2.1 and 1 v1.3). I have verified my firmware is dated 9/21/16. I've verified the ribbon cable orientation. There are only two possibilities that I am considering may still be an issue.

The first is that I am using the DietPi distro, so I have also posted over at the DietPi forums (http://dietpi.com/phpbb/viewtopic.php?f=11&t=1320) just to verify I don't need to do anything special with 'dt-blob.bin'.

The second is being a putz and in a hurry, I connected, GND, 5V0, GND, and 3V3 instead of GPIO up to each camera (interpreted the photo wrong). For sure this has potential to damage, and I caught it by noticing that my camera boards got real hot (duh). However, that's when I pulled out an old v1.3 camera I had and still had no luck with it at all. Such a wiring mistake I would only expected to do damage to the camera board itself, and not to the adapter/CM3/IO board. Wouldn't you agree?

Thanks!
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9539
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 with Cameras

Mon Feb 13, 2017 10:21 am

Code: Select all

vcgencmd get_camera
will tell you how many cameras are configured/supported. If it is not 2 then your dt-blob.bin is wrong.

Detection only runs ONCE per boot, so if you've tried once, tweaked stuff, you need to reboot before trying to detect again.
If you're wanting to confirm things manually, then I posted instructions at viewtopic.php?f=98&t=172378#p1111201, however you will need a firmware from 27 Jan 2017 or later to allow you to safely use i2c-0 on a CM3. Use rpi-update to update to the bleeding edge, or just copy the firmware files from https://github.com/Hexxeh/rpi-firmware or https://github.com/raspberrypi/firmware (the files should be identical). You shouldn't need to update the kernel, but it may be easier to do so.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras

Tue Feb 14, 2017 2:18 am

I tried the 'vcgencmd get_camera' and the result was "supported=1 detected=0". I assume that means dt-blob.bin was loaded but the camera wasn't detected? In that case it must be a hardware problem?
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

User avatar
rpdom
Posts: 17550
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: CM3 with Cameras

Tue Feb 14, 2017 5:58 am

How much memory have you allocated to the GPU in config.txt? The camera needs more than the default, iirc. I think setting the start_x=1 option allocates more memory automatically. I don't know if two cameras will require more than that (I can't justify getting myself a CM to play with yet...)

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9539
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 with Cameras

Tue Feb 14, 2017 10:17 am

Just for clarity, are you using the single or dual camera blob? Either should work, but you'll get a different "supported=" value.

"vcgencmd get_camera" doesn't need start_x=1, but actually running the camera does (quirky I know). As long as you don't have gpu_mem <= 16MB to use the cutdown firmware then the detection code should run.
The default start_x config should be sufficient to run the camera with the normal raspistill/vid apps.

"sudo vcdbg log msg" may give you an indication of whether you've made an error in the dt-blob.bin. If it can't find a pin configuration that it needs then it logs a line:

Code: Select all

gpioman: gpioman_get_pin_num: pin <IDENTIFIER> not defined
Not finding FLASH_0_ENABLE, FLASH_0_INDICATOR, or CAMERA_LED is normal.
(There is an issue at the moment with dt-blob-cam1 that it isn't defining a couple of the defines required for the SMPS and GPIO expander, so they are creating log lines very frequently. I need to update the CM + display blobs for CM3, so I'll be looking to fix those at the same time.)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras

Tue Feb 14, 2017 6:02 pm

I'm using the single blob located here (http://goo.gl/U4t12b) for cam1. Where can I find a dual-blob.bin?

I haven't modified the config.txt, so I'll need to go back and review the literature you've listed and try it myself. I took it for granted that running the camera on the compute module would be plug 'n' play similar to the regular Pi, thanks for clearing things up!
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras

Tue Feb 14, 2017 6:18 pm

Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9539
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 with Cameras [solved]

Tue Feb 14, 2017 6:29 pm

The standard Pi has reserved gpio for the camera and the display.
One of the major points of the CM is that as many features of the SoC are exposed as possible, therefore there aren't such reserved gpios.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras [solved]

Thu Feb 16, 2017 12:25 pm

OK, found my issue. It seems my Cam1 port is damaged, once I used the dualcam blob Cam0 was working fine. Supported cameras = 2 however detected = 1. I've swapped cameras, ribbon cables, etc, no matter what Cam1 never works. I triple checked the IO jumpers. I guess the connector must be damage? I did wire the IO jumpers accidentally to 5V and GND, possibly I burned something on the IO board. Anyways I ordered another, so we will see! Thanks for the help.
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9539
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 with Cameras [solved]

Thu Feb 16, 2017 12:37 pm

Glad you solved it, and thanks for reporting back.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras [solved]

Tue Feb 21, 2017 12:30 am

Actually, unsolved. :? I got my 2nd compute module dev kit today thinking cam1 connector or something on the IO board was defective and got the exact same behavior. Also tried another camera. I got the latest dt-blob-dualcam.dts and built dt-blob.bin again. Still, 2 cameras installed, 1 detected. I tried the "sudo vcdbg log msg" command and got a lot of stuff back, I'm not sure what I'm looking for? I see some stuff for cam0 (which is working) but nothing for cam1. Any ideas? :?:

Code: Select all

root@DietPi:/StereoVisionTest/build# raspistill -cs 0
^Cmmal: Aborting program

root@DietPi:/StereoVisionTest/build# raspistill -cs 1
mmal: Could not select camera : error 3
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

root@DietPi:/StereoVisionTest/build# vcgencmd get_camera
supported=2 detected=1
root@DietPi:/StereoVisionTest/build# sudo vcdbg log msg
001097.717: HDMI:EDID version 1.3, 1 extensions, screen size 70x39 cm
001097.782: HDMI:EDID features - videodef 0x80 !standby !suspend active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTF
001097.866: HDMI:EDID found preferred DMT detail timing format: 1360x768p @ 60 Hz (39)
001097.915: HDMI:EDID found DMT detail timing format: 1024x768p @ 60 Hz (16)
001097.956: HDMI:EDID found DMT format: code 4, 640x480p @ 60 Hz in established timing I/II
001097.993: HDMI:EDID found DMT format: code 6, 640x480p @ 75 Hz in established timing I/II
001098.033: HDMI:EDID found DMT format: code 9, 800x600p @ 60 Hz in established timing I/II
001098.069: HDMI:EDID found DMT format: code 10, 800x600p @ 72 Hz in established timing I/II
001098.108: HDMI:EDID found DMT format: code 11, 800x600p @ 75 Hz in established timing I/II
001098.148: HDMI:EDID found DMT format: code 16, 1024x768p @ 60 Hz in established timing I/II
001098.187: HDMI:EDID found DMT format: code 17, 1024x768p @ 70 Hz in established timing I/II
001098.223: HDMI:EDID found DMT format: code 18, 1024x768p @ 75 Hz in established timing I/II
001098.316: HDMI:EDID standard timings block x 8: 0x0101 0101 0101 0101 0101 0101 0101 0101 
001111.329: HDMI:EDID parsing v3 CEA extension 0
001111.367: HDMI:EDID monitor support - underscan IT formats:no, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
001111.420: HDMI:EDID found DMT detail timing format: 1360x768p @ 60 Hz (39)
001111.464: HDMI:EDID found CEA detail timing format: 1280x720p @ 60 Hz (4)
001111.506: HDMI:EDID found CEA detail timing format: 720x480p @ 60 Hz (2)
001111.547: HDMI:EDID found CEA detail timing format: 1440x480i @ 60 Hz (6)
001111.581: HDMI:EDID found CEA format: code 5, 1920x1080i @ 60Hz 
001111.615: HDMI:EDID found CEA format: code 4, 1280x720p @ 60Hz 
001111.651: HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz (native)
001111.682: HDMI:EDID found CEA format: code 2, 720x480p @ 60Hz 
001111.715: HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz 
001111.749: HDMI:EDID found CEA format: code 7, 1440x480i @ 60Hz 
001111.783: HDMI:EDID found CEA format: code 6, 1440x480i @ 60Hz 
001111.814: HDMI:EDID found CEA format: code 1, 640x480p @ 60Hz 
001111.848: HDMI:EDID found CEA format: code 32, 1920x1080p @ 24Hz 
001111.902: HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48 kHz, sample size: 16|20|24 bits
001111.950: HDMI:EDID found audio format 6 channels AC3, sample rate: 32|44|48 kHz, bitrate: 640 kbps
001111.968: HDMI:EDID found HDMI VSDB length 12
001111.995: HDMI:EDID HDMI VSDB has physical address 2.0.0.0
001112.015: HDMI:EDID HDMI VSDB supports AI:no, dual link DVI:no
001112.045: HDMI:EDID HDMI VSDB deep colour support - 48-bit:no 36-bit:no 30-bit:no DC_yuv444:no
001112.063: HDMI:EDID HDMI VSDB max TMDS clock 150 MHz
001112.081: HDMI:EDID HDMI VSDB video latency 0 ms
001112.098: HDMI:EDID HDMI VSDB audio latency 0 ms
001112.116: HDMI:EDID HDMI VSDB interlaced video latency 0 ms
001112.135: HDMI:EDID HDMI VSDB interlaced audio latency 0 ms
001112.152: HDMI:EDID HDMI VSDB does not support content type
001112.195: HDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023
001112.339: HDMI:EDID preferred mode remained as DMT (39) 1360x768p @ 60 Hz with pixel clock 85 MHz
001122.180: HDMI:Setting property pixel encoding to Default
001122.199: HDMI:Setting property pixel clock type to PAL
001122.220: HDMI:Setting property content type flag to No data
001122.239: HDMI:Setting property fuzzy format match to enabled
001122.316: gpioman: gpioman_get_pin_num: pin DISPLAY_SDA not defined
001123.998: gpioman: gpioman_get_pin_num: pin BT_ON not defined
001124.018: gpioman: gpioman_get_pin_num: pin WL_ON not defined
001151.681: hdmi: HDMI:>>>>>>>>>>>>>Rx sensed, reading EDID<<<<<<<<<<<<<
001163.832: hdmi: HDMI:EDID version 1.3, 1 extensions, screen size 70x39 cm
001163.902: hdmi: HDMI:EDID features - videodef 0x80 !standby !suspend active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTF
001163.991: hdmi: HDMI:EDID found preferred DMT detail timing format: 1360x768p @ 60 Hz (39)
001164.045: hdmi: HDMI:EDID found DMT detail timing format: 1024x768p @ 60 Hz (16)
001164.089: hdmi: HDMI:EDID found DMT format: code 4, 640x480p @ 60 Hz in established timing I/II
001164.129: hdmi: HDMI:EDID found DMT format: code 6, 640x480p @ 75 Hz in established timing I/II
001164.172: hdmi: HDMI:EDID found DMT format: code 9, 800x600p @ 60 Hz in established timing I/II
001164.212: hdmi: HDMI:EDID found DMT format: code 10, 800x600p @ 72 Hz in established timing I/II
001164.255: hdmi: HDMI:EDID found DMT format: code 11, 800x600p @ 75 Hz in established timing I/II
001164.298: hdmi: HDMI:EDID found DMT format: code 16, 1024x768p @ 60 Hz in established timing I/II
001164.341: hdmi: HDMI:EDID found DMT format: code 17, 1024x768p @ 70 Hz in established timing I/II
001164.382: hdmi: HDMI:EDID found DMT format: code 18, 1024x768p @ 75 Hz in established timing I/II
001164.478: hdmi: HDMI:EDID standard timings block x 8: 0x0101 0101 0101 0101 0101 0101 0101 0101 
001177.494: hdmi: HDMI:EDID parsing v3 CEA extension 0
001177.535: hdmi: HDMI:EDID monitor support - underscan IT formats:no, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
001177.591: hdmi: HDMI:EDID found DMT detail timing format: 1360x768p @ 60 Hz (39)
001177.638: hdmi: HDMI:EDID found CEA detail timing format: 1280x720p @ 60 Hz (4)
001177.684: hdmi: HDMI:EDID found CEA detail timing format: 720x480p @ 60 Hz (2)
001177.728: hdmi: HDMI:EDID found CEA detail timing format: 1440x480i @ 60 Hz (6)
001177.765: hdmi: HDMI:EDID found CEA format: code 5, 1920x1080i @ 60Hz 
001177.802: hdmi: HDMI:EDID found CEA format: code 4, 1280x720p @ 60Hz 
001177.841: hdmi: HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz (native)
001177.875: hdmi: HDMI:EDID found CEA format: code 2, 720x480p @ 60Hz 
001177.912: hdmi: HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz 
001177.949: hdmi: HDMI:EDID found CEA format: code 7, 1440x480i @ 60Hz 
001177.986: hdmi: HDMI:EDID found CEA format: code 6, 1440x480i @ 60Hz 
001178.020: hdmi: HDMI:EDID found CEA format: code 1, 640x480p @ 60Hz 
001178.058: hdmi: HDMI:EDID found CEA format: code 32, 1920x1080p @ 24Hz 
001178.115: hdmi: HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48 kHz, sample size: 16|20|24 bits
001178.167: hdmi: HDMI:EDID found audio format 6 channels AC3, sample rate: 32|44|48 kHz, bitrate: 640 kbps
001178.188: hdmi: HDMI:EDID found HDMI VSDB length 12
001178.218: hdmi: HDMI:EDID HDMI VSDB has physical address 2.0.0.0
001178.241: hdmi: HDMI:EDID HDMI VSDB supports AI:no, dual link DVI:no
001178.274: hdmi: HDMI:EDID HDMI VSDB deep colour support - 48-bit:no 36-bit:no 30-bit:no DC_yuv444:no
001178.296: hdmi: HDMI:EDID HDMI VSDB max TMDS clock 150 MHz
001178.316: hdmi: HDMI:EDID HDMI VSDB video latency 0 ms
001178.335: hdmi: HDMI:EDID HDMI VSDB audio latency 0 ms
001178.356: hdmi: HDMI:EDID HDMI VSDB interlaced video latency 0 ms
001178.377: hdmi: HDMI:EDID HDMI VSDB interlaced audio latency 0 ms
001178.399: hdmi: HDMI:EDID HDMI VSDB does not support content type
001178.444: hdmi: HDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023
001178.592: hdmi: HDMI:EDID preferred mode remained as DMT (39) 1360x768p @ 60 Hz with pixel clock 85 MHz
001178.616: hdmi: HDMI: hotplug attached with HDMI support
001178.681: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001181.164: hdmi: HDMI: power_on to DMT mode 1360x768@60
001184.343: hdmi: HDMI: Action callback added to queue to happen at frame 0
001200.999: *** Restart logging
001202.352: Read command line from file 'cmdline.txt'
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
001454.401: Loading 'kernel7.img' to 0x8000 size 0x4086f8
001454.445: Kernel trailer DTOK property says yes
001454.460: Kernel trailer DDTK property says yes
001457.581: Loading 'bcm2710-rpi-cm3.dtb' to 0x4106f8 size 0x3bef
001535.391: dtparam: uart0_clkrate=48000000
001548.655: dtparam: audio=off
001559.155: dtparam: i2c_arm=on
001568.459: dtparam: i2c1=on
001577.914: dtparam: spi=off
001643.139: dtparam: arm_freq=1200000000
001684.922: dtparam: core_freq=400000000
001696.150: dtparam: cache_line_size=64
001716.980: Device tree loaded to 0x2fffbf00 (size 0x4075)
001718.587: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
002975.145: vchiq_core: vchiq_init_state: slot_zero = 0xf6c80000, is_master = 1
002978.839: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
002983.160: TV service:host side not connected, dropping notification 0x00000002, 0x00000002, 0x00000027
056340.258: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 2, power enable gpio = 3
056340.966: camsubs: Camera not found
056340.991: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 2, power enable gpio = 3
056341.697: camsubs: Camera not found
056341.721: camsubs: Looking for camera 0: i2c_port = 0, led gpio = 2, power enable gpio = 3
056342.426: camsubs: Camera not found
056349.458: camsubs: Looking for camera 1: i2c_port = 0, led gpio = 30, power enable gpio = 31
056351.075: camsubs: Camera found OK
056353.112: gpioman: gpioman_get_pin_num: pin FLASH_0_ENABLE not defined
056353.130: gpioman: gpioman_get_pin_num: pin FLASH_0_INDICATOR not defined
056353.164: gpioman: gpioman_get_pin_num: pin FLASH_0_ENABLE not defined
056353.182: gpioman: gpioman_get_pin_num: pin FLASH_0_INDICATOR not defined
056353.204: gpioman: gpioman_get_pin_num: pin CAMERA_LED not defined
056353.219: gpioman: gpioman_get_pin_num: pin CAMERA_LED not defined
192616.037: gpioman: gpioman_get_pin_num: pin FLASH_0_ENABLE not defined
192616.057: gpioman: gpioman_get_pin_num: pin FLASH_0_INDICATOR not defined
200468.642: mmalsrv: send_buffer_to_host: tx failed:size 292 st -1
200474.315: gpioman: gpioman_get_pin_num: pin CAMERA_LED not defined
277064.397: gpioman: gpioman_get_pin_num: pin FLASH_0_ENABLE not defined
277064.424: gpioman: gpioman_get_pin_num: pin FLASH_0_INDICATOR not defined
278534.140: gpioman: gpioman_get_pin_num: pin CAMERA_LED not defined
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras [solved]

Tue Feb 21, 2017 12:51 am

I should have clarified that I just replaced the compute module IO board. So far I've tried multiple IO boards, display adapters, cameras, and ribbon cables. I just ordered another CM3 Lite :roll: , so there is still a possibility of a hardware issue, but i'm pretty skeptical at this point.
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

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

Re: CM3 with Cameras [solved]

Tue Feb 21, 2017 8:58 am

Can you upload some photos of your wiring? It sounds like you know what you're doing, but you'd be surprised how many people double-check and still get it wrong.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1581
Joined: Sat Sep 10, 2011 11:43 am

Re: CM3 with Cameras [solved]

Tue Feb 21, 2017 9:02 am

Have you checked the GPIO numbers are the same as those in the dt-blob.bin? As far as I know this is still working although we don't have it as a regression test at the moment.

Also are you sure that you are using two camera converter boards (or the Pi Zero camera connector) and not accidentally using a display converter board (different pinout)

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras [solved]

Tue Feb 21, 2017 12:20 pm

Can you upload some photos of your wiring? It sounds like you know what you're doing, but you'd be surprised how many people double-check and still get it wrong.
Sure, I'd be relieved if it was a wiring issue, I'll upload one tonight.
Also are you sure that you are using two camera converter boards (or the Pi Zero camera connector) and not accidentally using a display converter board (different pinout)
Yes, I noticed that they'd easily be confused so I double checked.
Have you checked the GPIO numbers are the same as those in the dt-blob.bin?
That's the next step. I'm taking it for granted that the wiring described here:

https://www.raspberrypi.org/documentati ... -camera.md

Matches the dt-blob-dualcam.dts in the documentation. I'll check that tonight.
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9539
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 with Cameras [solved]

Tue Feb 21, 2017 12:25 pm

The blobs are in the process of being updated for CM3 - they half work at the moment.
I need to work out who to nudge to get https://github.com/raspberrypi/documentation/pull/509 merged.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras [solved]

Tue Feb 21, 2017 10:54 pm

Photos of the IO jumpers below. Should match what is shown here:

https://www.raspberrypi.org/documentati ... -camera.md

I'll check the blob later.


Also, a side note, why is my attachment limited to 64kb? Sorry for the grainy pictures!
Attachments
IMG_20170221_173806-416x312.jpg
IMG_20170221_173806-416x312.jpg (50.62 KiB) Viewed 9317 times
IMG_20170221_173752-416x312.jpg
IMG_20170221_173752-416x312.jpg (48.13 KiB) Viewed 9319 times
IMG_20170221_173731-312x416.jpg
IMG_20170221_173731-312x416.jpg (55.79 KiB) Viewed 9319 times
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras [solved]

Wed Feb 22, 2017 2:03 am

Reviewing the latest blob updated by 6by9 here:

https://github.com/6by9/documentation/b ... ualcam.dts

The only things that jumped out were the pins for cam0/cam1 seem swapped around from the tutorial (pints 0-3 going to cam0 instead of cam1 and pins 29-31 going to cam1 instead of cam0). I'm going to go ahead and try and see if it makes a difference but I'm skeptical:

Code: Select all

        pin_define@NUM_CAMERAS {
          type = "internal";
          number = <2>;
        };
        pin_define@CAMERA_0_LED {
          type = "internal";
          number = <2>;
        };
        pin_define@CAMERA_0_SHUTDOWN {
          type = "internal";
          number = <3>;
        };
        pin_define@CAMERA_0_UNICAM_PORT {
          type = "internal";
          number = <1>;
        };
        pin_define@CAMERA_0_I2C_PORT {
          type = "internal";
          number = <0>;
        };
        pin_define@CAMERA_0_SDA_PIN {
          type = "internal";
          number = <0>;
        };
        pin_define@CAMERA_0_SCL_PIN {
          type = "internal";
          number = <1>;
        };
        pin_define@CAMERA_1_LED {
          type = "internal";
          number = <30>;
        };
        pin_define@CAMERA_1_SHUTDOWN {
          type = "internal";
          number = <31>;
        };
        pin_define@CAMERA_1_UNICAM_PORT {
          type = "internal";
          number = <0>;
        };
        pin_define@CAMERA_1_I2C_PORT {
          type = "internal";
          number = <0>;
        };
        pin_define@CAMERA_1_SDA_PIN {
          type = "internal";
          number = <28>;
        };
        pin_define@CAMERA_1_SCL_PIN {
          type = "internal";
          number = <29>;
        };
Also noticed that the same I2C port was used, but I thought the cameras had to use different I2C ports? Or am I getting ports confused with something else?
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras [solved]

Wed Feb 22, 2017 2:14 am

Hmm, even worse. Still only one camera detected, but it's the same camera, cam0. However, cam0 doesn't return any data. See the messages below:

Code: Select all

root@DietPi:/# raspistill -cs 0 -o test.jpg
mmal: No data received from sensor. Check all connections, including the Sunny one on the camera board

root@DietPi:/# raspistill -cs 1 -o test.jpg
mmal: Could not select camera : error 3
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates
So the question is, was the original wiring correct them? Am I connected SDA/SCL connections to the wrong camera and that's why no data is coming? If that's true, how come the comments and variable names in the dt-blob.dts file say the opposite? Also, original problem still exists. Assuming other people are out there running both cameras on CM3's with this dt-blob, it must either be an issue with my hardware or the DietPi distribution. I'll find out later this week.
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9539
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 with Cameras [solved]

Wed Feb 22, 2017 11:33 am

The wiring as pictured and described is correct - I have one set up here on my desk.

There is a gotcha in that x in the CAMERA_x_ defines do NOT have to follow CAM0/CAM1 connector designation.
The CAMERA_x_UNICAM_PORT line specifes whether the logical camera "x" connects to the peripheral interface (called Unicam) 0 or 1 for the CSI data. Those are connected to the CAM0 and CAM1 connectors. Likewise the CAM0_ and CD0_ pins on the CMIO connect to CAM0, and CAM1_ / CD1_ pins to CAM1.

How you configure the CAMERA_x_ defines to map onto GPIOs, and then connect those GPIOs to the CAMx_ and CDx_ pins is up to you, as long as it is consistent.

I know it is complicated, but it has history. Unicam 0 only has 2 CSI2 data lanes, whilst Unicam 1 has 4. On phones back cameras tend to be the higher resolution sensor therefore want the 4 lanes. Mobile OSes tend to want the back camera as camera 0. Somewhere there is a mapping required, and it was done at this low level.
On the regular Pis, Unicam 1 is used, but there is only one camera. For the CMIO it might have made more sense that CAMERA_0_ mapped through to the CAM0 connector, but it is as it is.

If I were you, I'd try to manually talk to the sensor.
- Add "dtparam=i2c_arm" to /boot/config.txt and reboot.
- Load the i2c-dev module (if you haven't already).
- Install i2c-tools, and raspi-gpio.
- Connect CD1_[SDA|SCL] to pins 2&3, and CAM1_IO[0|1] to 4&5.
- "sudo raspi-gpio set 4 op dh"
- "sudo raspi-gpio set 5 op dh"
- "sudo raspi-gpio get" and check that 2&3 are SDA1 and SCL1, and 4&5 are outputs.
- "sudo i2c-detect -y 1" you should see a device (the camera) on address 0x10.
- Repeat but connecting CD0_[SDA|SCL] to pins 2&3, and CAM0_IO[0|1] to 4&5.
If that all checks out, then put the wiring back as the GPU should be able to see the cameras too.

(If you have recent enough firmware (post 27th Jan 2017 by the looks of it) then you should be able to safely add "dtparam=i2c_vc" instead of "i2c_arm", and then use raspi-gpio to set the pin muxing appropriately to check things exactly as the GPU sees the world. Don't try it with older firmware than that as you'll get odd results).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras [solved]

Thu Feb 23, 2017 12:41 am

Nobody's home for cam 1:

Code: Select all

root@DietPi:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 
But cam0 is there:

Code: Select all

root@DietPi:/dev# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --  
I'm going to do a firmware update, next is trying a different CM3 Lite module (in the mail), and finally will be running an origianl Raspian jessie installation
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras [solved]

Thu Feb 23, 2017 1:06 am

Almost thought I had it. Firmware update created a new mmal message that said not enough gpu memory. I found out that default in the config.txt for the Diet Pi distro all the gpu_mem values were set to 64, I set it to 256 then rebooted and tried it again and still no luck!

Code: Select all

root@DietPi:~# raspistill -cs 1
mmal: Could not select camera : error 3
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

root@DietPi:~# vcgencmd get_camera
supported=2 detected=1
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9539
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 with Cameras [solved]

Thu Feb 23, 2017 4:23 pm

If you've found that i2cdetect can't see the camera, then you need to be looking for a hardware issue. No amount of firmware updating will allow it to find the camera.
I think there is actually a smidge more detail in those i2cdetect dumps. 0x64 is the security chip address on the V2 camera module. Check that those goes away if you disconnect the camera board at the far end of the flex. If so then you need to be looking at the small connector from the camera board to the actual module.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

NatePiVision
Posts: 72
Joined: Fri Apr 29, 2016 5:38 am
Location: Pittsburgh
Contact: Website

Re: CM3 with Cameras [solved]

Thu Feb 23, 2017 5:29 pm

Interesting. I've actually swapped the small ribbon cables from cam0<->cam1 and the issue stays with cam1. That's why I first thought my IO board was defective. However now the only common denominator is the CM3 Lite chip itself. A few more days and I can test that theory. In which case, it doesn't sound worthwhile for me to try a clean Raspian/NOOBS installation.

Also, I'm a bit confused on one topic. I thought separate I2C connections were used for the cameras because of common addresses, however, I can only use 'i2cdetect -y 1' and not 'i2cdetect -y 0'. Also noticed there is a /dev/i2c-1 but not an /dev/i2c-0. Am I mistaken on how this works? Or is it a given that one of the cameras (cam0?) shares i2c-0 with the gpu and because of this isn't accessible with i2c-tools?
Current Pi based projects:
https://github.com/nategreco/DAPrototype - Advanced Driver Assist System (ADAS)
https://github.com/nategreco/StereoVisionTest - Stereo vision (CM3) test setup

Videos:
https://youtu.be/WRAR0lgYsj8
https://youtu.be/SyvCJLRw1UQ

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9539
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM3 with Cameras [solved]

Thu Feb 23, 2017 5:39 pm

NatePiVision wrote:Interesting. I've actually swapped the small ribbon cables from cam0<->cam1 and the issue stays with cam1. That's why I first thought my IO board was defective. However now the only common denominator is the CM3 Lite chip itself. A few more days and I can test that theory. In which case, it doesn't sound worthwhile for me to try a clean Raspian/NOOBS installation.
OK, in which case identify where that 0x64 address is coming from. Something is responding.
NatePiVision wrote:Also, I'm a bit confused on one topic. I thought separate I2C connections were used for the cameras because of common addresses, however, I can only use 'i2cdetect -y 1' and not 'i2cdetect -y 0'. Also noticed there is a /dev/i2c-1 but not an /dev/i2c-0. Am I mistaken on how this works? Or is it a given that one of the cameras (cam0?) shares i2c-0 with the gpu and because of this isn't accessible with i2c-tools?
You moved the cabling to GPIOs 2&3. Those connect to the BSC1 (Broadcom Serial Controller 1) hardware block that shows up as i2c-1.

The GPU talks to BSC0, which can be routed to GPIOs 0&1, 28&29, or 44&45. Unless you add "dtparam=i2c_vc=on" to your config.txt, then Linux is not told about BSC0, and the GPU can safely use it. (You need firmware from after Jan 2017 to safely do this on a CM3).
The GPU config has both which BSC block to use, and also which GPIOs to use it with. On starting a transaction it amends the pin muxing appropriately and then sends the I2C commands. That is how come it can talk to both camera modules despite them having the same address.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Compute Module”