camera调试时,使用 CCI 时出现 I2C 错误,该如何解决?

社区云(官方) 2023-02-01 09:43:22

camera调试时,使用 CCI 时出现 I2C 错误,该如何解决?

...全文
788 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38498942 2023-02-02
  • 打赏
  • 举报
回复

该错误大概率是由 I2C 连接引起的。可能是硬件引脚布局存在问题,或者 I2C 数据或时钟的 GPIO 未正确配置。
调试

  1. 检查并验证 I2C 数据和时钟配置。
  2. 确保硬件引脚连接正确。
  3. 提取 CCI 日志来获取更多配置信息。
UNICODE 全志R16平台TINAV2.1下的CSI接口摄像头ov5640的配置v1.2.txt R16_Camera模块开发说明文档_V1.8.pdf 所有步骤请按照这个说明书执行 1、驱动的编译配置: R:\wyb\gc2145_tinav2.1\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\gc2145.c R:\wyb\gc2145_tinav2.1\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\Makefile (可选操作,除了gc2145之外,其它的摄像头驱动都关闭,肯定可以减小最终生成的IMG的大小!) obj-m += ov5640.o obj-m += ov2640.o #obj-m += ov7736.o #obj-m += s5k4ec.o #obj-m += s5k4ec_mipi.o #obj-m += gc2035.o #obj-m += gt2005.o #obj-m += gc0307.o obj-m += gc0308.o #obj-m += gc0328.o #obj-m += gc0328c.o #obj-m += gc0329.o #obj-m += gc0311.o #obj-m += hi253.o #obj-m += sp2518.o #obj-m += sp2519.o #obj-m += sp0718.o #obj-m += sp0838.o #obj-m += ov16825.o #obj-m += ov5650.o #obj-m += ov5647.o #obj-m += ov5647_mipi.o #obj-m += t8et5.o #obj-m += s5k4e1.o #obj-m += s5k4e1_mipi.o #obj-m += sp2518.o #obj-m += sp0718.o #obj-m += gc5004.o #obj-m += gc5004_mipi.o #obj-m += ov5648.o #obj-m += ar0330.o #obj-m += ov5648.o #obj-m += sp5408.o #obj-m += ov12830.o #obj-m += ov8825.o #obj-m += ov8850.o #obj-m += gc2155.o obj-m += gc2145.o obj-m += gc2145d.o #obj-m += ov8858.o #obj-m += ov13850.o #obj-m += imx214.o #obj-m += ov8858_4lane.o #obj-m += sp5409.o #obj-m += s5k5e2yx.o #obj-m += ov2710_mipi.o #obj-m += siv121d.o #obj-m += ov2710_mipi.o #obj-m += bg0703.o #obj-m += gc1014_mipi.o #obj-m += imx219.o #obj-m += imx224.o #obj-m += imx322.o #obj-m += ov8858_r2a_4lane.o #obj-m += ov8865_4lane.o #obj-m += ps1210.o #obj-m += imx291.o 2、R:\wyb\gc2145_tinav2.1\lichee\linux-3.4\drivers\media\video\sunxi-vfe\vfe.c 这里修正之后就一切正常了。不然摄像头在系统启动之后就永远休眠了。 static void probe_work_handle(struct work_struct *work) { …… #ifdef CONFIG_ES dev->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB + 1; dev->early_suspend.suspend = vfe_early_suspend; dev->early_suspend.resume = vfe_late_resume; // [hawkview_err]xxxxcan't open /dev/video0(Resource temporarily unavailable) // 2016/10/25 14:33 wenyuanbo cloase suspend. // register_early_suspend(&dev->early_suspend); vfe_print("register_early_suspend @ probe handle!\n"); #endif …… } 3、请严重注意:全志原生提供的cameratest有点错误(和tinav1.0对比得知:保存获取图片的文件名有小错误) R:\wyb\gc2145_tinav2.1\package\allwinner\cameratest\src\common\hawkview.c int fetch_sub_cmd(const char* buf,int buf_len,char** cmd,int* cmd_num,int lenght) { int i = 0,j = 0,n = 0; while(buf[i] != '#'){ //the sub cmd end by '#' while(buf[i] != 'x' && buf[i] != ':' && buf[i] != '#') { if((i+1) > buf_len) return 0; *((char*)cmd + n*lenght + j++) = buf[i++]; …… } R:\wyb\gc2145_tinav2.1\package\allwinner\cameratest\src\common\video.c static int capture_frame(void* capture,int (*set_disp_addr)(int,int,unsigned int*),pthread_mutex_t* mutex) { …… //sync capture info perp x second #define M_SECOND 200 if(is_x_msec(M_SECOND,(long long)(buf.timestamp.tv_sec),(long long)(buf.timestamp.tv_usec))){ getExifInfo(&(cap->frame.exif)); (建议关闭这里) // set_cap_info((void*)cap); } …… } R:\wyb\gc2145_tinav2.1\package\allwinner\cameratest\src\common\video_helper.c int set_cap_info(void* capture) { …… (修改这里) //strcpy(file_path, "dev/info"); sprintf(file_path, "%s/%s.info", PATH, cap->picture.path_name); …… } int do_save_sub_image(void* capture,int buf_index) { …… (增加这里) set_cap_info(capture); set_exif_info(capture); hv_dbg("--------set_exif_info end\n"); …… } 4、配置为在系统启动的候加载gc2145.ko(SDK默认加载的是gc0308.ko) R:\wyb\gc2145_tinav2.1\target\allwinner\astar-common\modules.mk define KernelPackage/sunxi-vfe SUBMENU:=$(VIDEO_MENU) TITLE:=sunxi-vfe support FILES:=$(LINUX_DIR)/drivers/media/video/videobuf-core.ko FILES+=$(LINUX_DIR)/drivers/media/video/videobuf-dma-contig.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/csi_cci/cci.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_os.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_subdev.ko (修改这里) FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/device/gc2145.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_v4l2.ko (修改这里) AUTOLOAD:=$(call AutoLoad,90,videobuf-core videobuf-dma-contig cci vfe_os vfe_subdev gc2145 vfe_v4l2) endef 5、直接使用了tinav1.0上调通ov5640后的sys_config.fex (请注意:这里修改的电源部分,其他没有用到的设备都请关闭掉。请参照您的原理图修改摄像头的供电部分!!!!) R:\wyb\gc2145_tinav2.1\target\allwinner\astar-parrot\configs\sys_config.fex [power_sply] dcdc1_vol = 3000 dcdc2_vol = 1100 dcdc3_vol = 1200 dcdc4_vol = 0 dcdc5_vol = 1500 aldo2_vol = 2500 aldo3_vol = 3000 (这里是增加的电源部分:) dldo3_vol = 2800 ;gpio0_vol = 2800 ldoio0_vol = 2800 [csi0] vip_used = 1 vip_mode = 0 vip_dev_qty = 1 vip_define_sensor_list = 0 vip_csi_pck = port:PE00 vip_csi_mck = port:PE01 vip_csi_hsync = port:PE02 vip_csi_vsync = port:PE03 vip_csi_d0 = port:PE04 vip_csi_d1 = port:PE05 vip_csi_d2 = port:PE06 vip_csi_d3 = port:PE07 vip_csi_d4 = port:PE08 vip_csi_d5 = port:PE09 vip_csi_d6 = port:PE10 vip_csi_d7 = port:PE11 ;vip_csi_sck = port:PE12 ;vip_csi_sda = port:PE13 ;vip_dev0_mname = "gc0308" ;vip_dev0_mname = "ov5640" vip_dev0_mname = "gc2145" vip_dev0_pos = "rear" vip_dev0_lane = 1 vip_dev0_twi_id = 2 ;vip_dev0_twi_addr = 0x42 vip_dev0_twi_addr = 0x78 vip_dev0_isp_used = 0 vip_dev0_fmt = 0 (2017/4/6 11:41 wenyuanbo 调试候这里设置为0方便测量摄像头的供电部分^_) ;vip_dev0_stby_mode = 1 vip_dev0_stby_mode = 0 vip_dev0_vflip = 0 vip_dev0_hflip = 0 vip_dev0_iovdd = "axp22_dldo3" vip_dev0_iovdd_vol = 2800000 vip_dev0_avdd = "" vip_dev0_avdd_vol = 2800000 vip_dev0_dvdd = "" vip_dev0_dvdd_vol = 1800000 vip_dev0_afvdd = "" vip_dev0_afvdd_vol = 2800000 vip_dev0_power_en = vip_dev0_reset = port:PE14 vip_dev0_pwdn = port:PE15 vip_dev0_flash_en = vip_dev0_flash_mode = vip_dev0_af_pwdn = (这个可以不改。不需要支持OTG功能。) ;usb_port_type: usb mode: 0-device, 1-host, 2-otg …… [usbc0] usb_used = 1 ;usb_port_type = 2 usb_port_type = 0 (!!!!解决重启的问题) [pmu1_para] …… ;power_start = 0 power_start = 3 pmu_temp_enable = 0 6、第一次编译之后,再次配置: 10、在menuconfig中打开sunxi-vfe support rootroot@rootroot-E400:~/wyb/gc2145_tinav2.1$ pwd /home/rootroot/wyb/gc2145_tinav2.1 rootroot@rootroot-E400:~/wyb/gc2145_tinav2.1$ source build/envsetup.sh including target/allwinner/tulip-d1/vendorsetup.sh including target/allwinner/octopus-dev/vendorsetup.sh including target/allwinner/azalea-perf3/vendorsetup.sh including target/allwinner/octopus-sch/vendorsetup.sh including target/allwinner/azalea-evb/vendorsetup.sh including target/allwinner/azalea-perf2/vendorsetup.sh including target/allwinner/astar-parrot/vendorsetup.sh including target/allwinner/generic/vendorsetup.sh including target/allwinner/astar-spk/vendorsetup.sh including target/allwinner/azalea-perf1/vendorsetup.sh including target/allwinner/astar-evb/vendorsetup.sh rootroot@rootroot-E400:~/wyb/gc2145_tinav2.1$ lunch You're building on Linux Lunch menu... pick a combo: 1. tulip_d1-tina 2. tulip_d1-dragonboard 3. octopus_dev-tina 4. octopus_dev-dragonboard 5. azalea_perf3-tina 6. azalea_perf3-dragonboard 7. octopus_sch-tina 8. octopus_sch-dragonboard 9. azalea_evb-tina 10. azalea_evb-dragonboard 11. azalea_perf2-tina 12. azalea_perf2-dragonboard 13. astar_parrot-tina 14. astar_parrot-dragonboard 15. astar_spk-tina 16. astar_spk-dragonboard 17. azalea_perf1-tina 18. azalea_perf1-dragonboard 19. astar_evb-tina Which would you like?13 ============================================ PLATFORM_VERSION_CODENAME=Neptune PLATFORM_VERSION=2.0.0 TARGET_PRODUCT=astar_parrot TARGET_BUILD_VARIANT=tina TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a-neon TARGET_CPU_VARIANT=cortex-a7 TARGET_2ND_ARCH= TARGET_2ND_ARCH_VARIANT= TARGET_2ND_CPU_VARIANT= HOST_ARCH=x86_64 HOST_OS=linux HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty HOST_BUILD_TYPE=release BUILD_ID=57513AA3 OUT_DIR= ============================================ rootroot@rootroot-E400:~/wyb/gc2145_tinav2.1$ make -j8 rootroot@rootroot-E400:~/wyb/gc2145_tinav2.1$ make menuconfig Kernel modules ---> Video Support ---> kmod-sunxi-vfe......................................... sunxi-vfe support 7、编译打包刷机之后的串口(debug口的)打印信息:: rootroot@cm-System-Product-Name:/home/rediron/r16/gc2145_tinav2.1$ cp .config bak2_vfe.config rootroot@rootroot-virtual-machine:~/wyb/opencv3.1_r16_tinav2.1$ make -j8 rootroot@rootroot-virtual-machine:~/wyb/opencv3.1_r16_tinav2.1$ pack -d 验证gc2145的驱动是否正常加载: Xshell 5 (Build 0964) Copyright (c) 2002-2016 NetSarang Computer, Inc. All rights reserved. Type `help' to learn how to use Xshell prompt. [c:\~]$ Connecting to COM3... Connected. BusyBox v1.24.1 () built-in shell (ash) _____ _ __ _ |_ _||_| ___ _ _ | | |_| ___ _ _ _ _ | | _ | || | | |__ | || || | ||_'_| | | | || | || _ | |_____||_||_|_||___||_,_| |_| |_||_|_||_|_| Tina is Based on OpenWrt! ---------------------------------------------- Tina Linux (Neptune, 57513AA3) ---------------------------------------------- root@TinaLinux:/# root@TinaLinux:/# cd /dev root@TinaLinux:/dev# ll v* crw-r--r-- 1 root root 7, 0 Jan 2 08:02 vcs crw-r--r-- 1 root root 7, 1 Jan 2 08:02 vcs1 crw-r--r-- 1 root root 7, 128 Jan 2 08:02 vcsa crw-r--r-- 1 root root 7, 129 Jan 2 08:02 vcsa1 crw-r--r-- 1 root root 10, 54 Jan 2 08:02 vhci crw-r--r-- 1 root root 81, 0 Jan 2 08:02 video0 root@TinaLinux:/# lsmod bcmdhd 534841 0 cci 19880 2 gc2145 gc2145 11234 0 snd_mixer_oss 11252 1 snd_pcm_oss snd_pcm_oss 29795 0 snd_seq_device 3927 0 vfe_os 3065 2 vfe_v4l2 vfe_subdev 3941 2 vfe_v4l2 vfe_v4l2 335707 0 videobuf_core 12030 2 vfe_v4l2 videobuf_dma_contig 2553 1 vfe_v4l2 root@TinaLinux:/# root@TinaLinux:/dev# cd /sys/class/i2c-adapter/i2c- i2c-0/ i2c-1/ i2c-2/ root@TinaLinux:/dev# cd /sys/class/i2c-adapter/i2c-2 root@TinaLinux:/sys/devices/platform/twi.2/i2c-2# ll drwxr-xr-x 4 root root 0 Jan 2 08:02 . drwxr-xr-x 4 root root 0 Jan 2 08:02 .. drwxr-xr-x 3 root root 0 Jan 2 08:04 2-003c --w------- 1 root root 4096 Jan 2 08:04 delete_device lrwxrwxrwx 1 root root 0 Jan 2 08:04 device -> ../../twi.2 -r--r--r-- 1 root root 4096 Jan 2 08:04 name --w------- 1 root root 4096 Jan 2 08:04 new_device drwxr-xr-x 2 root root 0 Jan 2 08:04 power lrwxrwxrwx 1 root root 0 Jan 2 08:04 subsystem -> ../../../../bus/i2c -rw-r--r-- 1 root root 4096 Jan 2 08:04 uevent root@TinaLinux:/sys/devices/platform/twi.2/i2c-2# cd 2-003c root@TinaLinux:/sys/devices/platform/twi.2/i2c-2/2-003c# ll drwxr-xr-x 3 root root 0 Jan 2 08:04 . drwxr-xr-x 4 root root 0 Jan 2 08:02 .. lrwxrwxrwx 1 root root 0 Jan 2 08:04 driver -> ../../../../../bus/i2c/drivers/ov5640 -r--r--r-- 1 root root 4096 Jan 2 08:04 modalias -r--r--r-- 1 root root 4096 Jan 2 08:04 name drwxr-xr-x 2 root root 0 Jan 2 08:04 power lrwxrwxrwx 1 root root 0 Jan 2 08:04 subsystem -> ../../../../../bus/i2c -rw-r--r-- 1 root root 4096 Jan 2 08:04 uevent root@TinaLinux:/sys/devices/platform/twi.2/i2c-2/2-003c# cat name gc2145 root@TinaLinux:/sys/devices/platform/twi.2/i2c-2/2-003c# 获取YUV格式的图片: [ 19.184637] dhd_open: Exit ret=0 [ 22.716117] sndpcm_startup,l:1688,pa_vol:40 BusyBox v1.24.1 () built-in shell (ash) _____ _ __ _ |_ _||_| ___ _ _ | | |_| ___ _ _ _ _ | | _ | || | | |__ | || || | ||_'_| | | | || | || _ | |_____||_||_|_||___||_,_| |_| |_||_|_||_|_| Tina is Based on OpenWrt! ---------------------------------------------- Tina Linux (Neptune, 57513AA3) ---------------------------------------------- root@TinaLinux:/# root@TinaLinux:/# root@TinaLinux:/# pwd / root@TinaLinux:/# root@TinaLinux:/# root@TinaLinux:/# root@TinaLinux:/# cameratest [hawkview_dbg]hawkview_init set_w 1280 [hawkview_msg]----sunxi9iw1p1 capture register sucessfully! [hawkview_dbg]hawkview_init 2 [hawkview_dbg]video pthread_create ret:0 [hawkview_dbg]video thread status 0 --> 101 [hawkview_dbg]command pthread_create ret:0 (等待输入需要获取的YUV图片的分辨率:) [hawkview_dbg]read cmd [ 181.303764] [VFE]vfe_open 146:0:1:1600x1200# [hawkview_[ 181.308582] [VFE]..........................vfe clk open!....................... dbg]cmd 0: 146 [hawkview_dbg]cm[ 181.319592] [VFE]vfe_open ok d 1: 0 [hawkview_dbg]cmd 2: 1 [hawkview_dbg]cmd 3: 1600 [hawkview_dbg]cmd 4: 1200 [hawkview_dbg]send command 146 [hawkview_dbg]video thread cmd: 0 --> 146 [hawkview_dbg]reset video capture [hawkview_msg]----open /dev/video0 [hawkview_msg]----get sensor type: 0 [ 182.325602] [VFE_ERR]set input i(1)>dev_qty(1)-1 error! [hawkview_err]xxxxVIDIOC_S_INPUT[ 182.331594] [VFE]Set vfe core clk = 108000000, after Set vfe core clk = 99000000 failed! s_input: 1 [ 182.366903] [VFE]mclk on [ 182.393862] [CSI][GC2145]enable oe! [ 182.398584] [CSI][GC2145]V4L2_IDENT_SENSOR=2145[hawkview_msg]----the tried size [ 182.875861] [VFE]buffer_setup, buffer count=10, size=2884096 is 1600x1200,the supported size is 1600x1200! [hawkview_dbg]map buffer index: 0, mem: b6bc8000, len: 2c0200, offset: 0 [hawkview_dbg]map buffer index: 1, mem: b6907000, len: 2c0200, offset: 2c1000 [hawkview_dbg]map buffer index: 2, mem: b6646000, len: 2c0200, offset: 582000 [hawkview_dbg]map buffer index: 3, mem: b6385000, len: 2c0200, offset: 843000 [hawkview_dbg]map buffer index: 4, mem: b60c4000, len: 2c0200, offset: b04000 [hawkview_dbg]map buffer index: 5, mem: b5e03000, len: 2c0200, offset: dc5000 [hawkview_dbg]map buffer index: 6, mem: b5b42000, len: 2c0200, offset: 1086000 [hawkview_dbg]map buffer index: 7, mem: b5881000, len: 2c0200, offset: 1347000 [hawkview_dbg]map buffer index: 8, mem: b55c0000, len: 2c0200, offset: 1608000 [hawkview_dbg]map buffer index: 9, mem: b52ff000, len: 2c0200, offset: 18c9000 [hawkview_dbg]video thread status 101 --> 102 [hawkview_dbg]capture frame command -1 --> 161 [hawkview_dbg]capture frame status -1 --> 0 [hawkview_dbg]capture start streaming [hawkview_dbg]capture frame command 161 --> 0 [hawkview_dbg]capture frame status 0 --> 1 [ 183.030025] [VFE]capture video mode! [ 183.132659] [VFE]capture video first frame done! (等待输入希望获取的YUV图片的文件名:) [hawkview_dbg]read cmd 149:color1013.yuv# [hawkview_dbg]cmd 0: 149 [hawkview_dbg]cmd 1: color1013.yuv [hawkview_dbg]send command 149 [hawkview_dbg]index: 3 buffers[buf.index].start = 0xb6385000 [hawkview_dbg]image_name: /tmp/color1013.yuv [hawkview_err]xxxxOpen sync file error[hawkview_dbg]image exif info: image_name = color1013.yuv width = 1600 height = 1200 exp_time_num = 0 exp_time_den = 0 sht_speed_num = 0 sht_speed_den = 0 fnumber = 0 exp_bias = 0 foc_length = 0 iso_speed = 0 flash_fire = 0 brightness = 0 # [hawkview_dbg]--------set_exif_info end (全志没有设置结束按键,只有按ctrl+C组合按键结束程序) ^C[ 270.859423] [VFE]vfe_close [ 270.862589] [CSI][GC2145]disalbe oe! [ 270.878791] [VFE]mclk off [ 270.893865] [VFE]..........................vfe clk close!....................... [ 270.902299] [VFE]vfe_close end root@TinaLinux:/# 8、在电脑的命令行中使用adb shell: Microsoft Windows [版本 6.1.7600] 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。 C:\Users\Administrator>adb shell BusyBox v1.24.1 () built-in shell (ash) _____ _ __ _ |_ _||_| ___ _ _ | | |_| ___ _ _ _ _ | | _ | || | | |__ | || || | ||_'_| | | | || | || _ | |_____||_||_|_||___||_,_| |_| |_||_|_||_|_| Tina is Based on OpenWrt! ---------------------------------------------- Tina Linux (Neptune, 57513AA3) ---------------------------------------------- root@TinaLinux:/# cd tmp cd tmp root@TinaLinux:/tmp# ll ll drwxrwxrwt 9 root root 300 Jan 2 20:15 . drwxr-xr-x 1 root root 1024 Jan 2 20:15 .. drwx------ 2 root root 40 Jan 2 20:15 .uci -rw-r--r-- 1 root root 6 Jan 2 20:15 TZ -rw-r--r-- 1 root root 5 Jan 2 20:15 booting_state drwxrwxrwx 2 root root 40 Jan 2 20:15 lock drwxr-xr-x 2 root root 80 Jan 2 20:15 log lrwxrwxrwx 1 root root 21 Jan 2 20:15 resolv.conf -> /tmp/res olv.conf.auto -rw-r--r-- 1 root root 0 Jan 2 20:15 resolv.conf.auto drwxrwxrwx 2 root root 100 Jan 2 20:15 run drwxrwxrwt 2 root root 40 Jan 2 20:15 shm drwxrwxrwx 2 root root 60 Jan 2 20:15 state drwxr-xr-x 2 root root 40 Jan 2 20:15 tmp srwxr-xr-x 1 root root 0 Jan 2 20:15 wpa_ctrl_254-32 srwxr-xr-x 1 root root 0 Jan 2 20:15 wpa_ctrl_254-33 root@TinaLinux:/tmp# root@TinaLinux:/tmp# (1600x1200为您所希望获取的图片的分辨率,请根据您的需要来设置) root@TinaLinux:/tmp# echo "146:0:1:1600x1200#" > command echo "146:0:1:1600x1200#" > command (color1013.yuv为您希望保存yuv图像的文件名) root@TinaLinux:/tmp# echo "149:color1013.yuv#" > command echo "149:color1013.yuv#" > command root@TinaLinux:/tmp# ll ll drwxrwxrwt 9 root root 360 Jan 2 20:19 . drwxr-xr-x 1 root root 1024 Jan 2 20:15 .. drwx------ 2 root root 40 Jan 2 20:15 .uci -rw-r--r-- 1 root root 6 Jan 2 20:15 TZ -rw-r--r-- 1 root root 5 Jan 2 20:15 booting_state -rw-r--r-- 1 root root 1000 Jan 2 20:19 color1013.yuv.exif -rw-rw-rw- 1 root root 19 Jan 2 20:19 command drwxrwxrwx 2 root root 40 Jan 2 20:15 lock drwxr-xr-x 2 root root 80 Jan 2 20:15 log lrwxrwxrwx 1 root root 21 Jan 2 20:15 resolv.conf -> /tmp/res olv.conf.auto -rw-r--r-- 1 root root 0 Jan 2 20:15 resolv.conf.auto drwxrwxrwx 2 root root 100 Jan 2 20:15 run drwxrwxrwt 2 root root 40 Jan 2 20:15 shm drwxrwxrwx 2 root root 60 Jan 2 20:15 state drwxr-xr-x 2 root root 40 Jan 2 20:15 tmp srwxr-xr-x 1 root root 0 Jan 2 20:15 wpa_ctrl_254-32 srwxr-xr-x 1 root root 0 Jan 2 20:15 wpa_ctrl_254-33 -rw-r--r-- 1 root root 2880000 Jan 2 20:19 yuvcolor1013.yuv 可以再开一个adb窗口,adb可以开很多个的^_ Microsoft Windows [版本 6.1.7600] 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。 C:\Users\Administrator>cd C:\tmp_gc2145 C:\tmp_gc2145>dir 驱动器 C 中的卷是 WIN7B64 卷的序列号是 C43E-FFB3 C:\tmp_gc2145 的目录 2017/05/23 17:04 . 2017/05/23 17:04 .. 0 个文件 0 字节 2 个目录 21,963,571,200 可用字节 获取图片:(这里使用了简单粗暴的方法,全部拿出来了。) C:\tmp_gc2145>adb pull /tmp/ . pull: building file list... skipping special file 'wpa_ctrl_254-33' skipping special file 'wpa_ctrl_254-32' skipping special file 'resolv.conf' skipping special file 'ubus.sock' pull: /tmp/log/wtmp -> ./log/wtmp pull: /tmp/log/lastlog -> ./log/lastlog pull: /tmp/state/network -> ./state/network pull: /tmp/run/config.md5 -> ./run/config.md5 pull: /tmp/run/ntpd.pid -> ./run/ntpd.pid pull: /tmp/booting_state -> ./booting_state pull: /tmp/resolv.conf.auto -> ./resolv.conf.auto pull: /tmp/TZ -> ./TZ pull: /tmp/command -> ./command pull: /tmp/color1013.yuv.exif -> ./color1013.yuv.exif pull: /tmp/yuvcolor1013.yuv -> ./yuvcolor1013.yuv 11 files pulled. 0 files skipped. 8820 KB/s (2881342 bytes in 0.319s) C:\tmp_gc2145> (可选操作:) C:\tmp_gc2145>adb pull /tmp/yuvcolor1013.yuv c:\ 现在激动人心的刻到来了,你可以使用yuv看图工具:yuvplayer.exe 来查看你所获取的YUV格式的图片:yuvtest1013.yuv 请注意需要设置: YUV的格式设置:(NV12) 分辨率设置(1600x1200):请以您的实际分辨率为准。 9、可能会用到的调试命令: dmesg ps -aux ps -e 10、可选的改进(可以不修改的): R:\wyb\gc2145_tinav2.1\target\allwinner\generic\configs\env-3.4.cfg (uboot启动的候延迟3秒钟) bootdelay=3 (SDK中已经修改了。调低打印等级,以便尽可能多的看到打印信息) loglevel=8
全志R16的android4.4.2平台点亮gc2145(evb30) 版本:V1.1 1、配置ov2640在android层配置的分辨率为vga(预览/拍照/录像) 注意:系统自带的快拍APP就在这里查找分辨率参数发送到camera的HAL层。 这里得分辨率设置为:拍照1600x1200,预览640x480 驱动里面搜索可以设置为:1600x1200, 1280x720(花屏), 800x600(分辨率不能切换到这里), 640x480 提取分辨率的小知识: R:\wyb\gc2145_parrotv1.1_r16m\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\gc2145.c 搜索:_regs[] static struct regval_list sensor_default_regs[] = { (默认分辨率是VGA分辨率:640x480) /* 1600X1200 UXGA capture */ static struct regval_list sensor_uxga_regs[] ={ /* 800X600 SVGA,30fps*/ static struct regval_list sensor_svga_regs[] = //1280*720---init---/// static struct regval_list gc2145_hd720_regs[] = { R:\wyb\gc2145_parrotv1.1_r16m\android\device\softwinner\astar-evb30\configs\camera.cfg ;------------------------------------------------------------------------------- ; 用于camera的配置 ; ; 采用格式: ; key = key_value ; 注意: 每个key需要顶格写; ; key_value紧跟着key后面的等号后面, 位于同一行中; ; key_value限制大小为256字节以内; ; ;------------------------------------------------------------------------------- ;------------------------------------------------------------------------------- ; exif information of "make" and "model" ;------------------------------------------------------------------------------- key_camera_exif_make = MAKE_A31S key_camera_exif_model = MODEL_A31ST ;------------------------------------------------------------------------------- ; 1 for single camera, 2 for double camera ;------------------------------------------------------------------------------- number_of_camera = 1 ;------------------------------------------------------------------------------- ; CAMERA_FACING_BACK ; gc0307 gc2145 ;------------------------------------------------------------------------------- camera_id = 0 ;------------------------------------------------------------------------------- ; 1 for CAMERA_FACING_FRONT ; 0 for CAMERA_FACING_BACK ;------------------------------------------------------------------------------- camera_facing = 0 ;------------------------------------------------------------------------------- ; 1 for camera without isp(using built-in isp of Axx) ; 0 for camera with isp ;------------------------------------------------------------------------------- use_builtin_isp = 0 ;------------------------------------------------------------------------------- ; camera orientation (0, 90, 180, 270) ;------------------------------------------------------------------------------- camera_orientation = 90 ;------------------------------------------------------------------------------- ; driver device name ;------------------------------------------------------------------------------- camera_device = /dev/video0 ;------------------------------------------------------------------------------- ; device id ; for two camera devices with one CSI ;------------------------------------------------------------------------------- device_id = 0 used_preview_size = 1 key_support_preview_size = 640x480 key_default_preview_size = 640x480 used_picture_size = 1 ;key_support_picture_size = 1600x1200, 1280x720, 800x600, 640x480 key_support_picture_size = 1600x1200, 640x480 key_default_picture_size = 640x480 used_flash_mode = 0 key_support_flash_mode = on,off,auto key_default_flash_mode = on used_color_effect=0 key_support_color_effect = none,mono,negative,sepia,aqua key_default_color_effect = none used_frame_rate = 1 key_support_frame_rate = 10 key_default_frame_rate = 10 used_focus_mode = 0 key_support_focus_mode = auto,infinity,macro,fixed,continuous-video,continuous-picture key_default_focus_mode = auto used_scene_mode = 0 key_support_scene_mode = auto,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,steadyphoto,fireworks,sports,party,candlelight,barcode key_default_scene_mode = auto used_white_balance = 0 key_support_white_balance = auto,incandescent,fluorescent,warm-fluorescent,daylight,cloudy-daylight key_default_white_balance = auto used_exposure_compensation = 1 key_max_exposure_compensation = 3 key_min_exposure_compensation = -3 key_step_exposure_compensation = 1 key_default_exposure_compensation = 0 2、在init.rc(init.sun8i.rc)中加载gc2145.ko这个驱动模块。 R:\wyb\gc2145_parrotv1.1_r16m\android\device\softwinner\astar-evb30\init.sun8i.rc #csi module insmod /system/vendor/modules/videobuf-core.ko insmod /system/vendor/modules/videobuf-dma-contig.ko insmod /system/vendor/modules/cam_detect.ko #insmod /system/vendor/modules/actuator.ko #insmod /system/vendor/modules/ad5820_act.ko insmod /system/vendor/modules/cci.ko insmod /system/vendor/modules/vfe_os.ko insmod /system/vendor/modules/vfe_subdev.ko #insmod /system/vendor/modules/gc0307.ko #insmod /system/vendor/modules/gc0308.ko #insmod /system/vendor/modules/ov2035.ko #insmod /system/vendor/modules/ov2640.ko #insmod /system/vendor/modules/ov5640.ko insmod /system/vendor/modules/gc2145.ko insmod /system/vendor/modules/vfe_v4l2.ko 启动之后实际加载的摄像头的驱动模块: shell@astar-evb30:/ $ shell@astar-evb30:/ $ lsmod gt82x 9849 0 - Live 0x00000000 sunxi_schw 12559 0 - Live 0x00000000 (O) rtl8150 9023 0 - Live 0x00000000 sunxi_keyboard 3021 0 - Live 0x00000000 sw_device 13916 0 - Live 0x00000000 uvcvideo 61212 0 - Live 0x00000000 videobuf2_vmalloc 2600 1 uvcvideo, Live 0x00000000 videobuf2_memops 2366 1 videobuf2_vmalloc, Live 0x00000000 videobuf2_core 18902 1 uvcvideo, Live 0x00000000 vfe_v4l2 445492 1 - Live 0x00000000 gc2145 12782 0 - Live 0x00000000 vfe_subdev 4523 2 vfe_v4l2,gc2145, Live 0x00000000 vfe_os 3951 2 vfe_v4l2,vfe_subdev, Live 0x00000000 cci 21775 2 vfe_v4l2,gc2145, Live 0x00000000 videobuf_dma_contig 5567 1 vfe_v4l2, Live 0x00000000 videobuf_core 16520 2 vfe_v4l2,videobuf_dma_contig, Live 0x00000000 bcm_btlpm 7442 0 - Live 0x00000000 bcmdhd 629907 0 - Live 0x00000000 mali 210546 20 - Live 0x00000000 (O) lcd 41263 0 - Live 0x00000000 disp 992816 8 mali,lcd, Live 0x00000000 nand 282782 0 - Live 0x00000000 (O) shell@astar-evb30:/ $ 3、(可选操作)没有/dev/video1,只有/dev/video0 R:\wyb\gc2145_parrotv1.1_r16m\android\device\softwinner\astar-evb30\ueventd.sun8i.rc /dev/video0 0666 media media #/dev/video1 0666 media media 4、驱动程序:gc2145.c及其V4L2的适配层。 配置gc2145.c的编译选项,只需要修改device目录中的Makefile打开gc2145即可: R:\wyb\gc2145_parrotv1.1_r16m\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\gc2145.c (请严重注意,全志R16的parrotv1.1/android4.4.2的SDK里面是没有,只有android6.0下有) R:\wyb\gc2145_parrotv1.1_r16m\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\Makefile obj-m += gc2145.o obj-m += gc2155.o (这两个不用修改:) R:\wyb\test_ov2640_r16\lichee\linux-3.4\drivers\media\video\sunxi-vfe\Kconfig R:\wyb\test_ov2640_r16\lichee\linux-3.4\drivers\media\video\sunxi-vfe\Makefile R:\wyb\gc2145_parrotv1.1_r16m\lichee\linux-3.4\drivers\media\video\sunxi-vfe\sensor_info.c struct sensor_item sensor_list_t[] = { // name i2c_addr sensor type sensor size sensor max pclk (请参照OV2640/GC2155配置) { "gc2145" , 0x78, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "ov2640" , 0x60, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, …… }; 5、 R:\wyb\gc2145_parrotv1.1_r16m\lichee\tools\pack\chips\sun8iw5p1\configs\evb-30\sys_config.fex [power_sply] dcdc1_vol = 3000 dcdc2_vol = 1100 dcdc3_vol = 1200 dcdc4_vol = 0 dcdc5_vol = 1500 aldo2_vol = 2500 aldo3_vol = 3000 dldo3_vol = 3300 eldo1_vol = 2800 eldo2_vol = 1800 eldo3_vol = 1800 ;gldo1_vol = 3300 ldoio0_vol = 2800 ldoio1_vol = 3300 ;-------------------------------------------------------------------------------- ;vip (video input port) configuration ;vip_used: 0:disable 1:enable ;vip_mode: 0:sample one interface to one buffer 1:sample two interface to one buffer ;vip_dev_qty: The quantity of devices linked to capture bus ; ;vip_define_sensor_list: If you want use sensor detect function, please set vip_define_sensor_list = 1, and ; verify that file /system/etc/hawkview/sensor_list_cfg.ini is properly configured! ; ;vip_dev(x)_pos: sensor position, "rear" or "front", if vip_define_sensor_list = 1,vip_dev(x)_pos must be configured! ; ;vip_dev(x)_isp_used 0:not use isp 1:use isp ;vip_dev(x)_fmt: 0:yuv 1:bayer raw rgb ;vip_dev(x)_stby_mode: 0:not shut down power at standby 1:shut down power at standby ;vip_dev(x)_vflip: flip in vertical direction 0:disable 1:enable ;vip_dev(x)_hflip: flip in horizontal direction 0:disable 1:enable ;vip_dev(x)_iovdd: camera module io power handle string, pmu power supply ;vip_dev(x)_iovdd_vol: camera module io power voltage, pmu power supply ;vip_dev(x)_avdd: camera module analog power handle string, pmu power supply ;vip_dev(x)_avdd_vol: camera module analog power voltage, pmu power supply ;vip_dev(x)_dvdd: camera module core power handle string, pmu power supply ;vip_dev(x)_dvdd_vol: camera module core power voltage, pmu power supply ;vip_dev(x)_afvdd: camera module vcm power handle string, pmu power supply ;vip_dev(x)_afvdd_vol: camera module vcm power voltage, pmu power supply ;x indicates the index of the devices which are linked to the same capture bus ;fill voltage in uV, e.g. iovdd = 2.8V, vip_devx_iovdd_vol = 2800000 ;fill handle string as below: ;axp22_eldo3 ;axp22_dldo4 ;axp22_eldo2 ;fill handle string "" when not using any pmu power supply ;-------------------------------------------------------------------------------- [csi0] vip_used = 1 vip_mode = 0 vip_dev_qty = 1 vip_define_sensor_list = 0 vip_csi_pck = port:PE00<2> vip_csi_mck = port:PE01<2> vip_csi_hsync = port:PE02<2> vip_csi_vsync = port:PE03<2> vip_csi_d0 = port:PE04<2> vip_csi_d1 = port:PE05<2> vip_csi_d2 = port:PE06<2> vip_csi_d3 = port:PE07<2> vip_csi_d4 = port:PE08<2> vip_csi_d5 = port:PE09<2> vip_csi_d6 = port:PE10<2> vip_csi_d7 = port:PE11<2> vip_csi_sck = port:PE12<2> vip_csi_sda = port:PE13<2> vip_dev0_mname = "gc2145" vip_dev0_pos = "rear" vip_dev0_lane = 1 vip_dev0_twi_id = 2 vip_dev0_twi_addr = 0x78 vip_dev0_isp_used = 0 vip_dev0_fmt = 0 vip_dev0_stby_mode = 0 vip_dev0_vflip = 0 vip_dev0_hflip = 0 vip_dev0_iovdd = "" vip_dev0_iovdd_vol = 2800000 vip_dev0_avdd = "axp22_ldoio0" vip_dev0_avdd_vol = 2800000 vip_dev0_dvdd = "axp22_ldoio1" vip_dev0_dvdd_vol = 1800000 vip_dev0_afvdd = "" vip_dev0_afvdd_vol = 2800000 vip_dev0_power_en = vip_dev0_reset = port:PE14<1><0> vip_dev0_pwdn = port:PE15<1><1> vip_dev0_flash_en = vip_dev0_flash_mode = vip_dev0_af_pwdn = (可选配置:) ;---------------------------------------------------------------------------------- ;usb configuration ;usb_used: usb controller enable, 0-disable, 1-enable ;usb_port_type: usb mode: 0-device, 1-host, 2-otg ;usb_detect_type: usb hotplug detect mode, 0-none, 1-vbus/id detect, 2-id/dpdm detect ;usb_id_gpio: usb id detect IO ;usb_det_vbus_gpio: usb vbus detect IO, "axp_ctrl" for axp ;usb_drv_vbus_gpio: usb dirve vbus IO ;usb_restrict_gpio: usb current restrict IO ;usb_restric_flag: usb current restrict flag ;---------------------------------------------------------------------------------- [usbc0] usb_used = 1 usb_port_type = 0 power_start = 3 6、开发板上摄像头的I2C挂载在TWI2上面了,逻辑是需要打开的(但是不打开也能够用,很奇怪!): ;---------------------------------------------------------------------------------- ;i2c configuration ; twi_used = twix enable ;---------------------------------------------------------------------------------- [twi0] twi_used = 1 twi_scl = port:PH02<2> twi_sda = port:PH03<2> [twi1] twi_used = 1 twi_scl = port:PH04<2> twi_sda = port:PH05<2> [twi2] twi_used = 0 twi_scl = port:PE12<3> twi_sda = port:PE13<3> 直接配置摄像头的I2C了: vip_csi_sck = port:PE12<2> vip_csi_sda = port:PE13<2> 不过奇怪的是,摄像头并没有向其它平台那样生成设备节点: shell@astar-evb30:/ $ shell@astar-evb30:/ $ cd /sys/class/i2c-adapter shell@astar-evb30:/sys/class/i2c-adapter $ shell@astar-evb30:/sys/class/i2c-adapter $ shell@astar-evb30:/sys/class/i2c-adapter $ ll lrwxrwxrwx root root 1970-01-01 08:00 i2c-0 -> ../../devices/platform/twi.0/i2c-0 lrwxrwxrwx root root 1970-01-01 08:00 i2c-1 -> ../../devices/platform/twi.1/i2c-1 shell@astar-evb30:/sys/class/i2c-adapter $ 可能是全志R16的驱动程序不太规范吧!没有通过i2c_detect来注册2-003C这个节点。 直接在驱动程序中读取I2C,还是对的。0xF0/0xF1 device ID = 0x2145。 #define V4L2_IDENT_SENSOR 0x2145 /* * The gc2145 sits on i2c with ID 0x78 */ #define I2C_ADDR 0x78 #define SENSOR_NAME "gc2145"
全志R16平台的tinav2.0系统下调通HM1375 2017/8/24 14:04 开发板:SC3817R OS:tina V2.0 1、最新的驱动程序请直接联系HiMax原厂/代理商! R:\wyb\thl_r16_tinav2.0_hm1375\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\hm1375.c 2、 R:\wyb\thl_r16_tinav2.0_hm1375\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\Makefile EXTRA_LDFLAGS += --strip-debug ifneq ($(strip $(CONFIG_ARCH_SUN8IW8)),) obj-$(CONFIG_OV2710_MIPI)+= ov2710_mipi.o obj-$(CONFIG_OV4689)+= ov4689.o obj-$(CONFIG_OV4689_60FPS)+= ov4689_60fps.o obj-$(CONFIG_AR0330_MIPI)+= ar0330_mipi.o obj-$(CONFIG_OV4689_SDV)+= ov4689_sdv.o obj-$(CONFIG_GC1004_MIPI)+= gc1004_mipi.o obj-$(CONFIG_H22_MIPI)+= h22_mipi.o obj-$(CONFIG_NT99231_MIPI)+= nt99231_mipi.o else obj-m+= hm1375.o #obj-m+= ov5640.o #obj-m+= ov2640.o #obj-m+= ov7736.o #obj-m+= s5k4ec.o #obj-m+= s5k4ec_mipi.o #obj-m+= gc2035.o #obj-m+= gt2005.o #obj-m+= gc0307.o #obj-m+= gc0308.o #obj-m+= gc0328.o #obj-m+= gc0328c.o #obj-m+= gc0329.o #obj-m+= gc0311.o #obj-m+= hi253.o #obj-m+= sp2518.o #obj-m+= sp2519.o #obj-m+= sp0718.o #obj-m+= sp0838.o #obj-m+= ov16825.o #obj-m+= ov5650.o #obj-m+= ov5647.o #obj-m+= ov5647_mipi.o #obj-m+= t8et5.o #obj-m+= s5k4e1.o #obj-m+= s5k4e1_mipi.o #obj-m+= sp2518.o #obj-m+= sp0718.o #obj-m+= gc5004.o #obj-m+= gc5004_mipi.o #obj-m+= ov5648.o #obj-m+= ar0330.o #obj-m+= ov5648.o #obj-m+= sp5408.o #obj-m+= ov12830.o #obj-m+= ov8825.o #obj-m+= ov8850.o #obj-m+= gc2155.o #obj-m+= gc2145.o #obj-m+= gc2145d.o #obj-m+= ov8858.o #obj-m+= ov13850.o #obj-m+= imx214.o #obj-m+= ov8858_4lane.o #obj-m+= sp5409.o #obj-m+= s5k5e2yx.o #obj-m+= ov2710_mipi.o #obj-m+= siv121d.o #obj-m+= ov2710_mipi.o #obj-m+= bg0703.o #obj-m+= gc1014_mipi.o #obj-m+= imx219.o #obj-m+= imx224.o #obj-m+= imx322.o #obj-m+= ov8858_r2a_4lane.o #obj-m+= ov8865_4lane.o #obj-m+= ps1210.o #obj-m+= imx291.o endif 3、让tinav2.0启动之后不让摄像头camera休眠: R:\wyb\thl_r16_tinav2.0_hm1375\lichee\linux-3.4\drivers\media\video\sunxi-vfe\vfe.c static void probe_work_handle(struct work_struct *work) { struct vfe_dev *dev= container_of(work, struct vfe_dev, probe_work.work); int ret = 0; int input_num; int device_valid_count = 0; struct video_device *vfd; char vfe_name[16] = {0}; mutex_lock(&probe_hdl_lock); vfe_print("probe_work_handle start!\n"); vfe_dbg(0,"v4l2_device_register\n"); #ifdef USE_SPECIFIC_CCI vfe_clk_open(dev); #endif /* v4l2 device register */ ret = v4l2_device_register(&dev->pdev->dev, &dev->v4l2_dev); if (ret) { vfe_err("Error registering v4l2 device\n"); goto probe_hdl_free_dev; } dev_set_drvdata(&dev->pdev->dev, (dev)); vfe_dbg(0,"v4l2 subdev register\n"); /* v4l2 subdev register */ dev->is_same_module = 0; for(input_num=0; input_numdev_qty; input_num++) { vfe_print("v4l2 subdev register input_num = %d\n",input_num); if(!strcmp(dev->ccm_cfg[input_num]->ccm,"")) { vfe_err("Sensor name is NULL!\n"); goto snesor_register_end; } if(dev->is_same_module) { dev->ccm_cfg[input_num]->sd = dev->ccm_cfg[input_num-1]->sd; vfe_dbg(0,"num = %d , sd_0 = %p,sd_1 = %p\n",input_num,dev->ccm_cfg[input_num]->sd,dev->ccm_cfg[input_num-1]->sd); goto snesor_register_end; } if((dev->dev_qty > 1) && (input_num+1dev_qty)) { if((!strcmp(dev->ccm_cfg[input_num]->ccm,dev->ccm_cfg[input_num+1]->ccm))) dev->is_same_module = 1; } if(dev->vip_define_sensor_list == 1) { if(dev->ccm_cfg[input_num]->sensor_cfg_ini->power_settings_enable == 1) { cpy_ccm_power_settings(dev->ccm_cfg[input_num]); } } #ifdef _REGULATOR_CHANGE_ #else if(vfe_device_regulator_get(dev->ccm_cfg[input_num])) { vfe_err("vfe_device_regulator_get error at input_num = %d\n",input_num); goto snesor_register_end; } #endif vfe_print("vfe sensor detect start! input_num = %d\n",input_num); dev->input = input_num; if(vfe_sensor_register_check(dev,&dev->v4l2_dev,dev->ccm_cfg[input_num],&dev->dev_sensor[input_num],input_num) == NULL) { vfe_err("vfe sensor register check error at input_num = %d\n",input_num); dev->device_valid_flag[input_num] = 0; //goto snesor_register_end; } else{ dev->device_valid_flag[input_num] = 1; device_valid_count ++; } if(dev->ccm_cfg[input_num]->is_isp_used && dev->ccm_cfg[input_num]->is_bayer_raw) { if(read_ini_info(dev,input_num, "/system/etc/hawkview/")) { vfe_warn("read ini info fail\n"); } } if(dev->ccm_cfg[input_num]->act_used == 1) { dev->dev_act[input_num].addr = (unsigned short)(dev->ccm_cfg[input_num]->act_slave>>1); strcpy(dev->dev_act[input_num].type,dev->ccm_cfg[input_num]->act_name); if(vfe_actuator_subdev_register(dev,dev->ccm_cfg[input_num], &dev->dev_act[input_num]) != 0) ;//goto probe_hdl_free_dev; } snesor_register_end: vfe_dbg(0,"dev->ccm_cfg[%d] = %p\n",input_num,dev->ccm_cfg[input_num]); vfe_dbg(0,"dev->ccm_cfg[%d]->sd = %p\n",input_num,dev->ccm_cfg[input_num]->sd); vfe_dbg(0,"dev->ccm_cfg[%d]->power.iovdd = %p\n",input_num,dev->ccm_cfg[input_num]->power.iovdd); vfe_dbg(0,"dev->ccm_cfg[%d]->power.avdd = %p\n",input_num,dev->ccm_cfg[input_num]->power.avdd); vfe_dbg(0,"dev->ccm_cfg[%d]->power.dvdd = %p\n",input_num,dev->ccm_cfg[input_num]->power.dvdd); vfe_dbg(0,"dev->ccm_cfg[%d]->power.afvdd = %p\n",input_num,dev->ccm_cfg[input_num]->power.afvdd); } dev->input = -1; /*video device register */ ret = -ENOMEM; vfd = video_device_alloc(); if (!vfd) { goto probe_hdl_unreg_dev; } *vfd = vfe_template[dev->id]; vfd->v4l2_dev = &dev->v4l2_dev; sprintf(vfe_name,"vfe-%d",dev->id); dev_set_name(&vfd->dev, vfe_name); if (0 != device_valid_count) { ret = video_register_device(vfd, VFL_TYPE_GRABBER, dev->id); if (ret < 0) { goto probe_hdl_rel_vdev; } } video_set_drvdata(vfd, dev); /*add device list*/ /* Now that everything is fine, let's add it to device list */ list_add_tail(&dev->devlist, &devlist); dev->vfd = vfd; vfe_print("V4L2 device registered as %s\n",video_device_node_name(vfd)); /*initial video buffer queue*/ videobuf_queue_dma_contig_init(&dev->vb_vidq, &vfe_video_qops, NULL, &dev->slock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE,//default format, can be changed by s_fmt sizeof(struct vfe_buffer), dev,NULL); ret = sysfs_create_group(&dev->pdev->dev.kobj, &vfe_attribute_group); #ifdef CONFIG_ES dev->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB + 1; dev->early_suspend.suspend = vfe_early_suspend; dev->early_suspend.resume = vfe_late_resume; // [hawkview_err]xxxxcan't open /dev/video0(Resource temporarily unavailable) // 2016/10/25 14:33 wenyuanbo cloase suspend. // register_early_suspend(&dev->early_suspend); vfe_print("register_early_suspend @ probe handle!\n"); #endif #ifdef USE_SPECIFIC_CCI vfe_clk_close(dev); #endif vfe_print("probe_work_handle end!\n"); mutex_unlock(&probe_hdl_lock); return ; probe_hdl_rel_vdev: video_device_release(vfd); vfe_print("video_device_release @ probe_hdl!\n"); probe_hdl_unreg_dev: vfe_print("v4l2_device_unregister @ probe_hdl!\n"); v4l2_device_unregister(&dev->v4l2_dev); probe_hdl_free_dev: vfe_print("vfe_resource_release @ probe_hdl!\n"); #ifdef USE_SPECIFIC_CCI csi_cci_exit_helper(dev->cci_sel); vfe_clk_close(dev); #endif //vfe_resource_release(dev); vfe_err("Failed to install at probe handle\n"); mutex_unlock(&probe_hdl_lock); return ; } 4、 R:\wyb\thl_r16_tinav2.0_hm1375\package\allwinner\cameratest\src\common\hawkview.c int fetch_sub_cmd(const char* buf,int buf_len,char** cmd,int* cmd_num,int lenght) { int i = 0,j = 0,n = 0; while(buf[i] != '#'){ //the sub cmd end by '#' while(buf[i] != 'x' && buf[i] != ':' && buf[i] != '#') { if((i+1) > buf_len) return 0; 修改为: if(i++ > buf_len) return 0; *((char*)cmd + n*lenght + j++) = buf[i++]; if(j > lenght) { hv_err("sub cmd over long\n"); *cmd_num = n + 1; return -1; } } *((char*)cmd + n*lenght + j++) = '\0'; n++; j = 0; if(buf[i] != '#'){ i++; } if(n > *cmd_num){ hv_err("the max cmd num is %d\n",*cmd_num); return -1; } } *cmd_num = n; return 0; } R:\wyb\thl_r16_tinav2.0_hm1375\package\allwinner\cameratest\src\common\video.c static int capture_frame(void* capture,int (*set_disp_addr)(int,int,unsigned int*),pthread_mutex_t* mutex) { capture_handle* cap = (capture_handle*)capture; int ret; int i; struct v4l2_buffer buf; enum v4l2_buf_type type; fd_set fds; struct timeval tv; pthread_mutex_lock(mutex); //used for cammand and status debug if (old_vi_cmd != cap->cmd){ hv_dbg("capture frame command %d --> %d\n",old_vi_cmd,cap->cmd); old_vi_cmd = (int)cap->cmd; } if(old_status != cap->status){ hv_dbg("capture frame status %d --> %d\n",old_status,cap->status); old_status = cap->status; } if(cap->status == OFF && cap->cmd == START_STREAMMING){ hv_dbg("capture start streaming\n"); type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (ioctl(videofh, VIDIOC_STREAMON, &type) == -1) { hv_err("VIDIOC_STREAMON error! %s\n",strerror(errno)); goto quit; } cap->status = ON; cap->cmd = COMMAND_UNUSED; pthread_mutex_unlock(mutex); return 0; } if(cap->status == ON && cap->cmd == STOP_STREAMMING){ hv_dbg("capture stop streaming\n"); type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(-1 == ioctl(videofh, VIDIOC_STREAMOFF, &type)){ hv_err("VIDIOC_STREAMOFF error! %s\n",strerror(errno)); goto quit; } cap->status = OFF; cap->cmd = COMMAND_UNUSED; capture_quit(capture); pthread_mutex_unlock(mutex); return 2; } if(cap->status == OFF) { pthread_mutex_unlock(mutex); return 0; } FD_ZERO(&fds); FD_SET(videofh, &fds); tv.tv_sec = 2; tv.tv_usec = 0; pthread_mutex_unlock(mutex); ret = select(videofh + 1, &fds, NULL, NULL, &tv); pthread_mutex_lock(mutex); //hv_dbg("select video ret: %d\n",ret); if (ret == -1) { if (errno == EINTR) { return 0; } hv_err("select error\n"); goto stream_off; } else if (ret == 0) { hv_err("select timeout\n"); pthread_mutex_unlock(mutex); return 0; } memset(&buf, 0, sizeof(struct v4l2_buffer)); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; ret = ioctl(videofh, VIDIOC_DQBUF, &buf); if (ret == -1) { hv_err("VIDIOC_DQBUF failed!\n"); goto stream_off; } float framerate; framerate = get_framerate((long long)(buf.timestamp.tv_sec),(long long)(buf.timestamp.tv_usec)); if(framerate > 1.0){ cap->cap_fps = framerate; //hv_dbg("framerate: %0.2ffps\n",cap->cap_fps); } //sync capture info perp x second #define M_SECOND 200 if(is_x_msec(M_SECOND,(long long)(buf.timestamp.tv_sec),(long long)(buf.timestamp.tv_usec))){ getExifInfo(&(cap->frame.exif)); set_cap_info((void*)cap); 修改为: // set_cap_info((void*)cap); } if(cap->cmd == STOP_SAVE_FRAME && cap->save_status == ON) cap->save_status = OFF; //save frame , the frame will be get by PC Tool to preview on PC screen //frame format: /dev/frame_x (x:0~21) if(cap->cmd == SAVE_FRAME || cap->save_status == ON ) { if(cap->cmd == SAVE_FRAME){ cap->save_status = ON; cap->cmd = COMMAND_UNUSED; } ret = do_save_frame(capture,buf.index); } //take yuv image,it will save the target frame exif info in the same time //image name: xxxx (set by usered through command) //exif info name: xxxx.exif if(cap->cmd == SAVE_IMAGE ) { ret = 0;//getExifInfo(&(cap->picture.exif)); //get target frame exif info successfully then save the target image //if get the exif info fail,it will try next frame if(ret == 0){ buffers[buf.index].phy_addr = buf.m.offset - 0x20000000; hv_dbg("index: %d buffers[buf.index].start = %p\n",buf.index,buffers[buf.index].start); //do_save_image(capture,buf.index); do_save_sub_image(capture,buf.index); cap->cmd = COMMAND_UNUSED; } } //get display addr int w,h; unsigned int addr; get_disp_addr(capture, buf.m.offset,&addr,&w,&h); // set disp buffer if (set_disp_addr){ set_disp_addr(w,h,&addr); } ret = ioctl(videofh, VIDIOC_QBUF, &buf); if (ret == -1) { hv_err("VIDIOC_DQBUF failed!\n"); goto stream_off; } pthread_mutex_unlock(mutex); return 0; stream_off: hv_err("err stream off\n"); ioctl(videofh, VIDIOC_STREAMOFF, &type); quit: capture_quit(capture); pthread_mutex_unlock(mutex); return -1; } R:\wyb\thl_r16_tinav2.0_hm1375\package\allwinner\cameratest\src\common\video_helper.c int set_cap_info(void* capture) { char info[500]; char exif[500]; char file_path[20]; capture_handle* cap = (capture_handle*)capture; memset(info,0,sizeof(info)); strcpy(file_path,"dev/info"); 修改为: //strcpy(file_path, "dev/info"); sprintf(file_path, "%s/%s.info", PATH, cap->picture.path_name); //sync string: sensor_type:save_status:framrate:capture_w:capture_h,sub_w,sub_h# sprintf(info, \ "sensor_type = %s\n" \ "status = %d\n" \ "framerate = %0.2f\n" \ "subchanel_width = %d\n" \ "subchanel_height = %d\n" \ "rotation = %d\n\n", \ (cap->sensor_type == 1)?"raw":"yuv", \ cap->save_status, \ cap->cap_fps, \ cap->sub_w, \ cap->sub_h, \ cap->sub_rot); make_exif_info(exif,"none",&(cap->frame.exif),cap->cap_w,cap->cap_h); strcat(info,exif); //hv_dbg("info str:\n%s\n",info); return write_file(file_path,info,sizeof(info)); } int do_save_sub_image(void* capture,int buf_index) { int ret; char image_name[30]; capture_handle* cap = (capture_handle*)capture; memset(image_name,0,sizeof(image_name)); sprintf(image_name,"%s/%s", PATH,cap->picture.path_name); hv_dbg("image_name: %s\n",image_name); (建议增加这里) set_cap_info(capture); set_exif_info(capture); hv_dbg("--------set_exif_info end\n"); void* vir_sub_start = NULL; unsigned int phy_sub_start = 0; int w,h; if(cap->sensor_type == V4L2_SENSOR_TYPE_RAW){ vir_sub_start = (unsigned int)(buffers[buf_index].start) + ALIGN_4K(ALIGN_16B(cap->cap_w) * cap->cap_h * 3 >> 1); phy_sub_start = buffers[buf_index].phy_addr + ALIGN_4K(ALIGN_16B(cap->cap_w) * cap->cap_h * 3 >> 1); w = cap->sub_w; h = cap->sub_h; } else { vir_sub_start = buffers[buf_index].start; phy_sub_start = buffers[buf_index].phy_addr; w = cap->cap_w; h = cap->cap_h; } #ifdef ANDROID_ENV ret = save_jpeg_frame(image_name,phy_sub_start,w,h); //sprintf(image_name,"/data/camera/yuv%s", cap->picture.path_name); //ret = save_jpeg_frame_by_viraddr(image_name,(void*)vir_sub_start,cap->sub_w,cap->sub_h); #else sprintf(image_name,"%s/yuv%s", PATH,cap->picture.path_name); ret = save_frame_to_file(image_name, \ (void*)(vir_sub_start), \ w,h,cap->cap_fmt, \ 1); #endif if(ret == -1) hv_err("save image failed!\n"); return 0; } 5、可选增加fpscamera: R:\wyb\thl_r16_tinav2.0_hm1375\package\allwinner\fpscamera 6、 define KernelPackage/sunxi-vfe SUBMENU:=$(VIDEO_MENU) TITLE:=sunxi-vfe support FILES:=$(LINUX_DIR)/drivers/media/video/videobuf-core.ko FILES+=$(LINUX_DIR)/drivers/media/video/videobuf-dma-contig.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/csi_cci/cci.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_os.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_subdev.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/device/gc0308.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_v4l2.ko AUTOLOAD:=$(call AutoLoad,90,videobuf-core videobuf-dma-contig cci vfe_os vfe_subdev gc0308 vfe_v4l2) endef 修改为: define KernelPackage/sunxi-vfe SUBMENU:=$(VIDEO_MENU) TITLE:=sunxi-vfe support FILES:=$(LINUX_DIR)/drivers/media/video/videobuf-core.ko FILES+=$(LINUX_DIR)/drivers/media/video/videobuf-dma-contig.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/csi_cci/cci.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_os.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_subdev.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/device/hm1375.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_v4l2.ko AUTOLOAD:=$(call AutoLoad,90,videobuf-core videobuf-dma-contig cci vfe_os vfe_subdev hm1375 vfe_v4l2) endef 7、 R:\wyb\thl_r16_tinav2.0_hm1375\target\allwinner\astar-parrot\configs\sys_config.fex ;---------------------------------------------------------------------------------- ;dcdc1_vol ---set dcdc1 voltage,mV,1600-3400,100mV/step ;dcdc2_vol ---set dcdc2 voltage,mV,600-1540,20mV/step ;dcdc3_vol ---set dcdc3 voltage,mV,600-1860,20mV/step ;dcdc4_vol ---set dcdc4 voltage,mV,600-1540,20mV/step ;dcdc5_vol ---set dcdc5 voltage,mV,1000-2550,50mV/step ;aldo2_vol ---set aldo2 voltage,mV,700-3300,100mV/step ;aldo3_vol ---set aldo3 voltage,mV,700-3300,100mV/step ;---------------------------------------------------------------------------------- [power_sply] dcdc1_vol = 3000 dcdc2_vol = 1100 dcdc3_vol = 1200 dcdc4_vol = 0 dcdc5_vol = 1500 aldo2_vol = 2500 aldo3_vol = 3000 dldo3_vol = 2800 ;gpio0_vol = 2800 ldoio0_vol = 2800 [twi2] twi_used = 1 twi_scl = port:PE12<3> twi_sda = port:PE13<3> ;-------------------------------------------------------------------------------- ;vip (video input port) configuration ;vip_used: 0:disable 1:enable ;vip_mode: 0:sample one interface to one buffer 1:sample two interface to one buffer ;vip_dev_qty: The quantity of devices linked to capture bus ; ;vip_define_sensor_list: If you want use sensor detect function, please set vip_define_sensor_list = 1, and ; verify that file /system/etc/hawkview/sensor_list_cfg.ini is properly configured! ; ;vip_dev(x)_pos: sensor position, "rear" or "front", if vip_define_sensor_list = 1,vip_dev(x)_pos must be configured! ; ;vip_dev(x)_isp_used 0:not use isp 1:use isp ;vip_dev(x)_fmt: 0:yuv 1:bayer raw rgb ;vip_dev(x)_stby_mode: 0:not shut down power at standby 1:shut down power at standby ;vip_dev(x)_vflip: flip in vertical direction 0:disable 1:enable ;vip_dev(x)_hflip: flip in horizontal direction 0:disable 1:enable ;vip_dev(x)_iovdd: camera module io power handle string, pmu power supply ;vip_dev(x)_iovdd_vol: camera module io power voltage, pmu power supply ;vip_dev(x)_avdd: camera module analog power handle string, pmu power supply ;vip_dev(x)_avdd_vol: camera module analog power voltage, pmu power supply ;vip_dev(x)_dvdd: camera module core power handle string, pmu power supply ;vip_dev(x)_dvdd_vol: camera module core power voltage, pmu power supply ;vip_dev(x)_afvdd: camera module vcm power handle string, pmu power supply ;vip_dev(x)_afvdd_vol: camera module vcm power voltage, pmu power supply ;x indicates the index of the devices which are linked to the same capture bus ;fill voltage in uV, e.g. iovdd = 2.8V, vip_devx_iovdd_vol = 2800000 ;fill handle string as below: ;axp22_eldo3 ;axp22_dldo4 ;axp22_eldo2 ;fill handle string "" when not using any pmu power supply ;-------------------------------------------------------------------------------- [csi0] vip_used = 1 vip_mode = 0 vip_dev_qty = 1 vip_define_sensor_list = 0 vip_csi_pck = port:PE00<2> vip_csi_mck = port:PE01<2> vip_csi_hsync = port:PE02<2> vip_csi_vsync = port:PE03<2> vip_csi_d0 = port:PE04<2> vip_csi_d1 = port:PE05<2> vip_csi_d2 = port:PE06<2> vip_csi_d3 = port:PE07<2> vip_csi_d4 = port:PE08<2> vip_csi_d5 = port:PE09<2> vip_csi_d6 = port:PE10<2> vip_csi_d7 = port:PE11<2> ;vip_csi_sck = port:PE12<2> ;vip_csi_sda = port:PE13<2> vip_dev0_mname = "hm1375" vip_dev0_pos = "rear" vip_dev0_lane = 1 vip_dev0_twi_id = 2 vip_dev0_twi_addr = 0x48 vip_dev0_isp_used = 0 vip_dev0_fmt = 0 (调试候推荐选0,给摄像头钟供电,方便测量电压:) vip_dev0_stby_mode = 0 vip_dev0_vflip = 0 vip_dev0_hflip = 0 vip_dev0_iovdd = "" vip_dev0_iovdd_vol = 2800000 vip_dev0_avdd = "axp22_ldoio0" vip_dev0_avdd_vol = 2800000 vip_dev0_dvdd = "" vip_dev0_dvdd_vol = 1800000 vip_dev0_afvdd = "" vip_dev0_afvdd_vol = 2800000 vip_dev0_power_en = vip_dev0_reset = port:PE14<1><0> vip_dev0_pwdn = port:PE15<1><1> vip_dev0_flash_en = vip_dev0_flash_mode = vip_dev0_af_pwdn = 8、可选: rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ make menuconfig 内核的修改保存在这里: R:\wyb\thl_r16_tinav2.0_hm1375\target\allwinner\astar-parrot\config-3.4 rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ make menuconfig 系统的修改保存在这里: R:\wyb\thl_r16_tinav2.0_hm1375\target\allwinner\astar-parrot\defconfig 9、为了调试方便,可选修改: R:\wyb\thl_r16_tinav2.0_hm1375\target\allwinner\generic\configs\env.cfg bootdelay=3 #default bootcmd, will change at runtime according to key press bootcmd=run setargs_nand boot_normal#default nand boot #kernel command arguments console=ttyS0,115200 nor_root=/dev/mtdblock4 nand_root=/dev/nandd mmc_root=/dev/mmcblk0p7 init=/sbin/init loglevel=8 #set kernel cmdline if boot.img or recovery.img has no cmdline we will use this setargs_nor=setenv bootargs console=${console} root=${nor_root} rootwait init=${init} ion_cma_list="8m,32m,64m,128m,256m"loglevel=${loglevel} partitions=${partitions} setargs_nand=setenv bootargs console=${console} root=${nand_root} rootwait init=${init} ion_cma_list="8m,32m,64m,128m,256m" loglevel=${loglevel} partitions=${partitions} setargs_mmc=setenv bootargs console=${console} root=${mmc_root} rootwait init=${init} ion_cma_list="8m,32m,64m,128m,256m" loglevel=${loglevel} partitions=${partitions} #nand command syntax: sunxi_flash read address partition_name read_bytes #0x40007800 = 0x40008000(kernel entry) - 0x800(boot.img header 2k) boot_normal=fatload sunxi_flash boot 43800000 uImage;bootm 43800000 boot_recovery=fatload sunxi_flash extend 43800000 uImage;bootm 43800000 boot_fastboot=fastboot #recovery key recovery_key_value_max=0x13 recovery_key_value_min=0x10 #fastboot key fastboot_key_value_max=0x8 fastboot_key_value_min=0x2 10、先编译一遍tianv2.0的系统,然后增加sunxi-vfe support支持: rootroot@rootroot-E400:~$ cd wyb/thl_r16_tinav2.0_hm1375/ rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ 7za x thl_r16_tinav2.0_hm1375等待最终验证_20170824_1141.7z -r -o./ rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ source build/envsetup.sh including target/allwinner/octopus-dev/vendorsetup.sh including target/allwinner/astar-parrot/vendorsetup.sh including target/allwinner/astar-evb/vendorsetup.sh including target/allwinner/generic/vendorsetup.sh including target/allwinner/tulip-d1/vendorsetup.sh including target/allwinner/astar-spk/vendorsetup.sh rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ lunch You're building on Linux Lunch menu... pick a combo: 1. octopus_dev-tina 2. octopus_dev-dragonboard 3. astar_parrot-tina 4. astar_parrot-dragonboard 5. astar_evb-tina 6. tulip_d1-tina 7. tulip_d1-dragonboard 8. astar_spk-tina 9. astar_spk-dragonboard Which would you like?3 ============================================ PLATFORM_VERSION_CODENAME=Neptune PLATFORM_VERSION=2.0.0 TARGET_PRODUCT=astar_parrot TARGET_BUILD_VARIANT=tina TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a-neon TARGET_CPU_VARIANT=cortex-a7 TARGET_2ND_ARCH= TARGET_2ND_ARCH_VARIANT= TARGET_2ND_CPU_VARIANT= HOST_ARCH=x86_64 HOST_OS=linux HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty HOST_BUILD_TYPE=release BUILD_ID=57513AA3 OUT_DIR= ============================================ rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ make -j8 rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ pack -d rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ make menuconfig Allwinner ---> < > fpscamera................................. fpscamera just test the camera 修改为: <*> fpscamera................................. fpscamera just test the camera Kernel modules ---> Video Support ---> < > kmod-sunxi-vfe......................................... sunxi-vfe support 修改为: <*> kmod-sunxi-vfe......................................... sunxi-vfe support rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ make -j12 rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ pack -d 11、加载hm1375的驱动的候查看I2C是否是通的: R:\wyb\thl_r16_tinav2.0_hm1375\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\hm1375.c static int sensor_detect(struct v4l2_subdev *sd) { int ret; unsigned char rdval; printk("****wyb %s:%d/%s()! verify HM1375\n", __FILE__, __LINE__, __func__); LOG_ERR_RET(sensor_read(sd, 0x0001, &rdval)) ret = sensor_read(sd, 0x0001,&rdval); printk("****wyb %s:%d/%s()! reg:0x0001=value:0xx right=0x03/0x13\n", __FILE__, __LINE__, __func__, rdval); if (ret < 0) { vfe_dev_err("sensor_read err at sensor_detect!\n"); return ret; } if((rdval != 0x03) && (rdval != 0x13)) { vfe_dev_err("read high val: %d\n", rdval); return -ENODEV; } LOG_ERR_RET(sensor_read(sd, 0x0002, &rdval)) printk("****wyb %s:%d/%s()! reg:0x0002=value:0xx right=0x75\n", __FILE__, __LINE__, __func__, rdval); if(rdval != 0x75) { vfe_dev_err("read low val: %d\n", rdval); return -ENODEV; } printk("HM1375 sensor_detect OK\r\n"); return 0; } (奇怪的候HM1375的0x0001号寄存器,第一次读是0x03,以后都是0x13,好神奇!) [ 16.030894] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2891/sensor_detect()! verify HM1375 [ 16.042100] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2895/sensor_detect()! reg:0x0001=value:0x03 right=0x03/0x13 [ 16.055259] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2909/sensor_detect()! reg:0x0002=value:0x75 right=0x75 [ 16.067560] HM1375 sensor_detect OK [ 47.398156] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2891/sensor_detect()! verify HM1375 [ 47.409351] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2895/sensor_detect()! reg:0x0001=value:0x13 right=0x03/0x13 [ 47.422492] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2909/sensor_detect()! reg:0x0002=value:0x75 right=0x75 [ 47.434769] HM1375 sensor_detect OK [ 88.217828] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2891/sensor_detect()! verify HM1375 [ 88.228920] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2895/sensor_detect()! reg:0x0001=value:0x13 right=0x03/0x13 [ 88.242056] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2909/sensor_detect()! reg:0x0002=value:0x75 right=0x75 [ 88.254325] HM1375 sensor_detect OK
全志R16的parrotv1.1的系统调通摄像头hm1375 2017/8/24 14:04 版本:V1.1 开发板:SC3817R OS:parrotv1.1(Android4.4.2) 1、 R:\wyb\hm1375_parrotv1.1\android\device\softwinner\astar-evb30\configs\camera.cfg ;------------------------------------------------------------------------------- ; 用于camera的配置 ; ; 采用格式: ; key = key_value ; 注意: 每个key需要顶格写; ; key_value紧跟着key后面的等号后面, 位于同一行中; ; key_value限制大小为256字节以内; ; ;------------------------------------------------------------------------------- ;------------------------------------------------------------------------------- ; exif information of "make" and "model" ;------------------------------------------------------------------------------- key_camera_exif_make = MAKE_A31S key_camera_exif_model = MODEL_A31ST ;------------------------------------------------------------------------------- ; 1 for single camera, 2 for double camera ;------------------------------------------------------------------------------- number_of_camera = 1 ;------------------------------------------------------------------------------- ; CAMERA_FACING_BACK ; gc0307 hm1375 ;------------------------------------------------------------------------------- camera_id = 0 ;------------------------------------------------------------------------------- ; 1 for CAMERA_FACING_FRONT ; 0 for CAMERA_FACING_BACK ;------------------------------------------------------------------------------- camera_facing = 0 ;------------------------------------------------------------------------------- ; 1 for camera without isp(using built-in isp of Axx) ; 0 for camera with isp ;------------------------------------------------------------------------------- use_builtin_isp = 0 ;------------------------------------------------------------------------------- ; camera orientation (0, 90, 180, 270) ;------------------------------------------------------------------------------- camera_orientation = 90 ;------------------------------------------------------------------------------- ; driver device name ;------------------------------------------------------------------------------- camera_device = /dev/video0 ;------------------------------------------------------------------------------- ; device id ; for two camera devices with one CSI ;------------------------------------------------------------------------------- device_id = 0 used_preview_size = 1 key_support_preview_size = 1280x1024, 1280x960, 1280x720, 640x480 key_default_preview_size = 640x480 used_picture_size = 1 key_support_picture_size = 1280x1024, 1280x960, 1280x720, 640x480 key_default_picture_size = 640x480 used_flash_mode = 0 key_support_flash_mode = on,off,auto key_default_flash_mode = on used_color_effect=0 key_support_color_effect = none,mono,negative,sepia,aqua key_default_color_effect = none used_frame_rate = 1 key_support_frame_rate = 10 key_default_frame_rate = 10 used_focus_mode = 0 key_support_focus_mode = auto,infinity,macro,fixed,continuous-video,continuous-picture key_default_focus_mode = auto used_scene_mode = 0 key_support_scene_mode = auto,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,steadyphoto,fireworks,sports,party,candlelight,barcode key_default_scene_mode = auto used_white_balance = 0 key_support_white_balance = auto,incandescent,fluorescent,warm-fluorescent,daylight,cloudy-daylight key_default_white_balance = auto used_exposure_compensation = 1 key_max_exposure_compensation = 3 key_min_exposure_compensation = -3 key_step_exposure_compensation = 1 key_default_exposure_compensation = 0 2、录像的候需要干掉对1080p分辨率的支持(HM1375最大支持720p): R:\wyb\hm1375_parrotv1.1\android\device\softwinner\astar-evb30\configs\media_profiles.xml 3、 R:\wyb\hm1375_parrotv1.1\android\device\softwinner\astar-evb30\init.sun8i.rc #csi module insmod /system/vendor/modules/videobuf-core.ko insmod /system/vendor/modules/videobuf-dma-contig.ko insmod /system/vendor/modules/cam_detect.ko #insmod /system/vendor/modules/actuator.ko #insmod /system/vendor/modules/ad5820_act.ko insmod /system/vendor/modules/cci.ko insmod /system/vendor/modules/vfe_os.ko insmod /system/vendor/modules/vfe_subdev.ko #insmod /system/vendor/modules/gc0307.ko #insmod /system/vendor/modules/ov2035.ko #insmod /system/vendor/modules/ov2640.ko #insmod /system/vendor/modules/ov5640.ko insmod /system/vendor/modules/hm1375.ko insmod /system/vendor/modules/vfe_v4l2.ko 4、可选修改: R:\wyb\hm1375_parrotv1.1\android\device\softwinner\astar-evb30\ueventd.sun8i.rc /dev/video0 0666 media media #/dev/video1 0666 media media 5、可选修改: R:\wyb\hm1375_parrotv1.1\android\frameworks\base\packages\SettingsProvider\res\values\defaults.xml 60000 false 修改为: 1800000 true 6、 R:\wyb\hm1375_parrotv1.1\android\frameworks\base\services\java\com\android\server\BatteryService.java public final class BatteryService extends Binder { private static final String TAG = BatteryService.class.getSimpleName(); // private static final boolean DEBUG = false; private static final boolean DEBUG = true; private static final int BATTERY_SCALE = 100; // battery capacity is a percentage // Used locally for determining when to make a last ditch effort to log // discharge stats before the device dies. private int mCriticalBatteryLevel; …… private void sendIntentLocked() { // Pack up the values and broadcast them to everyone final Intent intent = new Intent(Intent.ACTION_BATTERY_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_REPLACE_PENDING); int icon = getIconLocked(mBatteryProps.batteryLevel); intent.putExtra(BatteryManager.EXTRA_STATUS, mBatteryProps.batteryStatus); intent.putExtra(BatteryManager.EXTRA_HEALTH, mBatteryProps.batteryHealth); intent.putExtra(BatteryManager.EXTRA_PRESENT, mBatteryProps.batteryPresent); //intent.putExtra(BatteryManager.EXTRA_LEVEL, mBatteryProps.batteryLevel); intent.putExtra(BatteryManager.EXTRA_LEVEL, 100); intent.putExtra(BatteryManager.EXTRA_SCALE, BATTERY_SCALE); intent.putExtra(BatteryManager.EXTRA_ICON_SMALL, icon); intent.putExtra(BatteryManager.EXTRA_PLUGGED, mPlugType); //intent.putExtra(BatteryManager.EXTRA_VOLTAGE, mBatteryProps.batteryVoltage); intent.putExtra(BatteryManager.EXTRA_VOLTAGE, 4200); intent.putExtra(BatteryManager.EXTRA_TEMPERATURE, mBatteryProps.batteryTemperature); intent.putExtra(BatteryManager.EXTRA_TECHNOLOGY, mBatteryProps.batteryTechnology); intent.putExtra(BatteryManager.EXTRA_INVALID_CHARGER, mInvalidCharger); if (DEBUG) { Slog.d(TAG, "2016/12/05 10:41 wenyuanbo **** Sending ACTION_BATTERY_CHANGED. level:" + mBatteryProps.batteryLevel + ", scale:" + BATTERY_SCALE + ", status:" + mBatteryProps.batteryStatus + ", health:" + mBatteryProps.batteryHealth + ", present:" + mBatteryProps.batteryPresent + ", voltage: " + mBatteryProps.batteryVoltage + ", temperature: " + mBatteryProps.batteryTemperature + ", technology: " + mBatteryProps.batteryTechnology + ", AC powered:" + mBatteryProps.chargerAcOnline + ", USB powered:" + mBatteryProps.chargerUsbOnline + ", Wireless powered:" + mBatteryProps.chargerWirelessOnline + ", icon:" + icon + ", invalid charger:" + mInvalidCharger); } mHandler.post(new Runnable() { @Override public void run() { ActivityManagerNative.broadcastStickyIntent(intent, null, UserHandle.USER_ALL); } }); } …… } 7、低电量的候摄像头会被关闭: R:\wyb\hm1375_parrotv1.1\android\packages\apps\Camera2\src\com\android\camera\CameraActivity.java import static com.android.camera.CameraManager.CameraOpenErrorCallback; public class CameraActivity extends Activity implements ModuleSwitcher.ModuleSwitchListener, ActionBar.OnMenuVisibilityListener, ShareActionProvider.OnShareTargetSelectedListener { private static final String TAG = "CAM_Activity"; private static final String INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE = "android.media.action.STILL_IMAGE_CAMERA_SECURE"; public static final String ACTION_IMAGE_CAPTURE_SECURE = "android.media.action.IMAGE_CAPTURE_SECURE"; public static final String ACTION_TRIM_VIDEO = "com.android.camera.action.TRIM"; public static final String MEDIA_ITEM_PATH = "media-item-path"; …… private Intent mVideoShareIntent; private Intent mImageShareIntent; private AlertDialog mLocationDialog; private BroadcastReceiver mBatteryInfoReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (Intent.ACTION_BATTERY_CHANGED.equals(action)) { int Level = intent.getIntExtra("level", 0); int Scale = intent.getIntExtra("scale", 100); Log.w(TAG, "2016/11/29 19:54 &&&& wenyuanbo battery Level" + Level); /* *Logic: *1.the battery level is lower then 5%. *2.if in camera, make sure that not in the snapshot progress. *3.if in videocamera, make sure that not in the videorecording progress. *4.everytime starting the camera activity, the battery level is broadcasted, * if meeting the conditions above, give a dialog, press it and finish the activity. *5.if the conditions are not satisfied when started, play for a moment, in the camera acitvity * or video camera activity, the conditiosn are satisfied, also give a dialog for finishing the activity. * *by fuqiang. */ if(Level < 5) { Runnable runnable_close_camera = new Runnable() { @Override public void run() { //close the camera. // CameraActivity.this.finish(); } }; Log.w(TAG, "2016/11/29 18:20 **** wenyuanbo battery Level" + Level); showLocationDialog(); } /* *Logic: *1.the battery level is lhigher then 5% and lower than 15%. *2.if in camera, make sure that not in the snapshot progress. *3.if in videocamera, make sure that not in the videorecording progress. *4.whether in camera or in videocamera, make sure that the flash mode is supported. *5.everytime starting the camera activity, the battery level is broadcasted, * if meeting the conditions above, forbidden the flash(gray icon), give a dialog to notise user. *6.if the conditions are not satisfied when started, play for a moment, in the camera acitvity * or video camera activity, the conditiosn are satisfied, forbidden the flash and give a notice dialog. *7.the dialog is only given once for each camera activity starting. * *by fuqiang. */ else if(Level < 16) { //close the flash mode. /* if (mIsLowBatteryDialogShown == false) { mRotateDialog.showAlertDialog( getString(R.string.warning), getString(R.string.low_battery_15), null, null, getString(R.string.close), null); mIsLowBatteryDialogShown = true; } */ } } } }; …… } 8、HM1375的驱动程序请直接联系HiMax原厂或者代理商: R:\wyb\hm1375_parrotv1.1\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\hm1375.c R:\wyb\hm1375_parrotv1.1\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\Makefile obj-m += ov5640.o obj-m += hm1375.o obj-m += hm5065.o obj-m += ov2640.o obj-m += ov7736.o #obj-m += s5k4ec.o #obj-m += s5k4ec_mipi.o #obj-m += gc2035.o #obj-m += gt2005.o #obj-m += gc0307.o obj-m += gc0308.o #obj-m += gc0309.o #obj-m += gc0328.o #obj-m += gc0329.o #obj-m += gc0311.o #obj-m += hi253.o #obj-m += sp2518.o #obj-m += sp2519.o #obj-m += sp0718.o #obj-m += sp0838.o #obj-m += ov16825.o #obj-m += ov5650.o #obj-m += ov5647.o #obj-m += ov5647_mipi.o #obj-m += t8et5.o #obj-m += s5k4e1.o #obj-m += s5k4e1_mipi.o #obj-m += sp2518.o #obj-m += sp0718.o #obj-m += gc5004.o #obj-m += gc5004_mipi.o #obj-m += ov5648.o #obj-m += ar0330.o #obj-m += ov5648.o #obj-m += sp5408.o #obj-m += ov12830.o #obj-m += ov8825.o #obj-m += ov8850.o #obj-m += gc2155.o #obj-m += ov8858.o #obj-m += ov13850.o #obj-m += ov8858_4lane.o 9、hm1375项请参照ov2640填写: R:\wyb\hm1375_parrotv1.1\lichee\linux-3.4\drivers\media\video\sunxi-vfe\sensor_info.c struct sensor_item sensor_list_t[] = { // name i2c_addr sensor type sensor size sensor max pclk //{ "gc2145" , 0x78, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "hm1375" , 0x48, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "hm5065" , 0x3e, SENSOR_YUV , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "ov2640" , 0x60, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "ov5640" , 0x78, SENSOR_YUV , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "ov5647" , 0x6c, SENSOR_RAW , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "ov5647_mipi" , 0x6c, SENSOR_RAW , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "ov5650" , 0x50, SENSOR_RAW , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "ov5648" , 0x6c, SENSOR_RAW , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "ov8825" , 0x6c, SENSOR_RAW , PIXEL_NUM_8M , CORE_CLK_RATE_FOR_8M}, { "ov8850" , 0x20, SENSOR_RAW , PIXEL_NUM_8M , CORE_CLK_RATE_FOR_8M}, { "ov12830" , 0x6c, SENSOR_RAW , PIXEL_NUM_12M , CORE_CLK_RATE_FOR_16M}, { "ov16825" , 0x6c, SENSOR_RAW , PIXEL_NUM_16M , CORE_CLK_RATE_FOR_16M}, { "gc0329" , 0x62, SENSOR_YUV , PIXEL_NUM_0_3M , CORE_CLK_RATE_FOR_2M}, { "gc0309" , 0x42, SENSOR_YUV , PIXEL_NUM_0_3M , CORE_CLK_RATE_FOR_2M}, { "gc0307" , 0x42, SENSOR_YUV , PIXEL_NUM_0_3M , CORE_CLK_RATE_FOR_2M}, { "gc0308" , 0x42, SENSOR_YUV , PIXEL_NUM_0_3M , CORE_CLK_RATE_FOR_2M}, { "gc2035" , 0x78, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "gt2005" , 0x78, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "gc2015" , 0x60, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "gc2235" , 0x78, SENSOR_RAW , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "sp0838" , 0x30, SENSOR_YUV , PIXEL_NUM_0_3M , CORE_CLK_RATE_FOR_2M}, { "sp0718" , 0x6c, SENSOR_YUV , PIXEL_NUM_0_3M , CORE_CLK_RATE_FOR_2M}, { "sp2518" , 0x6c, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "hi253" , 0x40, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "hi257" , 0x40, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "s5k4ec" , 0x5a, SENSOR_YUV , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "s5k4ec_mipi" , 0x5a, SENSOR_YUV , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "s5k4e1" , 0x20, SENSOR_RAW , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "s5k4e1_mipi" , 0x20, SENSOR_RAW , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "t4k05" , 0x6c, SENSOR_RAW , PIXEL_NUM_8M , CORE_CLK_RATE_FOR_8M}, { "t8et5" , 0x78, SENSOR_RAW , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "ar0330" , 0x20, SENSOR_RAW , PIXEL_NUM_3M , CORE_CLK_RATE_FOR_3M}, { "bf3a03" , 0xDC, SENSOR_YUV , PIXEL_NUM_0_3M , CORE_CLK_RATE_FOR_2M}, { "gc0311" , 0x66, SENSOR_YUV , PIXEL_NUM_0_3M , CORE_CLK_RATE_FOR_2M}, { "gc0311" , 0x66, SENSOR_YUV , PIXEL_NUM_0_3M , CORE_CLK_RATE_FOR_2M}, { "gc5004" , 0x6c, SENSOR_RAW , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "gc5004_mipi" , 0x6c, SENSOR_RAW , PIXEL_NUM_5M , CORE_CLK_RATE_FOR_5M}, { "nt99252" , 0x6c, SENSOR_YUV , PIXEL_NUM_2M , CORE_CLK_RATE_FOR_2M}, { "ov7736" , 0x42, SENSOR_YUV , PIXEL_NUM_0_3M , CORE_CLK_RATE_FOR_2M}, }; 10、 R:\wyb\hm1375_parrotv1.1\lichee\tools\pack\chips\sun8iw5p1\configs\default\env.cfg bootdelay=3 #default bootcmd, will change at runtime according to key press bootcmd=run setargs_nand boot_normal#default nand boot #kernel command arguments console=ttyS0,115200 nand_root=/dev/nandd mmc_root=/dev/mmcblk0p7 init=/init loglevel=8 #set kernel cmdline if boot.img or recovery.img has no cmdline we will use this setargs_nand=setenv bootargs console=${console} root=${nand_root} init=${init} ion_cma_512m=120m ion_cma_1g=176m ion_carveout_512m=96m ion_carveout_1g=150m coherent_pool=4m loglevel=${loglevel} partitions=${partitions} setargs_mmc=setenv bootargs console=${console} root=${mmc_root} init=${init} ion_cma_512m=120m ion_cma_1g=176m ion_carveout_512m=96m ion_carveout_1g=150m coherent_pool=4m loglevel=${loglevel} partitions=${partitions} #nand command syntax: sunxi_flash read address partition_name read_bytes #0x40007800 = 0x40008000(kernel entry) - 0x800(boot.img header 2k) boot_normal=sunxi_flash read 40007800 boot;boota 40007800 boot_recovery=sunxi_flash read 40007800 recovery;boota 40007800 boot_fastboot=fastboot #recovery key recovery_key_value_max=0x13 recovery_key_value_min=0x10 #fastboot key fastboot_key_value_max=0x8 fastboot_key_value_min=0x2 11、 R:\wyb\hm1375_parrotv1.1\lichee\tools\pack\chips\sun8iw5p1\configs\evb-30\sys_config.fex ;---------------------------------------------------------------------------------- ;dcdc1_vol ---set dcdc1 voltage,mV,1600-3400,100mV/step ;dcdc2_vol ---set dcdc2 voltage,mV,600-1540,20mV/step ;dcdc3_vol ---set dcdc3 voltage,mV,600-1860,20mV/step ;dcdc4_vol ---set dcdc4 voltage,mV,600-1540,20mV/step ;dcdc5_vol ---set dcdc5 voltage,mV,1000-2550,50mV/step ;aldo2_vol ---set aldo2 voltage,mV,700-3300,100mV/step ;aldo3_vol ---set aldo3 voltage,mV,700-3300,100mV/step ;---------------------------------------------------------------------------------- [power_sply] dcdc1_vol = 3000 dcdc2_vol = 1100 dcdc3_vol = 1200 dcdc4_vol = 0 dcdc5_vol = 1500 aldo2_vol = 2500 aldo3_vol = 3000 dldo3_vol = 2800 ;gpio0_vol = 2800 ldoio0_vol = 2800 ;-------------------------------------------------------------------------------- ;vip (video input port) configuration ;vip_used: 0:disable 1:enable ;vip_mode: 0:sample one interface to one buffer 1:sample two interface to one buffer ;vip_dev_qty: The quantity of devices linked to capture bus ; ;vip_define_sensor_list: If you want use sensor detect function, please set vip_define_sensor_list = 1, and ; verify that file /system/etc/hawkview/sensor_list_cfg.ini is properly configured! ; ;vip_dev(x)_pos: sensor position, "rear" or "front", if vip_define_sensor_list = 1,vip_dev(x)_pos must be configured! ; ;vip_dev(x)_isp_used 0:not use isp 1:use isp ;vip_dev(x)_fmt: 0:yuv 1:bayer raw rgb ;vip_dev(x)_stby_mode: 0:not shut down power at standby 1:shut down power at standby ;vip_dev(x)_vflip: flip in vertical direction 0:disable 1:enable ;vip_dev(x)_hflip: flip in horizontal direction 0:disable 1:enable ;vip_dev(x)_iovdd: camera module io power handle string, pmu power supply ;vip_dev(x)_iovdd_vol: camera module io power voltage, pmu power supply ;vip_dev(x)_avdd: camera module analog power handle string, pmu power supply ;vip_dev(x)_avdd_vol: camera module analog power voltage, pmu power supply ;vip_dev(x)_dvdd: camera module core power handle string, pmu power supply ;vip_dev(x)_dvdd_vol: camera module core power voltage, pmu power supply ;vip_dev(x)_afvdd: camera module vcm power handle string, pmu power supply ;vip_dev(x)_afvdd_vol: camera module vcm power voltage, pmu power supply ;x indicates the index of the devices which are linked to the same capture bus ;fill voltage in uV, e.g. iovdd = 2.8V, vip_devx_iovdd_vol = 2800000 ;fill handle string as below: ;axp22_eldo3 ;axp22_dldo4 ;axp22_eldo2 ;fill handle string "" when not using any pmu power supply ;-------------------------------------------------------------------------------- [csi0] vip_used = 1 vip_mode = 0 vip_dev_qty = 1 vip_define_sensor_list = 0 vip_csi_pck = port:PE00 vip_csi_mck = port:PE01 vip_csi_hsync = port:PE02 vip_csi_vsync = port:PE03 vip_csi_d0 = port:PE04 vip_csi_d1 = port:PE05 vip_csi_d2 = port:PE06 vip_csi_d3 = port:PE07 vip_csi_d4 = port:PE08 vip_csi_d5 = port:PE09 vip_csi_d6 = port:PE10 vip_csi_d7 = port:PE11 vip_csi_sck = port:PE12 vip_csi_sda = port:PE13 ;vip_dev0_mname = "ov5640" vip_dev0_mname = "hm1375" ;vip_dev0_mname = "hm5065" vip_dev0_pos = "rear" vip_dev0_lane = 1 vip_dev0_twi_id = 2 ;vip_dev0_twi_addr = 0x78 vip_dev0_twi_addr = 0x48 ;vip_dev0_twi_addr = 0x3e vip_dev0_isp_used = 0 vip_dev0_fmt = 0 (在调试候请置0:) vip_dev0_stby_mode = 0 vip_dev0_vflip = 0 vip_dev0_hflip = 0 ;vip_dev0_iovdd = "axp22_dldo3" vip_dev0_iovdd = "" vip_dev0_iovdd_vol = 2800000 vip_dev0_avdd = "axp22_ldoio0" vip_dev0_avdd_vol = 2800000 vip_dev0_dvdd = "" vip_dev0_dvdd_vol = 1800000 vip_dev0_afvdd = "" vip_dev0_afvdd_vol = 2800000 vip_dev0_power_en = vip_dev0_reset = port:PE14 vip_dev0_pwdn = port:PE15 vip_dev0_flash_en = vip_dev0_flash_mode = vip_dev0_af_pwdn = power_start = 3

964

社区成员

发帖
与我相关
我的任务
社区描述
为开发者提供高通丰富的解决方案及全面技术下载内容。本版以AI人工智能、WoS 骁龙本、XR、IoT 物联网、Auto 汽车、生成式AI等核心板块组成,为开发者提供一个便捷及高效的学习交流平台。
人工智能物联网机器学习 企业社区 北京·东城区
社区管理员
  • csdnsqst0050
  • chipseeker
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧