V853怎么配置单目摄像头?
-
V853做的板子,buildroot系统,要适配一个gc2503 4land的单目摄像头,,看了文档都是双目的,弄了好久没有弄出图像来,不知道怎么搞了,求指导。以下是做过的操作:
1、DTS的vind节点如下:vind0:vind@0 { vind0_clk = <200000000>; status = "okay"; csi2:csi@2 { pinctrl-names = "default","sleep"; pinctrl-0 = <&ncsi_pins_a>; pinctrl-1 = <&ncsi_pins_b>; status = "disabled"; }; /*offline mode*/ tdm0:tdm@0 { work_mode = <1>; }; isp00:isp@0 { work_mode = <1>; }; scaler00:scaler@0 { work_mode = <1>; }; scaler10:scaler@4 { work_mode = <1>; }; scaler20:scaler@8 { work_mode = <1>; }; scaler30:scaler@12 { work_mode = <1>; }; actuator0:actuator@0 { device_type = "actuator0"; actuator0_name = "ad5820_act"; actuator0_slave = <0x18>; actuator0_af_pwdn = <>; actuator0_afvdd = "afvcc-csi"; actuator0_afvdd_vol = <2800000>; status = "disabled"; }; flash0:flash@0 { device_type = "flash0"; flash0_type = <2>; flash0_en = <>; flash0_mode = <>; flash0_flvdd = ""; flash0_flvdd_vol = <>; status = "disabled"; }; sensor0:sensor@0 { device_type = "sensor0"; sensor0_mname = "gc2053_mipi"; sensor0_twi_cci_id = <1>; sensor0_twi_addr = <0x6e>; sensor0_mclk_id = <0>; sensor0_pos = "rear"; sensor0_isp_used = <1>; sensor0_fmt = <1>; sensor0_stby_mode = <0>; sensor0_vflip = <0>; sensor0_hflip = <0>; sensor0_iovdd-supply = <®_bldo1>; sensor0_iovdd_vol = <1800000>; sensor0_avdd-supply = <®_bldo2>; sensor0_avdd_vol = <2800000>; sensor0_dvdd-supply = <®_dldo2>; sensor0_dvdd_vol = <1200000>; sensor0_power_en = <>; sensor0_reset = <&pio PA 18 1 0 1 0>; sensor0_pwdn = <&pio PA 19 1 0 1 0>; sensor0_sm_hs = <>; sensor0_sm_vs = <>; flash_handle = <&flash0>; act_handle = <&actuator0>; status = "okay"; } /* sensor1:sensor@1 { * device_type = "sensor1"; * sensor1_mname = "gc2053_mipi_2"; * sensor1_twi_cci_id = <0>; * sensor1_twi_addr = <0x7f>; * sensor1_mclk_id = <1>; * sensor1_pos = "front"; * sensor1_isp_used = <1>; * sensor1_fmt = <1>; * sensor1_stby_mode = <0>; * sensor1_vflip = <0>; * sensor1_hflip = <0>; * sensor1_iovdd-supply = <®_aldo2>; * sensor1_iovdd_vol = <1800000>; * sensor1_avdd-supply = <®_bldo2>; * sensor1_avdd_vol = <2800000>; * sensor1_dvdd-supply = <®_dldo2>; * sensor1_dvdd_vol = <1200000>; * sensor1_power_en = <>; * sensor1_reset = <&pio PA 20 1 0 1 0>; * sensor1_pwdn = <&pio PA 21 1 0 1 0>; * sensor1_sm_hs = <>; * sensor1_sm_vs = <>; * flash_handle = <>; * act_handle = <>; * status = "okay"; * }; */ vinc00:vinc@0 { vinc0_csi_sel = <0>; vinc0_mipi_sel = <0>; vinc0_isp_sel = <0>; vinc0_isp_tx_ch = <0>; vinc0_tdm_rx_sel = <0>; vinc0_rear_sensor_sel = <0>; vinc0_front_sensor_sel = <0>; vinc0_sensor_list = <0>; work_mode = <0x1>; status = "okay"; }; /* vinc01:vinc@1 { vinc1_csi_sel = <1>; vinc1_mipi_sel = <1>; vinc1_isp_sel = <1>; vinc1_isp_tx_ch = <0>; vinc1_tdm_rx_sel = <1>; vinc1_rear_sensor_sel = <1>; vinc1_front_sensor_sel = <1>; vinc1_sensor_list = <0>; status = "disabled"; }; vinc02:vinc@2 { vinc2_csi_sel = <2>; vinc2_mipi_sel = <0xff>; vinc2_isp_sel = <2>; vinc2_isp_tx_ch = <2>; vinc2_tdm_rx_sel = <2>; vinc2_rear_sensor_sel = <0>; vinc2_front_sensor_sel = <0>; vinc2_sensor_list = <0>; status = "disabled"; }; vinc03:vinc@3 { vinc3_csi_sel = <0>; vinc3_mipi_sel = <0xff>; vinc3_isp_sel = <0>; vinc3_isp_tx_ch = <0>; vinc3_tdm_rx_sel = <0>; vinc3_rear_sensor_sel = <1>; vinc3_front_sensor_sel = <1>; vinc3_sensor_list = <0>; status = "disabled"; }; vinc10:vinc@4 { vinc4_csi_sel = <0>; vinc4_mipi_sel = <0>; vinc4_isp_sel = <0>; vinc4_isp_tx_ch = <0>; vinc4_tdm_rx_sel = <0>; vinc4_rear_sensor_sel = <0>; vinc4_front_sensor_sel = <0>; vinc4_sensor_list = <0>; work_mode = <0x1>; status = "okay"; }; vinc11:vinc@5 { vinc5_csi_sel = <1>; vinc5_mipi_sel = <1>; vinc5_isp_sel = <1>; vinc5_isp_tx_ch = <0>; vinc5_tdm_rx_sel = <1>; vinc5_rear_sensor_sel = <1>; vinc5_front_sensor_sel = <1>; vinc5_sensor_list = <0>; status = "disabled"; }; vinc12:vinc@6 { vinc6_csi_sel = <2>; vinc6_mipi_sel = <0xff>; vinc6_isp_sel = <0>; vinc6_isp_tx_ch = <0>; vinc6_tdm_rx_sel = <0>; vinc6_rear_sensor_sel = <0>; vinc6_front_sensor_sel = <0>; vinc6_sensor_list = <0>; status = "disabled"; }; vinc13:vinc@7 { vinc7_csi_sel = <2>; vinc7_mipi_sel = <0xff>; vinc7_isp_sel = <0>; vinc7_isp_tx_ch = <0>; vinc7_tdm_rx_sel = <0>; vinc7_rear_sensor_sel = <0>; vinc7_front_sensor_sel = <0>; vinc7_sensor_list = <0>; status = "disabled"; }; vinc20:vinc@8 { vinc8_csi_sel = <0>; vinc8_mipi_sel = <0>; vinc8_isp_sel = <0>; vinc8_isp_tx_ch = <0>; vinc8_tdm_rx_sel = <0>; vinc8_rear_sensor_sel = <0>; vinc8_front_sensor_sel = <0>; vinc8_sensor_list = <0>; work_mode = <1>; status = "okay"; }; vinc21:vinc@9 { vinc9_csi_sel = <2>; vinc9_mipi_sel = <0xff>; vinc9_isp_sel = <0>; vinc9_isp_tx_ch = <0>; vinc9_tdm_rx_sel = <0>; vinc9_rear_sensor_sel = <0>; vinc9_front_sensor_sel = <0>; vinc9_sensor_list = <0>; status = "disabled"; }; vinc22:vinc@10 { vinc10_csi_sel = <2>; vinc10_mipi_sel = <0xff>; vinc10_isp_sel = <0>; vinc10_isp_tx_ch = <0>; vinc10_tdm_rx_sel = <0>; vinc10_rear_sensor_sel = <0>; vinc10_front_sensor_sel = <0>; vinc10_sensor_list = <0>; status = "disabled"; }; vinc23:vinc@11 { vinc11_csi_sel = <2>; vinc11_mipi_sel = <0xff>; vinc11_isp_sel = <0>; vinc11_isp_tx_ch = <0>; vinc11_tdm_rx_sel = <0>; vinc11_rear_sensor_sel = <0>; vinc11_front_sensor_sel = <0>; vinc11_sensor_list = <0>; status = "disabled"; }; vinc30:vinc@12 { vinc12_csi_sel = <0>; vinc12_mipi_sel = <0x0>; vinc12_isp_sel = <0>; vinc12_isp_tx_ch = <0>; vinc12_tdm_rx_sel = <0>; vinc12_rear_sensor_sel = <0>; vinc12_front_sensor_sel = <0>; vinc12_sensor_list = <0>; work_mode = <0x1>; status = "okay"; }; vinc31:vinc@13 { vinc13_csi_sel = <2>; vinc13_mipi_sel = <0xff>; vinc13_isp_sel = <0>; vinc13_isp_tx_ch = <0>; vinc13_tdm_rx_sel = <0>; vinc13_rear_sensor_sel = <0>; vinc13_front_sensor_sel = <0>; vinc13_sensor_list = <0>; status = "disabled"; }; vinc32:vinc@14 { vinc14_csi_sel = <2>; vinc14_mipi_sel = <0xff>; vinc14_isp_sel = <0>; vinc14_isp_tx_ch = <0>; vinc14_tdm_rx_sel = <0>; vinc14_rear_sensor_sel = <0>; vinc14_front_sensor_sel = <0>; vinc14_sensor_list = <0>; status = "disabled"; }; vinc33:vinc@15 { vinc15_csi_sel = <2>; vinc15_mipi_sel = <0xff>; vinc15_isp_sel = <0>; vinc15_isp_tx_ch = <0>; vinc15_tdm_rx_sel = <0>; vinc15_rear_sensor_sel = <0>; vinc15_front_sensor_sel = <0>; vinc15_sensor_list = <0>; status = "disabled"; };*/ };
2、将模块放到板上insmod。可以出来/dev/video0节点
Octops:/server/camera# ls csi_test_mplane v4l2_demo videobuf2-v4l2.ko da380.ko videobuf2-core.ko vin_io.ko gc2053_mipi.ko videobuf2-dma-contig.ko vin_v4l2.ko ism.sh videobuf2-memops.ko Octops:/server/camera# Octops:/server/camera# cat ism.sh insmod videobuf2-core.ko insmod videobuf2-memops.ko insmod videobuf2-dma-contig.ko insmod videobuf2-v4l2.ko insmod vin_io.ko insmod gc2053_mipi.ko insmod vin_v4l2.ko Octops:/server/camera# ./ism.sh [ 90.451429] [VIN_WARN]sensor_helper_probe: cannot get sensor0_cameravdd supply, setting it to NULL! Octops:/server/camera# Octops:/server/camera# ls -l /dev/video0 crw-rw---- 1 root video 81, 0 Jan 1 01:51 /dev/video0 Octops:/server/camera#
3、执行csi_test_mplane如下:
Octops:/server/camera# ./csi_test_mplane open /dev/video0 fd = 3 resolution got from sensor = 640*480 num_planes = 3 VIDIOC_STREAMON ok file length = 307200 76800 76800 file start = 0xb6eee000 0xb6edb000 0xb6ec8000 Got signal 11, exiting ... [ 36.265546] [VIN_ERR]scaler0 channel ID nember is lost!!! Octops:/server/camera# Octops:/server/camera# Octops:/server/camera# ./csi_test_mplane 0 0 1920 1080 /server 1 20000 60 0 open /dev/video0 fd = 3 resolution got from sensor = 1920*1080 num_planes = 3 VIDIOC_STREAMON ok Octops:/server/camera# Octops:/server/camera# ./csi_test_mplane 0 please select the video device: 0-video0 1-video1 ...... 0 please select the camera: 0-dev0 1-dev1 ...... 0 please input the resolution: width height...... 1920 1080 please input the frame saving path...... /server please input the test mode: 0~3...... 1 please input the test_cnt: >=1...... 20 open /dev/video0 fd = 3 resolution got from sensor = 1920*1080 num_planes = 3 VIDIOC_STREAMON ok [ 107.543269] [VIN_ERR]scaler0 channel ID nember is lost!!! VIDIOC_STREAMOFF ok mode 1 test done at the 0 time!! time cost 1.221462(s)
4、i2cdetect测试,发现器件地址对不上
Octops:/server/camera# i2cdetect -y 1 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: -- -- -- -- -- -- -- --
问题:
1、想确认下,4land的摄像头,需要专门指定4land吗?怎么指定?
2、出现了video设备是可以说明硬件通了,只需要做软件的调试吗?
3、为什么器件地址会变为原来的一半?
4、有什么办法可以实时预览摄像头吗? -
此回复已被删除!
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号