![VC MIPI OV9281 How To Set Up Download Page 11](http://html.mh-extra.com/html/vc/mipi-ov9281/mipi-ov9281_how-to-set-up_857542011.webp)
1/17/2020
How to setup a VC MIPI OV9281 on a Raspberry PI Model 3B+
https://www.vision-components.com/fileadmin/external/documentation/hardware/VC_MIPI_OV9281_Raspberry_PI_Model_3BPlus/index.html
11/13
The so-called kernel device tree overlay contains information about the socket and periphery where the mipi module is connected to. For the RaspberryPi 3B+ there is only
one socket available, so there is no need to change the CSI port information at this device tree overlay.
Here are the steps to compile the device tree overlay by yourself:
At the driver source directory the device tree overlay source file can be found. It is named
vc_mipi_ov9281-overlay.dts
1. Install the device-tree-compiler package via:
sudo apt-get install device-tree-compiler
2. Compile the dtbo kernel device tree overlay binary representation by using the following command:
dtc -@ -I dts -O dtb -o vc_mipi_ov9281.dtbo vc_mipi_ov9281-overlay.dts
3. Copy the binary to
/boot/overlays/vc_mipi_ov9281.dtbo
4.2.1.1 Telling the RTOS to use the device tree overlay
Raspbian Boot overview
Before starting the linux kernel, the Raspberry Pi first boots a real-time operating system (RTOS) on the GPU. This RTOS looks into the file /boot/config.txt. It loads a default
Kernel device tree and patches it by overlaying the device tree parts listed by the dtoverlay entries at the file /boot/config.txt. To add information about the new sensor this
config-file needs the following entry:
dtoverlay=vc_mipi_ov9281
The device tree will then be modified by the overlay at
/boot/overlays/vc_mipi_ov9281.dtbo
before the linux kernel is run. With this customized kernel device tree the linux kernel will be started and - as a result - provides the node /dev/video0 using the capture driver
module at
/lib/modules/$(uname -r)/kernel/drivers/media/i2c/vc_mipi_ov9281.ko
To check the behaviour of the RTOS one can look at the output by the following command:
sudo vcdbg log msg
Example
After reboot the applied overlays can be shown by executing the following command:
sudo vcdbg log msg 2>&1 | grep '^[0-9\.]\+: Loaded overlay'
Here is a sample output:
002143.555: Loaded overlay 'ov9281'
A deeper insight into the device tree overlays and parameters can be found at
https://www.raspberrypi.org/documentation/configuration/device-tree.md
4.2.2 Set up the I²C bus for driver-sensor communication
The sensor driver needs to communicate via the I²C Bus named VC. To be able to access it, assigning it to the CPU is mandatory.