odroid-m1:application_note:mipi_csi

MIPI Camera

Please check how to connect mipi camera Before follow this page.

This page is based on the OV5647 MIPI Camera module.

First, Please add DTB overlay to config.ini. it is on the /boot for ubuntu, or on the /fat for android. After edit the config.ini file, please reboot the odroid board.

Open /boot/config.ini and add ov5647 to the line with overlays.

[generic]
...
overlay_resize=16384
overlays="i2c0 i2c1 ov5647"
...

Then install a package to run MIPI camera.

$ sudo apt update
$ sudo apt install rkaiq
target
# busybox vi /fat/config.ini
target
...
overlay_resize=16384
overlays="i2c0 i2c1 ov5647"
...

Now you can use the Camera module.

When you correctly installed the ov5647 camera module, you should see the below dmesg.

target
odroidm1:/ # dmesg|grep ov5647
[    0.587388] ov5647 2-0036: Failed to get pwdn-gpios
[    0.595998] rockchip-csi2-dphy csi2-dphy0: dphy0 matches m00_b_ov5647 2-0036:bus type 4
[    6.521741] ov5647 2-0036: OV5647 power on
[    6.590193] ov5647 2-0036: OV5647 power off
[    6.593602] ov5647 2-0036: OV5647 power on
[    6.648425] ov5647 2-0036: OV5647 power off
[    6.652073] ov5647 2-0036: OV5647 power on
[    6.807975] ov5647 2-0036: OV5647 power off
[    6.829023] ov5647 2-0036: OV5647 power on
[    7.349194] ov5647 2-0036: OV5647 power off
[    7.367480] ov5647 2-0036: OV5647 power on
[    7.460546] ov5647 2-0036: OV5647 power off
[    7.465029] ov5647 2-0036: OV5647 power on
[    7.637836] ov5647 2-0036: OV5647 power off
[    7.642560] ov5647 2-0036: OV5647 power on
[    7.885917] ov5647 2-0036: OV5647 power off
[    7.888732] ov5647 2-0036: OV5647 power on
[    7.979036] ov5647 2-0036: OV5647 power off
[    7.981660] ov5647 2-0036: OV5647 power on
[    8.104671] ov5647 2-0036: OV5647 power off
[    8.111931] ov5647 2-0036: OV5647 power on
[    8.192464] ov5647 2-0036: OV5647 power off
[    8.197328] ov5647 2-0036: OV5647 power on
[    8.265444] ov5647 2-0036: OV5647 power off
[    8.269012] ov5647 2-0036: OV5647 power on
[    8.339139] ov5647 2-0036: OV5647 power off

If you couldn't get result, please check whether MIPI camera can be detected. you should install the i2c-utils package before use a i2cdetect command.

target
sudo i2cdetect -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- UU -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
target
$ sudo i2cdetect -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 04 05 06 07 08 09 0a 0b -- 0d 0e 0f
10: 10 11 12 13 14 15 16 -- 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 -- 23 24 25 26 27 28 29 2a 2b -- 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 -- 43 44 45 46 47 48 49 4a 4b 4c -- -- 4f
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 -- -- 64 65 66 67 68 69 6a 6b -- 6d 6e 6f
70: 70 71 72 73 74 75 76 --

Hardware Works before do it.
You should add a ov5647_irfilter overlay value to the overlay option on the config.ini file.

target
$ adb shell
# busybox vi /fat/config.ini
target
...
overlays="i2c0 uart0 spi0 ov5647 ov5647_irfilter"
...

There are two way to manually control the IR-Cut Filter.

First manually control via sysfs node. It is work on the android and the ubuntu OS.

target
$ cd /sys/kernel/debug/regulator/ov5647_irfilter
$ echo 1 > ./enable
or
$ echo 0 > ./enable

and on the android, you can control it from ODROID Settings.
When you apply ov5647_irfilter overlay, you can see the camera option from the ODROID Settings. Device Preferences → Camera → Ir Filter

  • odroid-m1/application_note/mipi_csi.txt
  • Last modified: 2022/11/02 17:23
  • by codewalker