8MPLUSLPD4-EVK with MINISASTOCSI usage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

8MPLUSLPD4-EVK with MINISASTOCSI usage

Jump to solution
5,260 Views
TerryBarnaby1
Contributor IV

I have the 8MPLUSLPD4-EVK and MINISASTOCSI camera module and I am trying to get the camera to work. Is there any information on this somewhere ?

The 8MPLUSLPD4-EVK is powering up fine with default software. To get the camera to be recognised I used the following commands in uboot (guessed from looking at "/run/media/mmcblk2p1" and Internet info):

  1. “setenv fdt_file imx8mp-evk-ov2775-ov5640.dtb”
  2. "save"
  3. “run bootcmd”

I have plugged the MINISASTOCSI camera into the CSI1 connector. There is /dev/video0 and /dev/video1 after this.

However when I run: "gst-launch-1.0 v4l2src ! autovideosink" I get the error:

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
../../../git/sys/v4l2/gstv4l2src.c(660): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/G
stV4l2Src:v4l2src0:
Buffer pool activation failed

If I run "gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080 ! ximagesink" then I get the error:

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../../../../git/libs/gst/base/gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV
4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)

Has anyone any info on how to get the camera to work with this environment ?

0 Kudos
1 Solution
5,237 Views
TerryBarnaby1
Contributor IV

Doh, I have found the reason. Despite connecting this camera 5 times I had not been pushing the MINISAS cable quite all the way it. It needs a fair amount of force to push past the locking mechanism.

All is working fine as a ov5640 camera now. Not sure what the "os08a20_probe camera mipi os08a20, is found." kernel message is about.

View solution in original post

0 Kudos
14 Replies
4,992 Views
TerryBarnaby1
Contributor IV

As far as I am aware (no documentation I have found) The imx8mp-evk-ov2775-ov5640.dtb DTB is for a ov2775 camera plugged into the socket marked "CSI1 MIPI" and a second ov5640 camera plugged into the socket marked "CSI2 MIPI". Just making sure that is your setup ?

In my case with a single MINISASTOCSI ov5640 camera plugged into the "CSI1 MIPI" socket all worked with the default DTB for the board imx8mp-evk.dtb I think. At least once I had fully pushed home the connector (takes a fair pressure to "fully" click in place). Confusing use of CSI2 as a communication standard and as a name for a second socket here.

For gstreamer I had to use the V4L devices /dev/video1 with just the one camera plugged in. /dev/video0 is I think linked to the display generation hardware perhaps for accessing GPU generated images.

0 Kudos
4,987 Views
kenizgandhi
Contributor III

Hello @TerryBarnaby1 , 

Thank You for the reply. 

I changed my fdt_file to default. Still its not working.

root@imx8mpevk:~# v4l2-ctl --list-devices
mxc-isi-m2m (platform:32e00000.isi:m2m_devic):
/dev/video0

gst-launch-1.0 v4l2src device=/dev/video0 ! autovideosink
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device '/dev/video0' is not a capture device.
Additional debug info:
../git/sys/v4l2/v4l2_calls.c(681): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Capabilities: 0x4204000
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...

0 Kudos
4,981 Views
TerryBarnaby1
Contributor IV

The MINISASTOCSI will appear as /dev/video1 if it can be contacted over the I2C bus, with your setup I think. Make sure it is "FULLY" plugged into the "CSI1 MIPI" socket and I mean "FULLY" until it clicks. As a 40 year veteran of hands on electronics and after plugging in the camera multiple times I had not actually fully plugged in this camera and had the same issues you are seeing.

In /var/log/messages you might see:

[ 5.630933] hid-generic 0003:0835:8502.0005: device has no listeners, quitting
[ 5.826981] ov5645 1-003c: ov5645_write_reg: write reg error -6: reg=3103, val=11
[ 5.835084] ov5645 1-003c: could not set init registers
[ 5.845237] ov5645 1-003c: could not power up OV5645

This indicates that the ov5645 driver is at least being loaded, but cannot see the ov5645 on the I2C bus.

You can also use i2cdetect (might have to install it) , to see if the ov5645 is found.

0 Kudos
5,228 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

For the dtb you're using OV2775 connect to CSI port 0 and OV5640 connect to CSI port 1, as bellow:

OV2775 => CSI1

OV5640 => CSI2

Board needs to rework to support this feature.

 

I would suggest to try with the imx8mp-evk-basler-ov5640.dtb the Basler camera connect to CSI port 0 and OV5640 connect to CSI port 1, as bellow:

Basler => CSI1

OV5640 => CSI2

This Don't need to board rework.

Best regards,
Aldo.

0 Kudos
1,519 Views
araja
Contributor III

Hi,

I am using the same setup with MINISASTOCSI ov5640 camera, I am using L5.15.32 yocto configuration and with this setup, I was not able to test the ov5640. Below are the v4l2-ctl output details, but with this /dev/video0 or /dev/video1 It was not capturing the camera input with MIPI1 CSI2.

#dmesg | grep ov564
[ 2.232927] ov5640 1-003c: supply DOVDD not found, using dummy regulator
[ 2.239727] ov5640 1-003c: supply AVDD not found, using dummy regulator
[ 2.246388] ov5640 1-003c: supply DVDD not found, using dummy regulator

~# v4l2-ctl --list-devices
mxc-isi-m2m (platform:32e00000.isi:m2m_devic):
/dev/video2

vsi_v4l2dec (platform:vsi_v4l2dec):
/dev/video1

vsi_v4l2enc (platform:vsi_v4l2enc):
/dev/video0

I am not seeing any errors related to the ov5640 driver load but I could not able to see any mxc capture and output driver registration in the dmesg logs. 

Could you please let me know the defconfig and dtsi changes that need to be done for the ov5640 camera to work?.

Is there any document that I can refer to bring the ov5640 camera working in the iMX8MP-EVK board?.

I also tried with all the options posted in this link with no luck.

Please help me in bringing the ov5640 camera device working with iMX8MP-EVK board. Thanks in advance. 

0 Kudos
1,444 Views
TerryBarnaby1
Contributor IV

There isn't much information on how all of this works or how to setup the system unfortunately.

Eventually, when it is working, you will see a /dev/video3 which will be your camera.

As there are messages about ov5640, it suggests your dtb has the ov5640 camera included. Maybe you have plugged the camera into the wrong CSI2 input that does not match the DTB or you have, like i did, not fully pushed in the SAS connectors ?

For the camera to work you will likely need:

1. DTB used has ov5640 entry on the correct I2C bus.

2. Camera is plugged in and can be contacted over the I2C bus.

Good luck!

0 Kudos
1,440 Views
araja
Contributor III

Hi Terry,

Thanks for the reply.

As you mentioned when it's working the camera will be seen under /dev/video3.

Can you please share the changes you made in the build / yocto of the working version?

Or the document you followed to build the imx8 that enumerates the camera under video3.

Also if possible share the camera part of DTS lines.

As you suggested I rechecked the I2C and the connector part. I see the boot log with no error for ov5640 when I plug the camera on the right connector which I assume that the I2C driver is able to interact with the camera.

My DTS file is for your reference.

ov5640_0: ov5640_mipi@3c {
        compatible = "ovti,ov5640";
        reg = <0x3c>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_csi0_pwn>, <&pinctrl_csi0_rst>, <&pinctrl_csi_mclk>;
        clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
        clock-names = "xclk";
        assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
        assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
        assigned-clock-rates = <24000000>;
        csi_id = <0>;
        powerdown-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
        reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
        mclk = <24000000>;
        mclk_source = <0>;
        mipi_csi;
        status = "okay";

 

        port {
            ov5640_mipi_0_ep: endpoint {
                remote-endpoint = <&mipi_csi0_ep>;
                data-lanes = <1 2>;
                clock-lanes = <0>;
            };
        };
    };

 

&mipi_csi_0 {
    #address-cells = <1>;
    #size-cells = <0>;
    status = "okay";

 

    port@0 {
        reg = <0>;
        mipi_csi0_ep: endpoint {
            remote-endpoint = <&ov5640_mipi_0_ep>;
            data-lanes = <2>;
            csis-hs-settle = <13>;
            csis-clk-settle = <2>;
            csis-wclk;
        };
    };
};

 

Is that anything I am missing to add in the config files to enable the camera?

Please guide me if you have any information.

 

0 Kudos
1,436 Views
TerryBarnaby1
Contributor IV

I can't remember as it was some time ago and we just did this as a quick test of things as we were developing our own custom IMX8mp board with a TP2856 video chip.

However, we did not need to change/build any Yocto code or create any DTS/DTSI files for the test, one of the standard NXP DTB's in the installed EVK was used (by changing the uboot env) and once we plugged in the camera properly it worked.

The standard EVK DTS (well one of them) has:

ov5640_0: ov5640_mipi@3c {
compatible = "ovti,ov5640";
reg = <0x3c>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_csi0_pwn>, <&pinctrl_csi0_rst>, <&pinctrl_csi_mclk>;
clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
clock-names = "xclk";
assigned-clocks = <&clk IMX8MP_CLK_IPP_DO_CLKO2>;
assigned-clock-parents = <&clk IMX8MP_CLK_24M>;
assigned-clock-rates = <24000000>;
csi_id = <0>;
powerdown-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
mclk = <24000000>;
mclk_source = <0>;
mipi_csi;
status = "okay";

port {
ov5640_mipi_0_ep: endpoint {
remote-endpoint = <&mipi_csi0_ep>;
data-lanes = <1 2>;
clock-lanes = <0>;
};
};
};

 

Not sure that is the DTS entry that was used though.

It is worth checking if the camera is seen on an I2C bus using the "i2cdetect -y [0,1,2]" commands for the different I2C busses.

0 Kudos
5,221 Views
TerryBarnaby1
Contributor IV

Thanks for the information.

In our case we were only using the imx8mp-evk-ov2775-ov5640.dtb as the MINISASTOCSI OV5640 camera was not working due to the connector not being pushed fully home.

As we did not see the camera we assumed (did not find any documentation on th dtb's) that the imx8mp-evk-ov2775-ov5640.dtb supported either a single ov2775 or ov5640 camera, rather than both of these on the two CSI interfaces.

0 Kudos
5,238 Views
TerryBarnaby1
Contributor IV

Doh, I have found the reason. Despite connecting this camera 5 times I had not been pushing the MINISAS cable quite all the way it. It needs a fair amount of force to push past the locking mechanism.

All is working fine as a ov5640 camera now. Not sure what the "os08a20_probe camera mipi os08a20, is found." kernel message is about.

0 Kudos
5,261 Views
TerryBarnaby1
Contributor IV

By the way selected output of "dmesg" is as follows:

[    5.686750] ov2775 1-0036: 1-0036 supply DOVDD not found, using dummy regulator
[    5.694197] ov2775 1-0036: 1-0036 supply DVDD not found, using dummy regulator
[    5.707502] ov2775 1-0036: 1-0036 supply AVDD not found, using dummy regulator
[    5.726100] os08a20_probe camera mipi os08a20, is found
[    5.736382] Error: Driver 'ov2775' is already registered, aborting...
[    5.737154] imx8_media_dev: module is from the staging directory, the quality is unknown, you have been warned.
[    5.760503] mx8-img-md: Registered mxc_isi.1.capture as /dev/video0
[    5.768845] mx8-img-md: Registered sensor subdevice: ov2775 1-0036 (1)
[    5.778297] mx8-img-md: created link [mxc_isi.1] => [mxc_isi.1.capture]
[    5.786761] mx8-img-md: created link [mxc-mipi-csi2.1] => [mxc_isi.1]
[    5.796713] imx-sdma 30bd0000.dma-controller: loaded firmware 4.5
[    5.797125] mx8-img-md: created link [ov2775 1-0036] => [mxc-mipi-csi2.0]
[    5.846738] mxc-md 32c00000.bus:camera: mxc_md_create_links
[    5.864711] clean ISI channel: mxc_isi.1
[    5.895295] enter viv_video_init_module
[    5.902162] Error: Driver 'mxc-mipi-csi2-sam' is already registered, aborting...
[    5.909804] enter viv_dwe_init_module
[    5.909810] enter viv_isp_init_module
[    5.915751] register platform driver failed.
[    5.944719] enter isp_hw_probe
[    5.951029] enter dwe_hw_probe
[    5.972598] vvcam dewarp driver probed
[    6.008851] Error: Driver 'mxc-mipi-csi2-sam' is already registered, aborting...
[    6.013097] vvcam isp driver registered
[    6.016801] register platform driver failed.

0 Kudos
5,247 Views
TerryBarnaby1
Contributor IV

Is there actually and info/documentation on the MINISASTOCSI module anywhere as I can't find any.

The sales info states it is based on a ov5640 chip. However the I2C address of a ov5640 is 0x3c and there isn't anything there.

With the imx8mp-evk-ov2775-ov5640.dtb there is an I2C device at 0x36 on I2C bus 1 and the kernel states os08a20_probe camera mipi os08a20, is found.

So what actual camera chip is on the latest MINISASTOCSI and what are its specs, as well as how it can be used with the 8MPLUSLPD4-EVK ?

0 Kudos
5,098 Views
john_phillippe
NXP Employee
NXP Employee

I'm gonna guess that there is some differences between the Serial Camera Control Bus (SCCB) and the I2C specs.  I just tried pinging the device on an 8M Plus evk and found the same issue - nothing comes back even though the command "i2cdetect 1" does show a device on the 0x3C address (the address found during boot):

[ 5.924075] mx8-img-md: Registered sensor subdevice: ov5640 1-003c (1)
[ 5.992219] mx8-img-md: created link [ov5640 1-003c] => [mxc-mipi-csi2.0]

 

But to answer your first question that camera is indeed the Omnivision OV5640. 

0 Kudos
5,010 Views
kenizgandhi
Contributor III

Hello @john_phillippe , @TerryBarnaby1@AldoG

I am stuck with this from last week. Please help me solve this issue.I am using the imx8m plus evk board and I connected the MINISASTOCSI to MIPI CSI 2 and set the fdt file to imx8mp-evk-ov2775-ov5640.dtb. Still it is not recoginising ov5640.

[ OK [ 12.128319] imx8_media_dev: module is from the staging directory, the quality is unknown, you have been warned.
] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[ 12.145835] Error: Driver 'ov2775' is already registered, aborting...
[ 12.154603] imx-sdma 30bd0000.dma-controller: loaded firmware 4.5
[ OK ] Listening on D-Bus S[ 12.163910] mx8-img-md: Registered mxc_isi.1.capture as /dev/video0
ystem Message Bus Socket.
[ 12.184262] mx8-img-md: Registered sensor subdevice: ov2775 1-0036 (1)
[ OK ] Listening on dropbea[ 12.193521] mx8-img-md: created link [mxc_isi.1] => [mxc_isi.1.capture]
r.socket.
[ 12.203194] mx8-img-md: created link [mxc-mipi-csi2.1] => [mxc_isi.1]
[ OK [ 12.212985] mx8-img-md: created link [ov2775 1-0036] => [mxc-mipi-csi2.0]
] Reached target Sockets[ 12.221931] mxc-md 32c00000.bus:camera: mxc_md_create_links
.

root@imx8mpevk:~# v4l2-ctl --list-devices
():
/dev/v4l-subdev0
/dev/v4l-subdev3
/dev/v4l-subdev4

():
/dev/v4l-subdev1

(csi0):
/dev/v4l-subdev2

FSL Capture Media Device (platform:mxc-md):
/dev/media0

VIV (platform:viv0):
/dev/video0

VIV (platform:viv1):
/dev/video1

root@imx8mpevk:~# gst-launch-1.0 v4l2src device=/dev/video0 ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
../git/sys/v4l2/gstv4l2src.c(659): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../git/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:15.491856750
Setting pipeline to NULL ...
Freeing pipeline ...

Feel free to ask anymore info you need. 

Thank You.

Kind Regards,

Keniz Pankajkumar Gandhi

0 Kudos