Using Raspberry Pi MIPI Cameras with Rock Pi4

I am looking around and found out that the headers are not installed

sudo dpkg-reconfigure -phigh build-essential linux-headers-uname -r
[sudo] password for rock:
dpkg-query: package ‘linux-headers-4.4.154-999-rockchip-gc26d93d00149’ is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
/usr/sbin/dpkg-reconfigure: linux-headers-4.4.154-999-rockchip-gc26d93d00149 is not installed

So i filely installed the Header package with this:
sudo apt-get --reinstall install /home/rock/linux-headers-4.4.154-999-rockchip-gc26d93d00149_4.4.154-999-rockchip_all.deb

After that i was able to run

sudo dpkg-reconfigure -phigh build-essential linux-headers-uname -r

For /boot/extlinux/extlinux.conf, please edit /etc/default/extlinux file and run /usr/local/sbin/update_extlinux.sh manually to take effect.

Hi @jack and thanks for the reply.

this is what i see now with Dmesg

   rock@master:~$ dmesg | grep cam
[    2.699346] of_get_named_gpiod_flags: parsed 'pwdn-gpios' property of node '/i2c@ff3d0000/camera-module@10[0]' - status (0)
rock@master:~$ dmesg | grep vid
[    0.000000] rockchip_cpuclk_pre_rate_change: limiting alt-divider 33 to 31
[    1.540624] Linux video capture interface: v2.00
[    2.728286] usbcore: registered new interface driver uvcvideo
rock@master:~$ i2cdetect -l
i2c-0   unknown         rk3x-i2c                                N/A
i2c-1   unknown         rk3x-i2c                                N/A
i2c-2   unknown         rk3x-i2c                                N/A
i2c-4   unknown         rk3x-i2c                                N/A
i2c-7   unknown         rk3x-i2c                                N/A
i2c-9   unknown         DesignWare HDMI                         N/A

 rock@master:~$ sudo i2cdetect -y 1

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I also found the code for the driver : ov5647.c

How can we make a module with this so we can load it in the kernel?

hello, @Pierre
About the “rkximagesink”, here is the related pages from github

So, the [gstreamer-rockchip-extra] library and the related rockchip libraries may be necessary to run this command, i think.

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! videoconvert ! video/x-raw,format=NV12,width=1920,height=1080 ! rkximagesink

Btw, i am trying to make a raspberry pi camera module working on rock pi as well.
Hope we can make it done quickly.

Good luck!

I give it a try Thanks!

Hi everyone,

Any news on this ? @Pierre, did it work?

@jack the devicetree you pasted puts imx219 on i2c4, but the schematics for Rockpi4 the camera should be on either i2c2 or i2c7. What am I missing here?

Thanks!
Eze

Ah, I wasn’t reading the schematics right. With the right I2C and the right GPIO enabled, now the camera is detected!

1 Like