I2c bus number and video node

From wiki_veye
Jump to navigation Jump to search

查看中文

1 I2c bus number on different boards

For camera modules with MIPI CSI-2 interface, the i2c bus is commonly provided as the communication channel for parameter configuration. Users use the i2c protocol to access the camera registers. A series of shell scripts are provided to facilitate this operation, such as VEYE-MIPI-X I2C.sh,CS-MIPI-X I2C.sh,VEYE-MIPI-IMX335 i2c script.

Generally, there is a matching i2c bus for each MIPI CSI-2 interface on each motherboard. For all our scripts, we can use the -b [bus numer] option to indicate which i2c bus is targeted for this operation. Below, we have summarized the i2c bus serial numbers for commonly used motherboards.

1.1 Raspberry pi

1.1.1 General

For a Raspberry Pi with only one mipi csi-2 interface, the i2c bus is 10. If your piOS is very old, then maybe it is 0.

Special, for the Computer module series. Make the following description.

1.1.2 CM3

CM3 use I2C-1 to control 2 cameras,It is time-sharing multiplexing.

./camera_i2c_config [cameranum]

cameranum description
0 CAM0
1 CAM1

1.1.3 CM4

The CM4 module uses two I2C to communicate with two cameras respectively.

./camera_i2c_config

i2c bus num description
0 CAM0
10 CAM1

1.2 Nvidia Jetson

The following description is only for official Nvidia development boards, third party board need to be confirmed with the manufacturer.

1.2.1 AGX-Xavier, TX2 Devkit

ADP-N1-V2.0 has 6 MIPI CSI-2 interfaces, corresponding to the i2c bus numbers 30-35.

cam index i2c number
0 30
1 31
2 32
3 33
4 34
5 35

1.2.2 Xavier NX , TX2 NX

cam index i2c number
0 10
1 9

1.2.3 Nano A02, Nano 2GB

cam index i2c number
0 7
1 8

1.2.4 Nano A02, Nano 2GB

i2c bus number is 6.

1.3 NXP i.MX platform

1.3.1 AVNET Maaxboard(mini)

i2c bus number is 0.

1.3.2 MYIR i.MX8 board

cam index i2c number
0 0
1 1

1.3.3 google Coral board

i2c bus number is 1.

1.4 Tools

The following two tools can assist in understanding and finding problems.

1.4.1 i2cdetect

Under linux command, execute the following command to probe all the i2c device addresses on the i2c bus. Usually our module address is 0x3b.

i2cdetect -y -r [busnumber]

1.4.2 dmesg

dmesg prints out the logs of the linux kernel boot phase and also the driver logs of our camera modules. It shows the i2c probe process during the boot phase and whether it was successful or not.

2 Description of video nodes

In general, we have implemented v4l2 standard drivers for mipi modules on different platforms. The Linux kernel will find the corresponding driver and probe the camera according to the dts when booting. After success, the /dev/videoX device node is generated, where X is a number based on the order of the probe to.

This tends to cause a common misunderstanding, which is explained here.

For motherboards that support multiple mipi cameras, the i2c bus number of each camera is determined by the camera installation location, but the generated /dev/videoX node name cannot be determined in advance.

For example, if we install two cameras on the agx board, mounted to cam2 and cam4 positions, then:

xavier agx
camera number location i2c bus /dev/video node
1 cam2 32 /dev/video0
2 cam4 34 /dev/video1