![VC MIPI OV9281 Скачать руководство пользователя страница 12](http://html.mh-extra.com/html/vc/mipi-ov9281/mipi-ov9281_how-to-set-up_857542012.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
12/13
Raspbian I²C connection: Influence of the parameter dtparam=i2c_vc=on
The I²C bus is assigned by the RTOS. So the file '/boot/config.txt' needs an additional entry:
dtparam=i2c_vc=on
It changes the physical I²C bus VC accessor from the default, the GPU, to the CPU.
Note
Some hardware like the touch display demands exclusiveness over the I²C Bus VC or their drivers assume the I²C Bus VC is connected to the RTOS. Since the
sensor driver must communicate with the sensor module connected to the MIPI socket, neither the exclusiveness nor the RTOS connectedness is given. So the I²C
bus VC cannot be used for other purposes when the sensor is attached.
Example
After reboot the dtparam line can be shown by executing the following command:
sudo vcdbg log msg 2>&1 | grep '^[0-9\.]\+: dtparam:'
Here is a sample output:
002077.358: dtparam: audio=on
002096.467: dtparam: i2c_vc=on
4.2.3 Providing the sensor driver as kernel module
Here are the steps to compile the kernel modules by yourself:
1. Change to the subdirectory named
vc_mipi_driver_raspberryPi3_ov9281/
2. The source directory contains a Makefile to compile the driver. Do so by calling:
make clean all
The directory then contains the driver as two modules. They must be copied to their places
vc_mipi_ov9281.ko to /lib/modules/$(uname -r)/kernel/drivers/media/i2c/
bcm2835-unicam.ko to /lib/modules/$(uname -r)/kernel/drivers/media/platform/
Afterwards the new modules must be registered by calling depmod -a.
The module drivers will then be loaded by calling the following commands in that order:
modprobe vc_mipi_ov9281
modprobe bcm2835-unicam
Example
After reboot you can display the output of the vc_mipi_ov9281 kernel module by executing the following command:
dmesg | grep '^[^]]*\] vc_mipi_ov9281:'
Here is a sample output which will be different at your setup:
[ 4.107734] vc_mipi_ov9281: loading out-of-tree module taints kernel.
[ 4.231604] vc_mipi_ov9281 0-0060: VC Sensor MODE=0 PowerOn STATUS=0x80 i=1
[ 4.231719] vc_mipi_ov9281 0-0060: GAIN = 12
[ 4.239752] vc_mipi_ov9281 0-0060: EXPOSURE = 12345
[ 4.252885] vc_mipi_ov9281 0-0060: Model ID 0x1234, Lot ID 0x123456, Chip ID 0x1234
4.2.4 Reserving Contiguous Memory for the Image Captures
In contrast to the normally used non-contiguous memory the capture hardware needs a contiguous memory region to transfer pixel data to by using direct memory access
(DMA).