VC MIPI OV9281 Скачать руководство пользователя страница 12

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).

Содержание MIPI OV9281

Страница 1: ...ing sign alerts of possible pitfalls to avoid Please pay careful attention to sections marked with this sign This is a sign for an example Trademarks Linux Debian the Tux logo Vivado Xilinx and Zynq ARM Cortex Windows XP Total Commander Tera Term Motorola HALCON Vision Components are registered Trademarks All trademarks are the property of their respective owners Raspberry Pi and Raspbian are also...

Страница 2: ...e Setup 3 1 Install necessary Raspbian packages 3 2 Get the driver and demo code 3 3 Driver Installation 3 4 First Image Acquisition Test 3 5 Running the Demo 3 5 1 Compile the programs 3 5 2 Execute the demo 3 6 Switching Sensor Configuration 4 Troubleshooting and Background Information 4 1 Q A 4 2 Driver Knowledge 4 2 1 Providing the device tree overlay 4 2 2 Set up the I C bus for driver sensor...

Страница 3: ...A at 5V 2 Hardware Setup 2 1 Hardware Pre Check Install Raspbian First step is to install Raspbian from https www raspberrypi org downloads raspbian The driver is known to work with the kernel version 4 14 so download the appropriate Raspbian version Raspbian Stretch Lite is sufficient and this guide expects this version to be installed not only for the framebuffer output handling For more install...

Страница 4: ... site looks different Install Raspbian by following the instructions provided there The display shows a login prompt after successful installation If this is not the case you have to check your Raspbian installation The most relevant information to succeed can be found at the Raspbian website or at the web Raspbian showing login screen user is usually pi with password raspberry 2 2 Connect the MIP...

Страница 5: ...d insert the cable and press their lid back when mounted correctly You should then not be able to pull the cable out Open the MIPI module socket put in the cable close the MIPI module socket Warning The connection at this type of socket is not protected against bad alignment so always check the orthogonality and if it is bent correct it Also watch out for the right orientation of the cable The MIP...

Страница 6: ...able to the CAMERA socket at the raspberry Pi equally left bad right good Warning Do not connect other devices to the I C bus named VC since it can affect the communication between the camera sensor and the driver For example running the touch screen of the Raspberry PI 7 inch display will lead to communication problems between driver and camera sensor The display may work with the following line ...

Страница 7: ...itching the system on Raspbian showing login screen user is usually pi with password raspberry 3 Software Setup 3 1 Install necessary Raspbian packages Before beginning with the installation do the following steps first This requires your Raspberry PI to already have an internet connection otherwise you have to install the packages mentioned manually search the web for the procedure needed 1 Updat...

Страница 8: ...ed archive named vc_mipi_driver_raspberryPi3_ov9281 2 The directory with the sources contains a Makefile to compile the driver Do so by calling make clean all 3 Calling make the following way will install the kernel module in your current kernel module path make install 4 Follow the instructions displayed by the make command this may be similar to the following lines ADD dtparam i2c_vc on and dtov...

Страница 9: ...r parameters To list available parameters of the sensor driver kernel module use the following command modinfo vc_mipi_ov9281 The current parameter values of the loaded sensor driver module can be readout as content of a file named after the parameter name at the following directory sys module vc_mipi_ov9281 parameters To change the sensor behaviour on the fly the drivers needs to be reloaded Firs...

Страница 10: ...nnected to the I C bus 0 For example the touch screen controller of the Raspberry PI display may not be connected Check the orientation of the cable at the sensor side as well as at the cpu side Also check if the cable and the sockets are orthogonal 4 2 Driver Knowledge The following tasks have to be done to do an image acquisition with the camera sensor Information about the new sensor hardware a...

Страница 11: ...eal 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...

Страница 12: ...les 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...

Страница 13: ...rent line cma 128M After reboot the kernel message line beginning with Memory will show an additional entry 131072K cma reserved Example After reboot you can show the line by executing the following command dmesg grep Memory Here is a sample output which will look slightly different at your setup 0 000000 Memory 817108K 970752K available 7168K kernel code 576K rwdata 2076K rodata 1024K init 698K b...

Отзывы: