Help to connect MIPI camera to wandboard-solo

2,618 views
Skip to first unread message

Norman

unread,
Jul 30, 2013, 1:50:13 AM7/30/13
to wand...@googlegroups.com
I made an adapter to the camera interface for a OV5640 MIPI camera module, and have problem running FSL's unit test autorun-v4l2.sh.

These are the steps I have taken so far:
- Build ov5640_camera_mipi.ko and mxc_v4l2_capture.ko
- Using Yocto wandboard-solo; Linux 3.0.35-r0 tree with fsl-image-test
- I didn't see any camera module init messages in dmesg
- modprobe ov5640_camera_mipi & mxc_v4l2_capture did not return any error
- lsmod list looks reasonable to me:

Module                  Size  Used by
                                                           
mxc_v4l2_capture       21077 1                                                                
ipu_bg_overlay_sdc      3929  1 mxc_v4l2_capture                                            
ipu_still               1707  1 mxc_v4l2_capture                                              
ipu_prp_enc             4685  1 mxc_v4l2_capture                                             
ipu_csi_enc             2941  1 mxc_v4l2_capture                                              
ipu_fg_overlay_sdc      4760  1 mxc_v4l2_capture                                           
ov5640_camera_mipi     19666  0                                                           
camera_sensor_clock      721  1 ov5640_camera_mipi 

-  When I run autorun-v4l2.sh, it said cannot find  /dev/video0

I checked with a running Boundary device iMX6Q board, it seems that these sys files are missing :
lrwxrwxrwx  1 root root 0 Jul 20 21:28 video0 -> ../../devices/virtual/video4linux/video0
lrwxrwxrwx  1 root root 0 Jul 20 21:28 video1 -> ../../devices/virtual/video4linux/video1

I wonder how and when  these devices are created? 
How can I check to see if the module is communicating with the camera?

I appreciate any suggestions/ideas to debug this?

Thanks,
Norman

jons...@gmail.com

unread,
Jul 30, 2013, 9:22:21 AM7/30/13
to wand...@googlegroups.com
I haven't played with the cameras... but you might need to make a node
in the device tree that says the camera is present.
Compare the xxx.dts files for the wandboard and the boundary device board.

Is there a camera module available that plugs into the wandboard? I've
never found one. I was going to order a Boudrary Devices board just to
get camera support. Which one is better? the older Sabre-lite or the
Nitrogen6x?

>
> Thanks,
> Norman
>
> --
> You received this message because you are subscribed to the Google Groups
> "Wandboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to wandboard+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Jon Smirl
jons...@gmail.com

Maxim Podbereznyy

unread,
Jul 30, 2013, 9:26:33 AM7/30/13
to wand...@googlegroups.com
Hi!

I own Boundary Sabre Lite with cameras, displays, SATA and all other stuff. Nitrogen and the Lite have absolutely the same schematic except for Nitrogen has (can have) a Wifi module installed (LSR Tiwi-R2). That's all. SW support is identical.

John Weber

unread,
Jul 30, 2013, 10:34:54 AM7/30/13
to wand...@googlegroups.com
>>
>> - When I run autorun-v4l2.sh, it said cannot find /dev/video0
>>
>> I checked with a running Boundary device iMX6Q board, it seems that these
>> sys files are missing :
>> lrwxrwxrwx 1 root root 0 Jul 20 21:28 video0 ->
>> ../../devices/virtual/video4linux/video0
>> lrwxrwxrwx 1 root root 0 Jul 20 21:28 video1 ->
>> ../../devices/virtual/video4linux/video1
>>
>> I wonder how and when these devices are created?
>> How can I check to see if the module is communicating with the camera?
>>
>> I appreciate any suggestions/ideas to debug this?

I have a MIPI camera working on Wandboard Dual and Wandboard Quad. I'll test it
on Solo today.

I do all of my development with Yocto and am running the latest snapshot from
the fsl-community-bsp. You'll need to check out the 'master' branch. Dylan
(stable branch) does not have support for the MIPI-CSI camera as it is using the
Android kernel from Wandboard.

The main thing you'll need is the kernel and a good kernel config. I have the
MIPI-CSI camera working on the kernel used by Yocto in the master branch (which
in full disclosure happens to be the kernel I'm managing for now). You
shouldn't have to do any special config to get it to run.

The camera driver loads automatically by udev, and the /dev/video0 node is
available once mxc_v4l2_capture is loaded.

Again, I'll test on Wandboard Solo today and let you know. There could be a
tweak to the internal signal routing for the IPU needed on Solo, but I doubt it.

Norman Cheung

unread,
Jul 30, 2013, 3:08:58 PM7/30/13
to wand...@googlegroups.com
Many thanks John, Maxim and Jon for the quick reply.

Jon: I am using the boundary device MIPI-CSI OV5640 camera.  this camera is working in my Nitorgen6X(quad) board.  I have my colleague build me an interface ribbon and adapter for Wandboard.  From the Nitrogen6X schmetic it seems that the camera clock is from PWN and Wandboard is from CCM_CLK02.  So I wonder if the base platform cofig needs to change.  

John: I am using Yocto Dylan 9.0.1, with no change to the source tree.  I am building with fsl-image-test. 
After I boot, I didn't see any messages in dmesg referring to the camera (I saw IPU and V2L2 capture driver).  So I modprobe the ov5640_camera_mipi and v4l2_capture as well. 

I wonder what camera module are you using?  I just want a camera that works supporting 720p capture. 

Thanks in advance on your test result,
Norman



--
You received this message because you are subscribed to a topic in the Google Groups "Wandboard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wandboard/y0kTePBdz7w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wandboard+unsubscribe@googlegroups.com.

jons...@gmail.com

unread,
Jul 30, 2013, 3:16:44 PM7/30/13
to wand...@googlegroups.com
OV5640 camera don't cost that much, here is one for $14.
http://www.aliexpress.com/item/5-0megapixel-golden-finger-MP4-camera-module-mini-dvr-module-vw-reverse-camera-OV5640-color-CMOS/585426197.html

What's missing is the small conversion board that converts this cable
into one that the Wandboard will accept.

Maybe we're super lucky and this cable could directly plug into the Wandboard?


--
Jon Smirl
jons...@gmail.com

John Weber

unread,
Jul 30, 2013, 5:26:49 PM7/30/13
to wand...@googlegroups.com
Norman,

The kernel used in Dylan does not have support MIPI-CSI. You'll need to branch
to master to do this. Follow these instructions:

http://wiki.wandboard.org/index.php/Getting_started_with_Yocto_on_Wandboard#Getting_the_latest_code

In short, I've been through the development of getting the kernel to work with
MIPI-CSI. Most of the changes are in the platform board file. Yes - the clock
is CCM_CLKO2 (not zero, but uppercase 'O') and the the PWM. There is a little
hiccup in the naming of a GPIO pin as well, but that was just on the schematic.

John



On 7/30/13 2:08 PM, Norman Cheung wrote:
> Many thanks John, Maxim and Jon for the quick reply.
>
> Jon: I am using the boundary device MIPI-CSI OV5640 camera. this camera is
> working in my Nitorgen6X(quad) board. I have my colleague build me an interface
> ribbon and adapter for Wandboard. From the Nitrogen6X schmetic it seems that
> the camera clock is from PWN and Wandboard is from CCM_CLK02. So I wonder if
> the base platform cofig needs to change.
>
> John: I am using Yocto Dylan 9.0.1, with no change to the source tree. I am
> building with fsl-image-test.
> After I boot, I didn't see any messages in dmesg referring to the camera (I saw
> IPU and V2L2 capture driver). So I modprobe the ov5640_camera_mipi and
> v4l2_capture as well.
>
> I wonder what camera module are you using? I just want a camera that works
> supporting 720p capture.
>
> Thanks in advance on your test result,
> Norman
>
>
>
> On Tue, Jul 30, 2013 at 7:34 AM, John Weber <rjohn...@gmail.com
> <mailto:rjohn...@gmail.com>> wrote:
>
>
> - When I run autorun-v4l2.sh, it said cannot find /dev/video0
>
> I checked with a running Boundary device iMX6Q board, it seems that
> these
> sys files are missing :
> lrwxrwxrwx 1 root root 0 Jul 20 21:28 video0 ->
> ../../devices/virtual/__video4linux/video0
> lrwxrwxrwx 1 root root 0 Jul 20 21:28 video1 ->
> ../../devices/virtual/__video4linux/video1
> https://groups.google.com/d/__topic/wandboard/y0kTePBdz7w/__unsubscribe
> <https://groups.google.com/d/topic/wandboard/y0kTePBdz7w/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> wandboard+unsubscribe@__googlegroups.com
> <mailto:wandboard%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/__groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Wandboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to wandboard+...@googlegroups.com.

Norman Cheung

unread,
Jul 30, 2013, 5:37:05 PM7/30/13
to wand...@googlegroups.com

Many thanks John.  I will try that.

Norman


For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to a topic in the Google Groups "Wandboard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wandboard/y0kTePBdz7w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wandboard+unsubscribe@googlegroups.com.

Norman Cheung

unread,
Jul 31, 2013, 10:25:48 PM7/31/13
to wandboard


I rebuild with the master branch. And it seems not 

Norman Cheung

unread,
Jul 31, 2013, 10:30:04 PM7/31/13
to wandboard
John,

I rebuild with the master branch. And it seems not be able to init the camera:

< snip dmesg...  found the IPU>
[    0.665760] usbcore: registered new device driver usb                        
[    0.691043] imx-ipuv3 imx-ipuv3.0: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(
[    0.699199] mxc_mipi_csi2 mxc_mipi_csi2: i.MX MIPI CSI2 driver probed        
[    0.705724] mxc_mipi_csi2 mxc_mipi_csi2: i.MX MIPI CSI2 dphy version is 0x313
[    0.713430] MIPI CSI2 driver module loaded                                   
[    0.717728] Advanced Linux Sound Architecture Driver Version 1.0.24.         
.
.
<snip...>
[    5.965874] udevd[1275]: starting version 182                                
[    6.583397] ov5640_read_reg:write reg error:reg=300a                         
[    6.588367] camera ov5640_mipi is not found                                  
[    9.434673] eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:


Any suggestion to debug?

Thanks,
Norman

John Weber

unread,
Jul 31, 2013, 10:39:36 PM7/31/13
to wand...@googlegroups.com
I would start with your module adapter board hardware and cable. This message:

> [ 6.583397] ov5640_read_reg:write reg error:reg=300a
> [ 6.588367] camera ov5640_mipi is not found

is seen when the I2C interface cannot communicate with the sensor. Make sure
you have good power, clock, and I2C signals. The I/O voltage for the sensor is
lower than 3.3V, and so you would need an I2C voltage translator (at least for
SDA) to bring the voltage down to the sensor I/O voltage.

The sensor will not talk unless you provide a clock to it. This should be
supplied from the processor but needs to be routed to the sensor properly. You
need to check RST and PWDN as well. Both of those can cause issues if they are
not properly routed to the sensor. I didn't have to do anything in the kernel
with those except to ensure proper GPIO and iomux allocation.

John
> <mailto:rjohn...@gmail.com>> wrote:
>
> Norman,
>
> The kernel used in Dylan does not have support MIPI-CSI. You'll
> need to branch to master to do this. Follow these instructions:
>
> http://wiki.wandboard.org/__index.php/Getting_started___with_Yocto_on_Wandboard#__Getting_the_latest_code
> <mailto:rjohn...@gmail.com <mailto:rjohn...@gmail.com>>> wrote:
>
>
> - When I run autorun-v4l2.sh, it said cannot find
> /dev/video0
>
> I checked with a running Boundary device iMX6Q
> board, it seems that
> these
> sys files are missing :
> lrwxrwxrwx 1 root root 0 Jul 20 21:28 video0 ->
> ../../devices/virtual/____video4linux/video0
> lrwxrwxrwx 1 root root 0 Jul 20 21:28 video1 ->
> ../../devices/virtual/____video4linux/video1
> https://groups.google.com/d/____topic/wandboard/y0kTePBdz7w/____unsubscribe
> <https://groups.google.com/d/__topic/wandboard/y0kTePBdz7w/__unsubscribe>
> wandboard+unsubscribe@__google__groups.com
> <http://googlegroups.com>
> <mailto:wandboard%__2Buns...@googlegroups.com
> <mailto:wandboard%252Buns...@googlegroups.com>__>.
> For more options, visit
> https://groups.google.com/____groups/opt_out
> <https://groups.google.com/__groups/opt_out>
> <https://groups.google.com/__groups/opt_out
> <https://groups.google.com/groups/opt_out>>.
>
>
>
> --
> You received this message because you are subscribed to the
> Google Groups
> "Wandboard" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email
> to wandboard+unsubscribe@__googlegroups.com
> <mailto:wandboard%2Bunsu...@googlegroups.com>.
> For more options, visit
> https://groups.google.com/__groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
>
> --
> You received this message because you are subscribed to a topic in
> the Google Groups "Wandboard" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/__topic/wandboard/y0kTePBdz7w/__unsubscribe
> <https://groups.google.com/d/topic/wandboard/y0kTePBdz7w/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> wandboard+unsubscribe@__googlegroups.com
> <mailto:wandboard%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/__groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Wandboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to wandboard+...@googlegroups.com.

jons...@gmail.com

unread,
Jul 31, 2013, 10:49:13 PM7/31/13
to wand...@googlegroups.com
Freescale doc says...

Hardware for SABRE SD:
· Front Camera: OV5642 CSI camera
· Rear Camera: OV5640 MIPI camera

You have a OV5642 CSI camera, not a OV5640 mipi one.

Driver error is: [ 6.583397] ov5640_read_reg:write reg error:reg=300a

Do you need to adjust anything for the swap between OV5642 and OV5640?
>>>>> to wandboard+...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Wandboard" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/wandboard/y0kTePBdz7w/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> wandboard+...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Wandboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to wandboard+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Jon Smirl
jons...@gmail.com

Norman Cheung

unread,
Aug 1, 2013, 12:09:32 AM8/1/13
to wandboard
Thank you John.  I will check all that.
BTW, how did you test the video? gstreamer?  Or is there a lower level test program?

Thanks,
Normn


                     <mailto:wandboard%__2Bunsu...@googlegroups.com
                <mailto:wandboard%252Bunsubscribe@googlegroups.com>__>.

For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to a topic in the Google Groups "Wandboard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wandboard/y0kTePBdz7w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wandboard+unsubscribe@googlegroups.com.

Norman Cheung

unread,
Aug 1, 2013, 12:12:45 AM8/1/13
to wandboard
Jon,

I have a mipi OV5640 camera.  
The module loaded was ov5640_camera_mipi.  So that seems OK.

It was working with the Nitrogen6X Quad board, I just build a cable to get that fit into the wandboard interface.

Thanks,
Norman

Norman Cheung

unread,
Aug 13, 2013, 12:40:03 AM8/13/13
to wandboard
Thank you all for your help. I have the camera working. Using the
master branch is absolutely needed.

Also my camera's POWER pin was connected to the wrong pin. For those
who will be using Boundary Device's MIPI OV5640 camera module, The POWER
line is labelled MIPI_BKLGT_ON. That connects to Wandboard's GPIO_6.
Took me awhile to figured that out.

Thanks,
Norman




Norman Cheung

unread,
Sep 10, 2013, 1:00:50 AM9/10/13
to Bardi, wandboard
Bardi,

It depends on which camera module.  For me, I used the Boundary device's MIPI OV5640 module.   I have my colleague build an adapter for this.  I think the easiest is to start with the lines from your camera module, and map them to the lines in the camera header in Wandboard.

Hope this helps,
Norman

Norman
On 9/9/13 8:49 PM, Bardi wrote:
Hi Norman,

How did you connect your mipi to wandboard interface ?
Do you know any application note about connecting a mipi camera to csi port ?
Could you please send me the schematic or pin diagram of your cable ?

Thanks in advance
Bardi 


Yogesh Kondawar

unread,
May 7, 2014, 8:39:22 AM5/7/14
to wand...@googlegroups.com, Bardi, brjer...@gmail.com
Hi,

We wanted to interface OV9712 camera sensor to IMX6 solo. Need to understand how we can convert Bayer RGB RAW data to YUV since there is no support from the freescale SDK.

Please advise us and provide some hints.

Yogesh
Reply all
Reply to author
Forward
0 new messages