@jonsen 了解了,谢谢您的回复。
kanken6174 发布的帖子
-
H616 需要 XPOWERS APX313A 吗?
大家好,
我一直在尝试实现自己的基于 H616 的模块,并且一直想知道 SOC 工作是否确实需要 APX313A PMIC,我可以使用多个“哑”DC-DC 来代替吗? 这个 PMIC 很难从中国以外的地方采购,所以如果我可以不用它,那将会有所帮助。 -
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@allspace123 不,我没有,我得到的只是黑屏和几条绿线,我放弃了并使用了 GC2053。 我也几乎放弃了 V851S 作为 mipi-csi 转 USB 平台,因为我无法让视频编码器工作,尽管社区已经以某种方式使其能够在 V851SE 上工作。 没有办法获得V851SE芯片,所以我的项目目前陷入困境。
您可以在此 github 页面上找到我对驱动程序的失败尝试。
https://github.com/Kanken6174/V851S-OV5647 -
回复: TinyVision 制作的高清 1080P USB 摄像头
@YuzukiTsuru 我无法让它在 V851S 上工作,你所说的 “替换 rootfs” 到底是什么意思?(我不小心错误地将这条消息发送到您的另一篇帖子,对此表示抱歉)
-
回复: V853/V851s 增加 OpenCV, FFmpeg 编译包
@YuzukiTsuru 我无法让它在 V851S 上工作,你所说的 “替换 rootfs” 到底是什么意思?
-
回复: TinyVision 制作的高清 1080P USB 摄像头
@bardi4567
repo init -u https://sdk.aw-ol.com/git_repo/V853Tina_Open/manifest.git -b master -m tina-v853-open.xml
然后
repo sync
非常适合我,要么您的存储库配置不正确,要么您有一些文件权限问题,无论哪种方式,您都应该为您的问题创建一个单独的主题,因为它与本主题(tinyvision 开发板)无关! -
回复: TinyVision 制作的高清 1080P USB 摄像头
@yuzukitsuru 您是说,如果我只是覆盖适用于 V851S 的 .img 文件的 squashfs 分区,它将与您提供的 V851SE 特定 iamge 文件一起使用? 因为我尝试过,它导致了内核恐慌...
[ 3.507007] sunxi-mmc sdc1: sdc set ios:clk 0Hz bm PP pm OFF vdd 0 width 1 timing LEGACY(SDR12) dt B [ 3.618963] remoteproc0: Direct firmware load for melis-elf failed with error -2 [ 3.629611] get det_vbus is fail, 84 [ 3.634517] get id is fail, 84 [ 3.639115] sunxi-rtc rtc: setting system clock to 1970-01-01 00:01:42 UTC (102) [ 3.648833] clk: Not disabling unused clocks [ 3.653760] ALSA device list: [ 3.657088] #0: audiocodec [ 3.660466] #1: snddaudio0 [ 3.670653] VFS: Mounted root (squashfs filesystem) readonly on device 179:4. [ 3.682504] devtmpfs: mounted [ 3.687970] Freeing unused kernel memory: 1024K [ 3.693329] will run init ... [ 3.696755] Kernel panic - not syncing: Requested init /init failed (error -2). [ 3.704937] CPU: 0 PID: 1 Comm: swapper Not tainted 4.9.191 #1 [ 3.711457] Hardware name: sun8iw21 [ 3.715390] [<c010d5a0>] (unwind_backtrace) from [<c010a694>] (show_stack+0x10/0x14) [ 3.724060] [<c010a694>] (show_stack) from [<c017050c>] (panic+0xac/0x2b8) [ 3.731758] [<c017050c>] (panic) from [<c0680854>] (kernel_init+0x98/0x118) [ 3.739553] [<c0680854>] (kernel_init) from [<c0106e08>] (ret_from_fork+0x14/0x2c) [ 3.748027] ---[ end Kernel panic - not syncing: Requested init /init failed (error -2). [ 3.757074] sunxi dump enabled [ 3.760484] dump regs done [ 3.763544] flush cache done [ 3.766782] crashdump enter
该映像是使用默认设置 (squashfs) 的 yuzukilizard BSP/openwrt 从默认的 V853 sdk 编译的(按原样使用时有效),我使用该命令来替换 rootfs squashfs:
sudo dd if=/dev/sdf4 of=/dev/sdi4 bs=4M conv=fsync
或者这不是您所说的“替换rootfs”的意思?
-
回复: TinyVision 制作的高清 1080P USB 摄像头
@yuzukitsuru 这是一块非常好的板,您认为这个版本的 SDK 可以适应在 V851S(非 SE)上以同样的方式工作吗?
-
回复: TinyVision 制作的高清 1080P USB 摄像头
@YuzukiTsuru 非常好的项目,这正是我一直在努力实现的目标,您使用的是 NDA 下的专有 sdk,而不是开源 tina linux sdk,不是吗? 否则你如何让视频编码器工作?
-
回复: V851S上的ISP真的坏了吗?
@awwwwa 感谢您的链接,这是一个有趣的解决方案,非常接近我想要实现的目标,我相信这使用了专有的闭源 tina-os,对吧? 但由于这只是一个磁盘映像而不是开源的,我无法真正使用它,特别是因为它是用于 V851SE 而不是 V851S...我想在芯片上实现我自己的驱动程序和图像处理方法,从什么 我知道这需要 NDA 下的专有 sdk...
-
回复: V851S上的ISP真的坏了吗?
@yuzukitsuru 是的,我确实看到了您在该项目上的努力,我感谢您,因为它将非常有用。 问题是我的项目围绕从 V851S 创建 USB 网络摄像头展开,为此我需要编码器才能工作,并且根据我的理解,我需要 tina 的闭源变体才能使 SOC 的这一部分工作。
我目前正在尝试让上述 SDK 工作,因为我现在拥有它,但创建图像时仍然存在一些错误,因此我仍然需要对其进行处理。
-
回复: V851S上的ISP真的坏了吗?
@baiwen
您收到电子邮件了吗? 我还没有收到你的回复我确实与 100ask 解决了这个问题,现在我正在尝试让其他 SDK 实际构建。 (希望我不必从百度云中提取它,因为我没有它的帐户)。 如果它最终适用于与我类似的未来案例,我将更新该帖子。 -
回复: 求教使用百问网v851s的sdk打包问题!
@whycanservice2
[ 4.808599] No filesystem could mount root, tried: ext3 ext2 ext4 squashfs vfat msdos
您是否使用至少一个支持的文件系统编译了内核? (“ Squashfs”仅读取,并且“ Ext4”是可以写的)。 您确定自己从正确的制作图像中闪烁了吗? 您使用什么工具来刷新微型SD?
从个人角度来看,我的工作流就是这样:
- 编译Tina Linux
- 使用
Pack -d
创建Intial Micro SD图像 - 使用Yuzukitsuru的Openixcard实用程序来创建可闪烁的图像,该图像可以在没有特殊工具的情况下闪烁到Micro SD卡
- 与Balena Etcher的闪光灯
我知道这对我有用。
-
回复: 求教使用百问网v851s的sdk打包问题!
@whycanservice2 请发送您使用的 pack 命令的日志,它可能会失败。 另请注意,您需要“pack -d”来打包供微型 SD 卡使用的映像。
-
回复: V851S上的ISP真的坏了吗?
@baiwen 我已发送电子邮件至support@100ask.net,主题是 "关于 yuzukilizard V851S tina OS 编码器的问题",它是通过我的outlook邮件发送的,所以地址与我的论坛名称不一样。
-
回复: V851S上的ISP真的坏了吗?
https://bbs.aw-ol.com/topic/4010/柚木pi蜥蜴-v851s-mpp-sample-rtsp-运行不了
https://forums.100ask.net/t/topic/3782
https://bbs.aw-ol.com/topic/3401/v853-rtsp-推流遇到问题很多人似乎都遇到了与我遇到的相同的编码器问题...看起来 SDK 的基本版本缺少一些组件,我将通过 100Ask 看看是否可以以某种方式解决这个问题...
-
回复: V851S上的ISP真的坏了吗?
@baiwen 鉴于板上存在 wifi 收发器并且也没有 CE 标记,这是有道理的...祝您获得认证好运,以便您可以恢复业务... 我会通过电子邮件与您联系.
-
回复: V851S上的ISP真的坏了吗?
我还运行了与编码器相关的各种示例,它们的失败方式与 uvcout 演示中完全相同。 遗憾的是,libcerdarX 驱动程序也与该 ISP 不兼容(很可能是因为它是社区的努力,所以太新了?),请参阅附加日志 venc 失败。
full_error_log.log
-
回复: V851S上的ISP真的坏了吗?
@xiaowenge 这是一家叫东山皮店的店,我的订单完成后他们就删除了所有的产品清单...
我已经给他们发了一条消息,我正在等待他们是否回复,但我不确定为什么像这样的速卖通供应商会向我提供 NDA 软件......但我仍然希望
https://dongshanpi.aliexpress.com/store/1100086087
-
回复: V851S上的ISP真的坏了吗?
@yuzukitsuru 感谢您的澄清,这让我节省了几周的时间...这是否也意味着在没有 NDA 下的软件的情况下根本没有机会让 USB uvcout 演示正常工作? 这就是我整个基于 V851S 的项目的重点......
-
V851S上的ISP真的坏了吗?
大家好,在尝试让 ISP (isp600) 在 V851S 上工作几周后,我发现它非常不稳定,并且大多数演示都无法工作。 有几篇文章提到了 ISP 问题,但关于 V851S 的文章很少,所以我想问是否有人知道这是否是预期的行为。
作为参考,我在这里使用的板是 @YuzukiTsuru 的 yukilizard,带有 GC2053 相机(可以使用)。
首先,这个isp似乎不能与tigerISP正常工作。 我注意到该软件及其文档没有提及 V851S(仅提及 V853 和较旧的芯片)。 当我使用 TigerISP 通过 ADB 连接到 yuzukilizard 板,并且 aw600 应用程序服务器正常启动时,应用程序成功连接到 adb 设备,然后连接到 AWISP 服务器。 但随后它根本无法加载配置,并且除了原始图像捕获之外,tigerisp 应用程序上没有任何功能。 所有黑白平衡、镜头校正、色彩校正甚至流媒体功能都被破坏。
然后,当使用 debug 参数启动“camerademo”示例时,当完成 ISP 相关测试时,我在示例的最后收到以下 ISP 错误:
camerademo NV21 1920 1088 30 bmp /home 5 debug ... various things ... (capture is successful here) [CAMERA_DEBUG] camera fps = 20.4. [CAMERA_DEBUG]*************************************************************** [ISP]save isp_ctx to /mnt/isp0_1920_1088_20_0_ctx_saved.bin success, data_len:24508!!! [CAMERA] close /dev/video0 ion_alloc_close pid: 866, release g_alloc_context = 0xb6d66fe0 [CAMERA_DEBUG]*************************************************************** [CAMERA_DEBUG] Performance Testing---format:NV21 size:1920 * 1088 [ 35.996775] [VIN_ERR]isp0 rdma fifo full [ 36.001174] [VIN_ERR]isp0 rdma fifo of d3d rec fifo overflow [ 36.007506] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 36.047255] [VIN_ERR]isp0 rdma fifo full [ 36.051643] [VIN_ERR]isp0 rdma fifo of d3d rec fifo overflow [ 36.057977] [VIN]__sunxi_isp_reset:isp0 reset!!!,ISP frame number is 0 [ 36.145517] [VIN]MULF_DONE come [ 36.196006] [VIN]MULF_DONE come [CAMERA_DEBUG] The interval from open to streaming is 703 ms. [CAMERA_DEBUG]***************************************************************
这是预期的行为吗?
当使用 RAW 格式(无 ISP)调用camerademo debug 时,不会发生这种情况,因此这是与 ISP 相关的异常。
[CAMERA_DEBUG]*************************************************************** [CAMERA_DEBUG] Performance Testing---format:GRBG10 size:1920 * 1088 [ 179.418663] [VIN]MULF_DONE come [ 179.422888] [VIN]MULF_DONE come [CAMERA_DEBUG] The interval from open to streaming is 465 ms. [CAMERA_DEBUG]***************************************************************
奇怪的是,在常规模式下使用camerademo 时,ISP 操作确实有效,因为很明显,图像在几帧后得到了改善。
最后,过去两周我一直在尝试使 uvcout usb 示例在该板上工作,但未能成功。 如随附的开发日志中所述,主机上的 uvcvideo 内核模块无法识别主板,直到重新加载内核(第一个烦恼)。 即使在那之后,如果我尝试使用“guvcview”启动视频流,V851S 也会在崩溃时给出 ISP MJPEG 相关错误和一堆转储日志。 这些都不起作用。 请参阅随附的视频。
Screencast from 08-01-2024 22:53:55.webm
另外,与 ISP 相关的示例似乎可以正常工作...所以请告诉我,这是该平台的已知问题吗? 我是在浪费时间吗? 我至少希望提供的样本能够工作,但现在他们真的没有......
devlog.md -
回复: V851S USB UVC uvcout 示例问题
这是 ISP 疯狂的一瞥,这是我首先调用camerademo,然后调用sample_uvcout的时候
Screencast from 08-01-2024 22:53:55.webm -
回复: V851S USB UVC uvcout 示例问题
我已经取得了一些进展,我已在此处附加了我的开发日志,流现在开始,但 ISP 完全崩溃了......?
devlog.md -
回复: V851S USB UVC uvcout 示例问题
在我的主机上重新加载 uvcvideo 内核模块后,成功找到了新的视频节点...串行日志中发生了很多事情,似乎板载 ISP 出现了一些问题,以及一些内存问题。
我可能会尝试删除 tmpfs 以获得完整的 64mb 内存可用。 日志附后。
isp.log -
V851S DVP DTS/.fex 设置
大家好,在我的基于 V851S 的主板上通过 MIPI-CSI 成功使用 GC2053 后,我尝试使用 OV5640(应该受支持,因为它有驱动程序)来验证 DVP 端口是否正常工作。
现在我的问题是 DVP 的文档非常混乱。 他们似乎暗示现在应该通过相应地修改 DTS 来设置 DVP,而不是旧的 .fex 格式。 问题在于,与 .fex 相比,DTS 缺少一些定义,例如如何指定 MLCK 引脚? PLCK 怎么样? 目前我的配置不会产生任何结果,因为 MLCK 引脚 (NCSI_MLCK) 似乎没有为相机提供时钟。
这是我当前的 DTS (如您所见,旧的 GC2053 定义现已禁用以避免出现问题):
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 = <1>; sensor0_hflip = <0>; sensor0_iovdd-supply = <>; sensor0_iovdd_vol = <1800000>; sensor0_avdd-supply = <>; sensor0_avdd_vol = <2800000>; sensor0_dvdd-supply = <>; sensor0_dvdd_vol = <1200000>; sensor0_power_en = <>; sensor0_reset = <&pio PA 8 1 0 1 0>; sensor0_pwdn = <&pio PA 9 1 0 1 0>; /*sensor0_sm_hs = <&pio PE 2 1 0 1 0>;*/ /*sensor0_sm_vs = <&pio PE 3 1 0 1 0>;*/ flash_handle = <&flash0>; act_handle = <&actuator0>; status = "disabled"; }; sensor1:sensor@1 { device_type = "sensor1"; sensor1_mname = "ov5640"; sensor1_twi_cci_id = <2>; sensor1_twi_addr = <0x78>; 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 = <>; sensor1_iovdd_vol = <1800000>; sensor1_avdd-supply = <>; sensor1_avdd_vol = <2800000>; sensor1_dvdd-supply = <>; sensor1_dvdd_vol = <1200000>; sensor1_power_en = <>; sensor1_reset = <&pio PD 8 1 0 1 0>; sensor1_pwdn = <>; sensor1_sm_hs = <&pio PE 2 1 0 1 0>; sensor1_sm_vs = <&pio PE 3 1 0 1 0>; flash_handle = <>; act_handle = <>; status = "okay"; };
这是我的引脚设置:
谁能确认我是否需要使用 DTS 或 .fex 才能使其正常工作? 如果是这样,我如何指定 NCSI_MLCK 和 PLCK 引脚?
-
V851S USB UVC uvcout 示例问题
大家好,我购买了 yukilizard 板(基于 V851S)作为我自己的开发板的基准,我正在尝试让 usb uvcout 演示正常工作,但我遇到了一些问题。
首先,GC2053 相机工作完美,我已经用camerademo 尝试过,并且确实得到了图像,所以问题不在于此。 我做了本自述文件要求的一切:
https://github.com/YuzukiHD/Yuzukilizard/tree/master/Software/sunxi-mpp/sample/sample_uvcout
我删除了 S50usb,配置了 USB uvc 小工具使用的内核,编译并复制了 sample_uvcout 演示到开发板上,并为其创建了一个配置:########### paramter (ref to tulip_cedarx.conf)############ [parameter] uvc_dev = 1 vin_dev = 0 #some encode parameters enc_bit_rate = 4194304 # 4M(4194304) 8M(8388608) for mjpeg and h264 cap_format = nv21 cap_width = 1920 cap_height = 1080 cap_frame_rate = 30 encoder_type = mjpeg enc_frame_quality = 1 enc_width = 1920 enc_height = 1080 enc_frame_rate = 30 use_eve = 0
然后,我运行 run_otg 脚本来配置 USB UVC,这似乎确实有点作用,因为 linux 确实报告了一个新的 USB UVC 设备,但系统也报告了 UVC 探测错误:
root@TinaLinux:/home# ./run_otg [ 38.452727] file system registered [ 38.466141] Mass Storage Function, version: 2009/09/11 [ 38.472108] LUN: removable file: (no medium) sh: write error: No such device rm: can't remove '/sys/kernel/config/usb_gadget/g1/configs/c.1/uvc.usb0': No such file or directory [ 38.513667] configfs-gadget gadget: uvc_function_bind root@TinaLinux:/home# [ 38.970716] sunxi_set_cur_vol_work()482 WARN: get power supply failed [ 39.052572] android_work: sent uevent USB_STATE=CONNECTED [ 39.058701] sunxi_set_cur_vol_work()482 WARN: get power supply failed [ 39.158319] configfs-gadget gadget: full-speed config #1: c [ 39.164561] configfs-gadget gadget: uvc_function_set_alt(0, 0) [ 39.171083] configfs-gadget gadget: reset UVC Control [ 39.176747] configfs-gadget gadget: uvc_function_set_alt(1, 0) [ 39.183344] android_work: sent uevent USB_STATE=CONFIGURED sh: write error: Resource busy [ 44.232236] handle_ep0: ep0 setup end [ 44.236363] configfs-gadget gadget: uvc_function_set_alt(1, 0) [ 49.348032] handle_ep0: ep0 setup end [ 54.467809] handle_ep0: ep0 setup end root@TinaLinux:/home#
但请注意,创建的节点并不是专门针对 UVC 的! 如果我运行 setusbconfig uvc 那么它确实会创建正确的节点:root@TinaLinux:/home# setusbconfig uvc sh: bulk: unknown operand [ 159.371427] configfs-gadget gadget: uvc_function_disable [ 159.377457] android_work: sent uevent USB_STATE=DISCONNECTED rm: can't remove '/sys/kernel/co[ 159.383997] configfs-gadget gadget: uvc_unbind nfig/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTriggerUsage': Operation not permitted[ 159.405418] android_work: did not send uevent (0 0 (null)) rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTriggerSupport': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bStillCaptureMethod': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTerminalLink': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bmInfo': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/class/fs': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/class/hs': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/class/fs': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/class/ss': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bFrameIndex': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwFrameInterval': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwDefaultFrameInterval': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxBitRate': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMinBitRate': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wHeight': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wWidth': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bmCapabilities': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmaControls': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmInterfaceFlags': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioY': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioX': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmFlags': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bDefaultFrameIndex': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bFrameIndex': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwFrameInterval': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwDefaultFrameInterval': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxBitRate': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMinBitRate': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wHeight': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wWidth': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bmCapabilities': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmaControls': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmInterfaceFlags': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioY': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioX': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb[ 159.826349] configfs-gadget gadget: uvc_function_bind 0/streaming/mjpeg/m/bmFlags': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bDefaultFrameIndex': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/uncompressed': Operation not permitted sh: bulk: unknown operand mkdir: can't create directory 'uvc.usb0': File exists root@TinaLinux:/home# [ 160.172555] sunxi_set_cur_vol_work()482 WARN: get power supply failed [ 160.250418] android_work: sent uevent USB_STATE=CONNECTED [ 160.256501] sunxi_set_cur_vol_work()482 WARN: get power supply failed [ 160.352246] configfs-gadget gadget: full-speed config #1: c [ 160.358501] configfs-gadget gadget: uvc_function_set_alt(0, 0) [ 160.365023] configfs-gadget gadget: reset UVC Control [ 160.root@TinaLinux:/home# setusbconfig uvc sh: bulk: unknown operand [ 159.371427] configfs-gadget gadget: uvc_function_disable [ 159.377457] android_work: sent uevent USB_STATE=DISCONNECTED rm: can't remove '/sys/kernel/co[ 159.383997] configfs-gadget gadget: uvc_unbind nfig/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTriggerUsage': Operation not permitted[ 159.405418] android_work: did not send uevent (0 0 (null)) rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTriggerSupport': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bStillCaptureMethod': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bTerminalLink': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/header/h/bmInfo': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/class/fs': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/class/hs': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/class/fs': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/control/class/ss': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bFrameIndex': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwFrameInterval': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwDefaultFrameInterval': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxBitRate': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMinBitRate': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wHeight': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wWidth': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bmCapabilities': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmaControls': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmInterfaceFlags': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioY': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioX': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmFlags': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bDefaultFrameIndex': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bFrameIndex': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwFrameInterval': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwDefaultFrameInterval': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMaxBitRate': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/dwMinBitRate': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wHeight': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/wWidth': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/720p/bmCapabilities': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmaControls': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bmInterfaceFlags': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioY': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bAspectRatioX': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb[ 159.826349] configfs-gadget gadget: uvc_function_bind 0/streaming/mjpeg/m/bmFlags': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/mjpeg/m/bDefaultFrameIndex': Operation not permitted rm: can't remove '/sys/kernel/config/usb_gadget/g1/functions/uvc.usb0/streaming/uncompressed': Operation not permitted sh: bulk: unknown operand mkdir: can't create directory 'uvc.usb0': File exists root@TinaLinux:/home# [ 160.172555] sunxi_set_cur_vol_work()482 WARN: get power supply failed [ 160.250418] android_work: sent uevent USB_STATE=CONNECTED [ 160.256501] sunxi_set_cur_vol_work()482 WARN: get power supply failed [ 160.352246] configfs-gadget gadget: full-speed config #1: c [ 160.358501] configfs-gadget gadget: uvc_function_set_alt(0, 0) [ 160.365023] configfs-gadget gadget: reset UVC Control [ 160.370690] configfs-gadget gadget: uvc_function_set_alt(1, 0) [ 160.377404] android_work: sent uevent USB_STATE=CONFIGURED [ 165.566125] handle_ep0: ep0 setup end [ 165.570253] configfs-gadget gadget: uvc_function_set_alt(1, 0) [ 170.685884] handle_ep0: ep0 setup end [ 175.805665] handle_ep0: ep0 setup end 370690] configfs-gadget gadget: uvc_function_set_alt(1, 0) [ 160.377404] android_work: sent uevent USB_STATE=CONFIGURED [ 165.566125] handle_ep0: ep0 setup end [ 165.570253] configfs-gadget gadget: uvc_function_set_alt(1, 0) [ 170.685884] handle_ep0: ep0 setup end [ 175.805665] handle_ep0: ep0 setup end root@TinaLinux:/home#
./sample_uvcout -path ./sample_uvcout.conf --width 1920 -- height 1080 --framerate 30 --device 0
此时,如果我尝试使用我的配置运行sample_uvcout,它可以工作,但客户端没有任何反应(PC 上没有创建视频节点)
root@TinaLinux:/home# ./sample_uvcout -path ./sample_uvcout.conf --width 1920 -- eight 1080 --framerate 30 --device 0WARNING: Logging before InitGoogleLogging() is written to STDERR I0101 02:01:55.038077 1402 dup2SeldomUsedFd.c:20] <dup2SeldomUsedFdInit> gFdLock init I0101 02:01:55.053476 1402 sample_uvcout.c:1616] <main> sample_uvcout running! I0101 02:01:55.059839 1402 sample_uvcout.c:1541] <ParseCmdLine> path is [./sample_uvcout.conf] I0101 02:01:55.060048 1402 sample_uvcout.c:1549] <ParseCmdLine> width is [1920] I0101 02:01:55.061297 1402 confparser.c:60] <createConfParser> load conf file ./sample_uvcout.conf ok! I0101 02:01:55.061518 1402 sample_uvcout.c:1501] <LoadSampleUVCConfig> UVCDev=1,CapDev=0,CapWidth=1920,CapHeight=0,CapFrmRate=30,EncBitRate=4194304, EncWidth=0,EncHeight=0,EncFrmRate=30,quality=99 I0101 02:01:55.061647 1402 sample_uvcout.c:108] <OpenUVCDevice> open uvc device[/dev/video1] I0101 02:01:55.061804 1402 sample_uvcout.c:119] <OpenUVCDevice> device is sunxi_usb_udc on bus gadget
知道这里可能出了什么问题吗?
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@zheng1 我确实没有正确的设置来调试芯片内的 Tiger ISP,但如果需要,我可以设置一个。 但现在校准颜色并不是我的主要问题,因为相机似乎仍然无法正常运行,看看这张捕获的“图像”:
我的大部分颜色是黑色,顶部有一点数据,该图像是使用 TigerISP 应用程序从 RAW 格式提取的。 我真的不确定这里可能出了什么问题,这不可能是曝光,因为我直接在相机上闪光,而没有对图像进行任何更改,并且由于数据是在单个 MIPI 通道上发送的,所以应该 不可能是时间问题吧?我将等待我的主板版本 2 修复 mipi 通道,看看这是否对官方驱动程序有帮助。 开发文档的常见问题解答并未涵盖这种特定情况,因此我现在只能尝试更改相机内的配置......
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
修复了翻转的通道并纠正了一些混乱的寄存器后,它起作用了! 最后! 感谢大家的帮助! 现在我必须正确设置 ISP 才能查看生成的 RAW 文件,但这已经是向前迈出的一大步了 ^^
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@spr2023 谢谢,我将阅读这篇文章,尝试看看他们做了什么不同的事情。 请注意,分辨率不是camerademo的问题,就好像640x480不可用一样,它将使用它可以使用的第一个分辨率,在我的例子中是1296x972,这是树莓派3运行这些相机的标准分辨率。 我使用的寄存器正是树莓派针对该特定分辨率发送的寄存器。 我尝试了许多不同的分辨率和寄存器配置,但总是出现相同的超时错误,我什至尝试使用主线 OV5647 驱动程序 (https://github.com/torvalds/linux/blob/master/drivers/media/i2c/ov5647.c) 中的寄存器和配置。
我的驱动程序的基础已经是 ov5648 驱动程序,只是修改了开机顺序(我的相机所需)和寄存器/配置。 -
回复: V851S tina linux ov5647 驱动程序没有 dmesg
我发现 allwinner 提供的文档之一在常见问题解答中提供了有关我所面临的确切问题的信息。 所以我现在会尝试按照其中的说明进行操作。 我似乎需要 mipi 寄存器偏移量才能正确调试,但他们不为 V851S 提供这些偏移量,只为其他芯片提供这些偏移量,而且我在芯片的数据表中没有找到它们,知道我可以从哪里获得它们吗?
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
这是执行camerademo后调试FS的输出,您可以在这里清楚地看到驱动程序处于MIPI模式但尚未接收到任何数据。:
root@TinaLinux:/# cat /sys/kernel/debug/mpp/vi ***************************************************** VIN hardware feature list: mcsi 2, ncsi 1, parser 3, isp 1, vipp 4, dma 4 CSI_VERSION: CSI300_200, ISP_VERSION: ISP600_100 CSI_CLK: 200000000, ISP_CLK: 24000000 ***************************************************** vi0: ov5647_mipi => mipi0 => csi0 => tdm_rx0 => isp0 => vipp0 input => hoff: 0, voff: 0, w: 1296, h: 972, fmt: GBRG10 output => width: 1296, height: 972, fmt: NV21 interface: MIPI, isp_mode: NORMAL, hflip: 0, vflip: 0 prs_in => x: 0, y: 0, hb: 0, hs: 0 bkbuf => cnt: 3 size: 1900544 rest: 3, work_mode: online tdmbuf => cnt: 0 size: 0, cmp_ratio: 0 ispbuf => cnt: 4 size: 1991680/15552/15552/15552, cmp_ratio: 1024 frame => cnt: 0, lost_cnt: 0, error_cnt: 0 internal => avg: 0(ms), max: 0(ms), min: 0(ms) ***************************************************** vi4: (null) => mipi0 => csi0 => tdm_rx0 => isp0 => vipp4 input => hoff: 0, voff: 0, w: 0, h: 0, fmt: NULL output => width: 0, height: 0, fmt: NULL interface: PARALLEL, isp_mode: NORMAL, hflip: 0, vflip: 0 prs_in => x: 0, y: 0, hb: 0, hs: 0 bkbuf => cnt: 0 size: 0 rest: 0, work_mode: online tdmbuf => cnt: 0 size: 0, cmp_ratio: 0 ispbuf => cnt: 4 size: 1991680/15552/15552/15552, cmp_ratio: 1024 frame => cnt: 0, lost_cnt: 0, error_cnt: 0 internal => avg: 0(ms), max: 0(ms), min: 0(ms) ***************************************************** vi8: (null) => mipi0 => csi0 => tdm_rx0 => isp0 => vipp8 input => hoff: 0, voff: 0, w: 0, h: 0, fmt: NULL output => width: 0, height: 0, fmt: NULL interface: PARALLEL, isp_mode: NORMAL, hflip: 0, vflip: 0 prs_in => x: 0, y: 0, hb: 0, hs: 0 bkbuf => cnt: 0 size: 0 rest: 0, work_mode: online tdmbuf => cnt: 0 size: 0, cmp_ratio: 0 ispbuf => cnt: 4 size: 1991680/15552/15552/15552, cmp_ratio: 1024 frame => cnt: 0, lost_cnt: 0, error_cnt: 0 internal => avg: 0(ms), max: 0(ms), min: 0(ms) ***************************************************** vi12: (null) => mipi0 => csi0 => tdm_rx0 => isp0 => vipp12 input => hoff: 0, voff: 0, w: 0, h: 0, fmt: NULL output => width: 0, height: 0, fmt: NULL interface: PARALLEL, isp_mode: NORMAL, hflip: 0, vflip: 0 prs_in => x: 0, y: 0, hb: 0, hs: 0 bkbuf => cnt: 0 size: 0 rest: 0, work_mode: online tdmbuf => cnt: 0 size: 0, cmp_ratio: 0 ispbuf => cnt: 4 size: 1991680/15552/15552/15552, cmp_ratio: 1024 frame => cnt: 0, lost_cnt: 0, error_cnt: 0 internal => avg: 0(ms), max: 0(ms), min: 0(ms) *****************************************************
并行节点未使用,仅 VI0 重要
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@awwwwa 我还尝试修改 IMX219 官方驱动程序以使用 2 通道模式,IMX219 确实支持该模式(因为它用于树莓派相机 V2,它使用两个通道)。
/* * A V4L2 driver for IMX219 Raw cameras. * * Copyright (c) 2017 by Allwinnertech Co., Ltd. http://www.allwinnertech.com * * Authors: Zhao Wei <zhaowei@allwinnertech.com> * Yang Feng <yangfeng@allwinnertech.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ //camerademo BGGR8 1280 720 30 bmp /tmp 5 #include <linux/init.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/i2c.h> #include <linux/delay.h> #include <linux/videodev2.h> #include <linux/clk.h> #include <media/v4l2-device.h> #include <media/v4l2-mediabus.h> #include <linux/io.h> #include "camera.h" #include "sensor_helper.h" MODULE_AUTHOR("Chomoly"); MODULE_DESCRIPTION("A low-level driver for IMX219 sensors"); MODULE_LICENSE("GPL"); #define MCLK (24*1000*1000) #define V4L2_IDENT_SENSOR 0x0219//0x0219 #define DEBUG_FS 1 /* * Our nominal (default) frame rate. */ #ifdef FPGA #define SENSOR_FRAME_RATE 15 #else #define SENSOR_FRAME_RATE 30 #endif /* * The IMX219 sits on i2c with ID 0x6c */ #define I2C_ADDR 0x20 #define SENSOR_NAME "imx219" int imx219_sensor_vts; #define ES_GAIN(a, b, c) ((unsigned short)(a * 160) < (c * 10) && (c*10) <= (unsigned short)(b * 160)) struct cfg_array { /* coming later */ struct regval_list *regs; int size; }; /* * The default register settings * */ static struct regval_list sensor_default_regs[] = { /*3280 x 2464_20fps 4lanes 720Mbps/lane */ {0x30EB, 0x05}, //manufacturer specific reg access sequence {0x30EB, 0x0C}, //manufacturer specific reg access sequence {0x300A, 0xFF}, //manufacturer specific reg access sequence {0x300B, 0xFF}, //manufacturer specific reg access sequence {0x30EB, 0x05}, //manufacturer specific reg access sequence {0x30EB, 0x09}, //manufacturer specific reg access sequence {0x0114, 0x01}, //two lane mode //03 quad {0x0128, 0x00}, //auto mipi timing {0x012A, 0x18}, //INCK frequency [MHz] default 0C {0x012B, 0x00}, //INCK frequency [MHz] {0x0160, 0x02}, //frame length lines (2*1lines) {0x0161, 0x00}, //frame length lines (0*3lines) {0x0162, 0x0D}, //line_length_plck in pixels (13) {0x0163, 0xE8}, //line_length_plck in pixels (232) 3560 {0x0164, 0x03}, //X-address of the top left corner of the visible pixel data Units: Pixels {0x0165, 0xE8}, //X-address of the top left corner of the visible pixel data Units: Pixels // 0x03E8 = 1000 {0x0166, 0x08}, //X-address of the bottom right corner of the visible pixel data Units: Pixels {0x0167, 0xE7}, //X-address of the bottom right corner of the visible pixel data Units: Pixels //0x08E7 = 2279 -1000 = 1279 {0x0168, 0x03}, //Y-address of the top left corner of the visible pixel data Units: Lines {0x0169, 0x68}, //Y-address of the top left corner of the visible pixel data Units: Lines //0x0368 = 872 {0x016A, 0x06}, //Y-address of the bottom right corner of the visible pixel data Units: Pixels {0x016B, 0x37}, //Y-address of the bottom right corner of the visible pixel data Units: Pixels : 0x0637 = 1591 - 872 = 719 // 1280*720 {0x016C, 0x05}, //output size x {0x016D, 0x00}, //output size x pixels {0x016E, 0x02}, //output size y {0x016F, 0xD0}, //output size y lines {0x0170, 0x01}, //x_odd_inc Increment for odd pixels 1, 3; turns 1279 into 1280 {0x0171, 0x01}, //y_odd_inc Increment for odd pixels 1, 3; turns 719 into 720 {0x0174, 0x00}, //no binning {0x0175, 0x00}, //no binning {0x018C, 0x0A}, //CSI-2 data format (0x0A default) {0x018D, 0x0A}, //CSI-2 data format (0x0A default) {0x0301, 0x05}, //Video Timing Pixel Clock Divider Value {0x0303, 0x01}, //Video Timing System Clock Divider Value {0x0304, 0x03}, //Pre PLL clock Video Timing System Divider value //camerademo RGGB8 1280 720 30 bmp /tmp 5 |vin is not support this pixelformat {0x0305, 0x03}, //Pre PLL clock Output System Divider Value {0x0306, 0x00}, //PLL Video Timing System multiplier Value {0x0307, 0x57}, //PLL Video Timing System multiplier Value {0x0309, 0x05 /*0A */ }, //Output Pixel Clock Divider Value (0A default) {0x030B, 0x01}, //Output System Clock Divider Value {0x030C, 0x00}, //PLL Output System multiplier Value {0x030D, 0x5A}, //PLL Output System multiplier Value //{0x4767, 0x0F}, //{0x4750, 0x14}, //{0x47B4, 0x14}, //unk {0x0100, 0x01}, //streaming mode on }; static struct regval_list sensor_hxga_regs[] = { {0x30EB, 0x05}, {0x30EB, 0x0C}, {0x300A, 0xFF}, {0x300B, 0xFF}, {0x30EB, 0x05}, {0x30EB, 0x09}, {0x0114, 0x01}, {0x0128, 0x00}, {0x012A, 0x18}, {0x012B, 0x00}, {0x0160, 0x0F}, {0x0161, 0xC5}, {0x0162, 0x0D}, {0x0163, 0x78}, {0x0164, 0x00}, {0x0165, 0x00}, {0x0166, 0x0C}, {0x0167, 0xCF}, {0x0168, 0x00}, {0x0169, 0x00}, {0x016A, 0x09}, {0x016B, 0x9F}, {0x016C, 0x0C}, {0x016D, 0xD0}, {0x016E, 0x09}, {0x016F, 0xA0}, {0x0170, 0x01}, {0x0171, 0x01}, {0x0174, 0x00}, {0x0175, 0x00}, {0x018C, 0x0A}, {0x018D, 0x0A}, {0x0301, 0x05}, {0x0303, 0x01}, {0x0304, 0x03}, {0x0305, 0x03}, {0x0306, 0x00}, {0x0307, 0x57}, {0x0309, 0x0A}, {0x030B, 0x01}, {0x030C, 0x00}, {0x030D, 0x5A}, {0x4767, 0x0F}, {0x4750, 0x14}, {0x47B4, 0x14}, {0x0100, 0x01}, }; static struct regval_list sensor_sxga_regs[] = { {0x30EB, 0x05}, {0x30EB, 0x0C}, {0x300A, 0xFF}, {0x300B, 0xFF}, {0x30EB, 0x05}, {0x30EB, 0x09}, {0x0114, 0x01}, {0x0128, 0x00}, {0x012A, 0x18}, {0x012B, 0x00}, {0x0160, 0x0a}, {0x0161, 0x2f}, {0x0162, 0x0d}, {0x0163, 0xe8}, {0x0164, 0x03}, {0x0165, 0xe8}, {0x0166, 0x08}, {0x0167, 0xe7}, {0x0168, 0x02}, {0x0169, 0xf0}, {0x016A, 0x06}, {0x016B, 0xaF}, {0x016C, 0x05}, {0x016D, 0x00}, {0x016E, 0x03}, {0x016F, 0xc0}, {0x0170, 0x01}, {0x0171, 0x01}, {0x0174, 0x00}, {0x0175, 0x00}, {0x018C, 0x0A}, {0x018D, 0x0A}, {0x0301, 0x05}, {0x0303, 0x01}, {0x0304, 0x03}, {0x0305, 0x03}, {0x0306, 0x00}, {0x0307, 0x57}, {0x0309, 0x0A}, {0x030B, 0x01}, {0x030C, 0x00}, {0x030D, 0x5A}, {0x4767, 0x0F}, {0x4750, 0x14}, {0x47B4, 0x14}, {0x0100, 0x01}, }; static struct regval_list sensor_1080p_regs[] = { {0x30EB, 0x05}, {0x30EB, 0x0C}, {0x300A, 0xFF}, {0x300B, 0xFF}, {0x30EB, 0x05}, {0x30EB, 0x09}, {0x0114, 0x01}, {0x0128, 0x00}, {0x012A, 0x18}, {0x012B, 0x00}, {0x0160, 0x0A}, {0x0161, 0x2F}, {0x0162, 0x0D}, {0x0163, 0xE8}, {0x0164, 0x02}, {0x0165, 0xA8}, {0x0166, 0x0A}, {0x0167, 0x27}, {0x0168, 0x02}, {0x0169, 0xB4}, {0x016A, 0x06}, {0x016B, 0xEB}, {0x016C, 0x07}, {0x016D, 0x80}, {0x016E, 0x04}, {0x016F, 0x38}, {0x0170, 0x01}, {0x0171, 0x01}, {0x0174, 0x00}, {0x0175, 0x00}, {0x018C, 0x0A}, {0x018D, 0x0A}, {0x0301, 0x05}, {0x0303, 0x01}, {0x0304, 0x03}, {0x0305, 0x03}, {0x0306, 0x00}, {0x0307, 0x57}, {0x0309, 0x0A}, {0x030B, 0x01}, {0x030C, 0x00}, {0x030D, 0x5A}, {0x4767, 0x0F}, {0x4750, 0x14}, {0x47B4, 0x14}, {0x0100, 0x01}, }; #define sensor_720p_regs sensor_default_regs //static struct regval_list* sensor_720p_regs = sensor_default_regs; /* * Here we'll try to encapsulate the changes for just the output * video format. * */ static struct regval_list sensor_fmt_raw[] = { }; static int sensor_s_exp_gain(struct v4l2_subdev *sd, struct sensor_exp_gain *exp_gain) { int exp_val, gain_val, frame_length, shutter; unsigned char explow = 0, exphigh = 0; struct sensor_info *info = to_state(sd); exp_val = exp_gain->exp_val; gain_val = exp_gain->gain_val; if (gain_val < 1 * 16) gain_val = 16; if (gain_val > 10 * 16 - 1) gain_val = 10 * 16 - 1; if (exp_val > 0xfffff) exp_val = 0xfffff; exp_val >>= 4; exphigh = (unsigned char)((0x00ff00 & exp_val) >> 8); explow = (unsigned char)((0x0000ff & exp_val)); sensor_write(sd, 0x015b, explow); sensor_write(sd, 0x015a, exphigh); shutter = exp_val; if (shutter > imx219_sensor_vts - 4) frame_length = shutter + 4; else frame_length = imx219_sensor_vts; sensor_write(sd, 0x0161, frame_length & 0xff); sensor_write(sd, 0x0160, frame_length >> 8); if (gain_val == 16) sensor_write(sd, 0x0157, 0x01); if (ES_GAIN(1.0, 1.1, gain_val)) sensor_write(sd, 0x0157, 24); else if (ES_GAIN(1.1, 1.2, gain_val)) sensor_write(sd, 0x0157, 42); else if (ES_GAIN(1.2, 1.3, gain_val)) sensor_write(sd, 0x0157, 60); else if (ES_GAIN(1.3, 1.4, gain_val)) sensor_write(sd, 0x0157, 73); else if (ES_GAIN(1.4, 1.5, gain_val)) sensor_write(sd, 0x0157, 85); else if (ES_GAIN(1.5, 1.6, gain_val)) sensor_write(sd, 0x0157, 96); else if (ES_GAIN(1.6, 1.7, gain_val)) sensor_write(sd, 0x0157, 105); else if (ES_GAIN(1.7, 1.8, gain_val)) sensor_write(sd, 0x0157, 114); else if (ES_GAIN(1.8, 1.9, gain_val)) sensor_write(sd, 0x0157, 122); else if (ES_GAIN(1.9, 2.0, gain_val)) sensor_write(sd, 0x0157, 0x80); else if (ES_GAIN(2.0, 2.1, gain_val)) sensor_write(sd, 0x0157, 134); else if (ES_GAIN(2.1, 2.2, gain_val)) sensor_write(sd, 0x0157, 140); else if (ES_GAIN(2.2, 2.3, gain_val)) sensor_write(sd, 0x0157, 145); else if (ES_GAIN(2.3, 2.4, gain_val)) sensor_write(sd, 0x0157, 150); else if (ES_GAIN(2.4, 2.5, gain_val)) sensor_write(sd, 0x0157, 154); else if (ES_GAIN(2.5, 2.6, gain_val)) sensor_write(sd, 0x0157, 158); else if (ES_GAIN(2.6, 2.7, gain_val)) sensor_write(sd, 0x0157, 162); else if (ES_GAIN(2.7, 2.8, gain_val)) sensor_write(sd, 0x0157, 165); else if (ES_GAIN(2.8, 2.9, gain_val)) sensor_write(sd, 0x0157, 168); else if (ES_GAIN(2.9, 3.0, gain_val)) sensor_write(sd, 0x0157, 0xab); else if (ES_GAIN(3.0, 3.1, gain_val)) sensor_write(sd, 0x0157, 174); else if (ES_GAIN(3.1, 3.2, gain_val)) sensor_write(sd, 0x0157, 176); else if (ES_GAIN(3.2, 3.3, gain_val)) sensor_write(sd, 0x0157, 179); else if (ES_GAIN(3.3, 3.4, gain_val)) sensor_write(sd, 0x0157, 181); else if (ES_GAIN(3.4, 3.5, gain_val)) sensor_write(sd, 0x0157, 183); else if (ES_GAIN(3.5, 3.6, gain_val)) sensor_write(sd, 0x0157, 185); else if (ES_GAIN(3.6, 3.7, gain_val)) sensor_write(sd, 0x0157, 187); else if (ES_GAIN(3.7, 3.8, gain_val)) sensor_write(sd, 0x0157, 189); else if (ES_GAIN(3.8, 3.9, gain_val)) sensor_write(sd, 0x0157, 191); else if (ES_GAIN(3.9, 4.0, gain_val)) sensor_write(sd, 0x0157, 192); else if (ES_GAIN(4.0, 4.1, gain_val)) sensor_write(sd, 0x0157, 194); else if (ES_GAIN(4.1, 4.2, gain_val)) sensor_write(sd, 0x0157, 195); else if (ES_GAIN(4.2, 4.3, gain_val)) sensor_write(sd, 0x0157, 197); else if (ES_GAIN(4.3, 4.4, gain_val)) sensor_write(sd, 0x0157, 198); else if (ES_GAIN(4.4, 4.5, gain_val)) sensor_write(sd, 0x0157, 200); else if (ES_GAIN(4.5, 4.6, gain_val)) sensor_write(sd, 0x0157, 201); else if (ES_GAIN(4.6, 4.7, gain_val)) sensor_write(sd, 0x0157, 202); else if (ES_GAIN(4.7, 4.8, gain_val)) sensor_write(sd, 0x0157, 203); else if (ES_GAIN(4.8, 4.9, gain_val)) sensor_write(sd, 0x0157, 204); else if (ES_GAIN(4.9, 5.0, gain_val)) sensor_write(sd, 0x0157, 205); else if (ES_GAIN(5.0, 5.1, gain_val)) sensor_write(sd, 0x0157, 206); else if (ES_GAIN(5.1, 5.2, gain_val)) sensor_write(sd, 0x0157, 207); else if (ES_GAIN(5.2, 5.3, gain_val)) sensor_write(sd, 0x0157, 208); else if (ES_GAIN(5.3, 5.4, gain_val)) sensor_write(sd, 0x0157, 209); else if (ES_GAIN(5.4, 5.5, gain_val)) sensor_write(sd, 0x0157, 210); else if (ES_GAIN(5.5, 5.7, gain_val)) sensor_write(sd, 0x0157, 211); else if (ES_GAIN(5.7, 5.8, gain_val)) sensor_write(sd, 0x0157, 212); else if (ES_GAIN(5.8, 5.9, gain_val)) sensor_write(sd, 0x0157, 213); else if (ES_GAIN(5.9, 6.2, gain_val)) sensor_write(sd, 0x0157, 215); else if (ES_GAIN(6.2, 6.4, gain_val)) sensor_write(sd, 0x0157, 216); else if (ES_GAIN(6.4, 6.5, gain_val)) sensor_write(sd, 0x0157, 217); else if (ES_GAIN(6.5, 6.7, gain_val)) sensor_write(sd, 0x0157, 218); else if (ES_GAIN(6.7, 6.9, gain_val)) sensor_write(sd, 0x0157, 219); else if (ES_GAIN(6.9, 7.1, gain_val)) sensor_write(sd, 0x0157, 220); else if (ES_GAIN(7.1, 7.3, gain_val)) sensor_write(sd, 0x0157, 221); else if (ES_GAIN(7.3, 7.5, gain_val)) sensor_write(sd, 0x0157, 222); else if (ES_GAIN(7.5, 7.7, gain_val)) sensor_write(sd, 0x0157, 223); else if (ES_GAIN(7.7, 8.0, gain_val)) sensor_write(sd, 0x0157, 224); else if (ES_GAIN(8.0, 8.3, gain_val)) sensor_write(sd, 0x0157, 225); else if (ES_GAIN(8.3, 8.5, gain_val)) sensor_write(sd, 0x0157, 226); else if (ES_GAIN(8.5, 8.8, gain_val)) sensor_write(sd, 0x0157, 227); else if (ES_GAIN(8.8, 9.1, gain_val)) sensor_write(sd, 0x0157, 228); else if (ES_GAIN(9.1, 9.4, gain_val)) sensor_write(sd, 0x0157, 228); else if (ES_GAIN(9.4, 9.8, gain_val)) sensor_write(sd, 0x0157, 230); else if (ES_GAIN(9.8, 10.2, gain_val)) sensor_write(sd, 0x0157, 231); else if (ES_GAIN(10.0, 10.6, gain_val)) sensor_write(sd, 0x0157, 232); info->exp = exp_val; info->gain = gain_val; return 0; } static int sensor_g_exp(struct v4l2_subdev *sd, __s32 *value) { struct sensor_info *info = to_state(sd); *value = info->exp; sensor_dbg("sensor_get_exposure = %d\n", info->exp); return 0; } static int sensor_s_exp(struct v4l2_subdev *sd, unsigned int exp_val) { unsigned char explow, exphigh; struct sensor_info *info = to_state(sd); if (exp_val > 0xfffff) exp_val = 0xfffff; exp_val >>= 4; exphigh = (unsigned char)((0x00ff00 & exp_val) >> 8); explow = (unsigned char)((0x0000ff & exp_val)); sensor_write(sd, 0x015b, explow); sensor_write(sd, 0x015a, exphigh); info->exp = exp_val; return 0; } static int sensor_g_gain(struct v4l2_subdev *sd, __s32 *value) { struct sensor_info *info = to_state(sd); *value = info->gain; sensor_dbg("sensor_get_gain = %d\n", info->gain); return 0; } static int sensor_s_gain(struct v4l2_subdev *sd, int gain_val) { struct sensor_info *info = to_state(sd); if (gain_val < 1 * 16) gain_val = 16; if (gain_val > 0x1ff) gain_val = 0x1ff; if (gain_val == 16) sensor_write(sd, 0x0157, 0x01); if (ES_GAIN(1.0, 1.1, gain_val)) sensor_write(sd, 0x0157, 24); else if (ES_GAIN(1.1, 1.2, gain_val)) sensor_write(sd, 0x0157, 42); else if (ES_GAIN(1.2, 1.3, gain_val)) sensor_write(sd, 0x0157, 60); else if (ES_GAIN(1.3, 1.4, gain_val)) sensor_write(sd, 0x0157, 73); else if (ES_GAIN(1.4, 1.5, gain_val)) sensor_write(sd, 0x0157, 85); else if (ES_GAIN(1.5, 1.6, gain_val)) sensor_write(sd, 0x0157, 96); else if (ES_GAIN(1.6, 1.7, gain_val)) sensor_write(sd, 0x0157, 105); else if (ES_GAIN(1.7, 1.8, gain_val)) sensor_write(sd, 0x0157, 114); else if (ES_GAIN(1.8, 1.9, gain_val)) sensor_write(sd, 0x0157, 122); else if (ES_GAIN(1.9, 2.0, gain_val)) sensor_write(sd, 0x0157, 0x80); else if (ES_GAIN(2.0, 2.1, gain_val)) sensor_write(sd, 0x0157, 134); else if (ES_GAIN(2.1, 2.2, gain_val)) sensor_write(sd, 0x0157, 140); else if (ES_GAIN(2.2, 2.3, gain_val)) sensor_write(sd, 0x0157, 145); else if (ES_GAIN(2.3, 2.4, gain_val)) sensor_write(sd, 0x0157, 150); else if (ES_GAIN(2.4, 2.5, gain_val)) sensor_write(sd, 0x0157, 154); else if (ES_GAIN(2.5, 2.6, gain_val)) sensor_write(sd, 0x0157, 158); else if (ES_GAIN(2.6, 2.7, gain_val)) sensor_write(sd, 0x0157, 162); else if (ES_GAIN(2.7, 2.8, gain_val)) sensor_write(sd, 0x0157, 165); else if (ES_GAIN(2.8, 2.9, gain_val)) sensor_write(sd, 0x0157, 168); else if (ES_GAIN(2.9, 3.0, gain_val)) sensor_write(sd, 0x0157, 0xab); else if (ES_GAIN(3.0, 3.1, gain_val)) sensor_write(sd, 0x0157, 174); else if (ES_GAIN(3.1, 3.2, gain_val)) sensor_write(sd, 0x0157, 176); else if (ES_GAIN(3.2, 3.3, gain_val)) sensor_write(sd, 0x0157, 179); else if (ES_GAIN(3.3, 3.4, gain_val)) sensor_write(sd, 0x0157, 181); else if (ES_GAIN(3.4, 3.5, gain_val)) sensor_write(sd, 0x0157, 183); else if (ES_GAIN(3.5, 3.6, gain_val)) sensor_write(sd, 0x0157, 185); else if (ES_GAIN(3.6, 3.7, gain_val)) sensor_write(sd, 0x0157, 187); else if (ES_GAIN(3.7, 3.8, gain_val)) sensor_write(sd, 0x0157, 189); else if (ES_GAIN(3.8, 3.9, gain_val)) sensor_write(sd, 0x0157, 191); else if (ES_GAIN(3.9, 4.0, gain_val)) sensor_write(sd, 0x0157, 192); else if (ES_GAIN(4.0, 4.1, gain_val)) sensor_write(sd, 0x0157, 194); else if (ES_GAIN(4.1, 4.2, gain_val)) sensor_write(sd, 0x0157, 195); else if (ES_GAIN(4.2, 4.3, gain_val)) sensor_write(sd, 0x0157, 197); else if (ES_GAIN(4.3, 4.4, gain_val)) sensor_write(sd, 0x0157, 198); else if (ES_GAIN(4.4, 4.5, gain_val)) sensor_write(sd, 0x0157, 200); else if (ES_GAIN(4.5, 4.6, gain_val)) sensor_write(sd, 0x0157, 201); else if (ES_GAIN(4.6, 4.7, gain_val)) sensor_write(sd, 0x0157, 202); else if (ES_GAIN(4.7, 4.8, gain_val)) sensor_write(sd, 0x0157, 203); else if (ES_GAIN(4.8, 4.9, gain_val)) sensor_write(sd, 0x0157, 204); else if (ES_GAIN(4.9, 5.0, gain_val)) sensor_write(sd, 0x0157, 205); else if (ES_GAIN(5.0, 5.1, gain_val)) sensor_write(sd, 0x0157, 206); else if (ES_GAIN(5.1, 5.2, gain_val)) sensor_write(sd, 0x0157, 207); else if (ES_GAIN(5.2, 5.3, gain_val)) sensor_write(sd, 0x0157, 208); else if (ES_GAIN(5.3, 5.4, gain_val)) sensor_write(sd, 0x0157, 209); else if (ES_GAIN(5.4, 5.5, gain_val)) sensor_write(sd, 0x0157, 210); else if (ES_GAIN(5.5, 5.7, gain_val)) sensor_write(sd, 0x0157, 211); else if (ES_GAIN(5.7, 5.8, gain_val)) sensor_write(sd, 0x0157, 212); else if (ES_GAIN(5.8, 5.9, gain_val)) sensor_write(sd, 0x0157, 213); else if (ES_GAIN(5.9, 6.2, gain_val)) sensor_write(sd, 0x0157, 215); else if (ES_GAIN(6.2, 6.4, gain_val)) sensor_write(sd, 0x0157, 216); else if (ES_GAIN(6.4, 6.5, gain_val)) sensor_write(sd, 0x0157, 217); else if (ES_GAIN(6.5, 6.7, gain_val)) sensor_write(sd, 0x0157, 218); else if (ES_GAIN(6.7, 6.9, gain_val)) sensor_write(sd, 0x0157, 219); else if (ES_GAIN(6.9, 7.1, gain_val)) sensor_write(sd, 0x0157, 220); else if (ES_GAIN(7.1, 7.3, gain_val)) sensor_write(sd, 0x0157, 221); else if (ES_GAIN(7.3, 7.5, gain_val)) sensor_write(sd, 0x0157, 222); else if (ES_GAIN(7.5, 7.7, gain_val)) sensor_write(sd, 0x0157, 223); else if (ES_GAIN(7.7, 8.0, gain_val)) sensor_write(sd, 0x0157, 224); else if (ES_GAIN(8.0, 8.3, gain_val)) sensor_write(sd, 0x0157, 225); else if (ES_GAIN(8.3, 8.5, gain_val)) sensor_write(sd, 0x0157, 226); else if (ES_GAIN(8.5, 8.8, gain_val)) sensor_write(sd, 0x0157, 227); else if (ES_GAIN(8.8, 9.1, gain_val)) sensor_write(sd, 0x0157, 228); else if (ES_GAIN(9.1, 9.4, gain_val)) sensor_write(sd, 0x0157, 228); else if (ES_GAIN(9.4, 9.8, gain_val)) sensor_write(sd, 0x0157, 230); else if (ES_GAIN(9.8, 10.2, gain_val)) sensor_write(sd, 0x0157, 231); else if (ES_GAIN(10.0, 10.6, gain_val)) sensor_write(sd, 0x0157, 232); info->gain = gain_val; return 0; } #if 0 static int sensor_s_sw_stby(struct v4l2_subdev *sd, int on_off) { int ret; data_type rdval; ret = sensor_read(sd, 0x0100, &rdval); if (ret != 0) return ret; if (on_off == CSI_GPIO_LOW) ret = sensor_write(sd, 0x0100, rdval & 0xfe); else ret = sensor_write(sd, 0x0100, rdval | 0x01); return ret; } #endif /* * Stuff that knows about the sensor. */ static int sensor_power(struct v4l2_subdev *sd, int on) { sensor_print("entering sensor_power\n"); sensor_dbg("zzz5648 sensor_power\n"); switch (on) { case STBY_ON: /*sensor_print("entering sensor_power STBY_ON\n"); sensor_print("STBY_ON!\n"); cci_lock(sd); sensor_s_sw_stby(sd, STBY_ON); usleep_range(1000, 1200); cci_unlock(sd);*/ break; case STBY_OFF: sensor_print("entering sensor_power STBY_OFF\n"); sensor_print("STBY_OFF!\n"); /*cci_lock(sd); usleep_range(1000, 1200); sensor_s_sw_stby(sd, STBY_OFF); cci_unlock(sd);*/ break; case PWR_ON: sensor_print("entering sensor_power PWR_ON, pins: %d %d\n",PWDN ,POWER_EN); gpio_direction_output(GPIOA(8), 0); //led enable gpio_direction_output(GPIOA(9), 0); //power enable sensor_print("PWR_ON!100\n"); cci_lock(sd); vin_gpio_set_status(sd, PWDN, 1); //vin_gpio_write(sd, RESET, CSI_GPIO_HIGH); //not needed for the rpi ov5647 modules vin_gpio_set_status(sd, POWER_EN, 1); vin_gpio_write(sd, PWDN, CSI_GPIO_HIGH); //special case, since PWDN is the led we power it ON //vin_gpio_write(sd, RESET, CSI_GPIO_LOW); //ignore reset vin_gpio_write(sd, POWER_EN, CSI_GPIO_HIGH); usleep_range(7000, 8000); vin_set_pmu_channel(sd, IOVDD, ON); usleep_range(7000, 8000); vin_set_pmu_channel(sd, AVDD, ON); vin_set_pmu_channel(sd, AFVDD, ON); usleep_range(7000, 8000); vin_set_pmu_channel(sd, DVDD, ON); usleep_range(7000, 8000); vin_set_mclk_freq(sd, MCLK); vin_set_mclk(sd, ON); usleep_range(10000, 12000); //vin_gpio_write(sd, RESET, CSI_GPIO_HIGH); //these calls are useless as well //vin_gpio_write(sd, PWDN, CSI_GPIO_HIGH); vin_set_pmu_channel(sd, CAMERAVDD, ON);/*AFVCC ON*/ usleep_range(10000, 12000); cci_unlock(sd); break; case PWR_OFF: /*sensor_print("PWR_OFF!\n"); cci_lock(sd); vin_gpio_write(sd, PWDN, CSI_GPIO_LOW); //LED off //vin_gpio_write(sd, RESET, CSI_GPIO_HIGH); vin_set_mclk(sd, OFF); usleep_range(7000, 8000); vin_set_pmu_channel(sd, DVDD, OFF); //vin_gpio_write(sd, PWDN, CSI_GPIO_LOW); //vin_gpio_write(sd, RESET, CSI_GPIO_LOW); vin_gpio_write(sd, POWER_EN, CSI_GPIO_LOW); //turn off power to the camera vin_set_pmu_channel(sd, AVDD, OFF); vin_set_pmu_channel(sd, IOVDD, OFF); vin_set_pmu_channel(sd, AFVDD, OFF); vin_set_pmu_channel(sd, CAMERAVDD, OFF);/*AFVCC ON*/ //cci_unlock(sd); break; default: return -EINVAL; } return 0; } static int sensor_reset(struct v4l2_subdev *sd, u32 val) { switch (val) { case 0: vin_gpio_write(sd, RESET, CSI_GPIO_HIGH); usleep_range(10000, 12000); break; case 1: vin_gpio_write(sd, RESET, CSI_GPIO_LOW); usleep_range(10000, 12000); break; default: return -EINVAL; } return 0; } static int sensor_detect(struct v4l2_subdev *sd) { data_type rdval, rdval2; unsigned int SENSOR_ID = 0; printk(KERN_WARNING "entering sensor_detect\n"); sensor_read(sd, 0x0000, &rdval); sensor_read(sd, 0x0001, &rdval2); SENSOR_ID = (rdval << 8) | rdval2; sensor_print("V4L2_IDENT_SENSOR = 0x%x\n", SENSOR_ID); if (SENSOR_ID != V4L2_IDENT_SENSOR) { sensor_print("imx219 %s error, chip found is not an target chip", __func__); printk(KERN_WARNING "exiting sensor_detect, not found\n"); //return -ENODEV; } printk(KERN_WARNING "exiting sensor_detect, found\n"); return 0; } static int sensor_init(struct v4l2_subdev *sd, u32 val) { int ret; sensor_power(sd, PWR_ON); //added struct sensor_info *info = to_state(sd); sensor_dbg("sensor_init\n"); sensor_power(sd, PWR_ON); //added /*Make sure it is a target sensor */ ret = sensor_detect(sd); if (ret) { sensor_err("chip found is not an target chip.\n"); return ret; } info->focus_status = 0; info->low_speed = 0; info->width = HXGA_WIDTH; info->height = HXGA_HEIGHT; info->hflip = 0; info->vflip = 0; info->gain = 0; info->tpf.numerator = 1; info->tpf.denominator = 10; /* 30fps */ info->preview_first_flag = 1; return 0; } static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { int ret = 0; struct sensor_info *info = to_state(sd); switch (cmd) { case GET_CURRENT_WIN_CFG: if (info->current_wins != NULL) { memcpy(arg, info->current_wins, sizeof(struct sensor_win_size)); ret = 0; } else { sensor_err("empty wins!\n"); ret = -1; } break; case SET_FPS: break; case VIDIOC_VIN_SENSOR_EXP_GAIN: sensor_s_exp_gain(sd, (struct sensor_exp_gain *)arg); break; case VIDIOC_VIN_SENSOR_CFG_REQ: sensor_cfg_req(sd, (struct sensor_config *)arg); break; default: return -EINVAL; } return ret; } /* * Store information about the video data format. */ static struct sensor_format_struct sensor_formats[] = { { .desc = "Raw RGB Bayer", .mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8,//MEDIA_BUS_FMT_SRGGB10_1X10, .regs = sensor_fmt_raw, .regs_size = ARRAY_SIZE(sensor_fmt_raw), .bpp = 1 } }; #define N_FMTS ARRAY_SIZE(sensor_formats) /* * Then there is the issue of window sizes. Try to capture the info here. */ static struct sensor_win_size sensor_win_sizes[] = { /* 3280*2464 */ /*{ .width = 3264, .height = 2448, .hoffset = (3280 - 3264) / 2, .voffset = (2464 - 2448) / 2, .hts = 3448, .vts = 4037, .pclk = (278 * 1000 * 1000), .mipi_bps = 720 * 1000 * 1000, .fps_fixed = 1, .bin_factor = 1, .intg_min = 1 << 4, .intg_max = (4037 - 4) << 4, .gain_min = 1 << 4, .gain_max = 10 << 4, .regs = sensor_hxga_regs, .regs_size = ARRAY_SIZE(sensor_hxga_regs), .set_size = NULL, },*/ /* 1080P */ /*{ .width = HD1080_WIDTH, .height = HD1080_HEIGHT, .hoffset = 0, .voffset = 0, .hts = 3560, .vts = 2607, .pclk = (278 * 1000 * 1000), .mipi_bps = 720 * 1000 * 1000, .fps_fixed = 1, .bin_factor = 2, .intg_min = 1 << 4, .intg_max = (2607 - 4) << 4, .gain_min = 1 << 4, .gain_max = 10 << 4, .regs = sensor_1080p_regs, .regs_size = ARRAY_SIZE(sensor_1080p_regs), .set_size = NULL, },*/ /* SXGA */ /*{ .width = SXGA_WIDTH, .height = SXGA_HEIGHT, .hoffset = 0, .voffset = 0, .hts = 3560, .vts = 2607, .pclk = (278 * 1000 * 1000), .mipi_bps = 720 * 1000 * 1000, .fps_fixed = 1, .bin_factor = 2, .intg_min = 1 << 4, .intg_max = 2607 << 4, .gain_min = 1 << 4, .gain_max = 10 << 4, .regs = sensor_sxga_regs, .regs_size = ARRAY_SIZE(sensor_sxga_regs), .set_size = NULL, },*/ /* 720p */ { .width = HD720_WIDTH, .height = HD720_HEIGHT, .hoffset = 0, .voffset = 0, .hts = 2560, .vts = 1303, .pclk = (200 * 1000 * 1000), .mipi_bps = 720 * 1000 * 1000, .fps_fixed = 1, .bin_factor = 2, .intg_min = 1 << 4, .intg_max = (1303 - 4) << 4, .gain_min = 1 << 4, .gain_max = 10 << 4, .regs = sensor_720p_regs, .regs_size = ARRAY_SIZE(sensor_720p_regs), .set_size = NULL, }, }; #define N_WIN_SIZES (ARRAY_SIZE(sensor_win_sizes)) static int sensor_reg_init(struct sensor_info *info) { int ret = 0; struct v4l2_subdev *sd = &info->sd; struct sensor_format_struct *sensor_fmt = info->fmt; struct sensor_win_size *wsize = info->current_wins; ret = sensor_write_array(sd, sensor_default_regs, ARRAY_SIZE(sensor_default_regs)); if (ret < 0) { sensor_err("write sensor_default_regs error\n"); return ret; } ret = sensor_read_array(sd, sensor_default_regs, ARRAY_SIZE(sensor_default_regs)); if (ret < 0) { sensor_err("read-back ov5647_640x480_10bpp error\n"); return ret; } sensor_write_array(sd, sensor_fmt->regs, sensor_fmt->regs_size); if (wsize->regs) sensor_write_array(sd, wsize->regs, wsize->regs_size); if (wsize->set_size) wsize->set_size(sd); info->width = wsize->width; info->height = wsize->height; imx219_sensor_vts = wsize->vts; sensor_print("s_fmt set width = %d, height = %d\n", wsize->width, wsize->height); return 0; } static int sensor_s_stream(struct v4l2_subdev *sd, int enable) { struct sensor_info *info = to_state(sd); sensor_print("%s on = %d, %d*%d %x\n", __func__, enable, info->current_wins->width, info->current_wins->height, info->fmt->mbus_code); if (!enable) return 0; return sensor_reg_init(info); } static int sensor_g_mbus_config(struct v4l2_subdev *sd, struct v4l2_mbus_config *cfg) { cfg->type = V4L2_MBUS_CSI2; cfg->flags = 0 | V4L2_MBUS_CSI2_2_LANE | V4L2_MBUS_CSI2_CHANNEL_0; return 0; } static int sensor_g_ctrl(struct v4l2_ctrl *ctrl) { struct sensor_info *info = container_of(ctrl->handler, struct sensor_info, handler); struct v4l2_subdev *sd = &info->sd; switch (ctrl->id) { case V4L2_CID_GAIN: return sensor_g_gain(sd, &ctrl->val); case V4L2_CID_EXPOSURE: return sensor_g_exp(sd, &ctrl->val); } return -EINVAL; } static int sensor_s_ctrl(struct v4l2_ctrl *ctrl) { struct sensor_info *info = container_of(ctrl->handler, struct sensor_info, handler); struct v4l2_subdev *sd = &info->sd; switch (ctrl->id) { case V4L2_CID_GAIN: return sensor_s_gain(sd, ctrl->val); case V4L2_CID_EXPOSURE: return sensor_s_exp(sd, ctrl->val); } return -EINVAL; } /* ----------------------------------------------------------------------- */ static const struct v4l2_ctrl_ops sensor_ctrl_ops = { .g_volatile_ctrl = sensor_g_ctrl, .s_ctrl = sensor_s_ctrl, }; static const struct v4l2_subdev_core_ops sensor_core_ops = { .reset = sensor_reset, .init = sensor_init, .s_power = sensor_power, .ioctl = sensor_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl32 = sensor_compat_ioctl32, #endif }; static const struct v4l2_subdev_video_ops sensor_video_ops = { .s_parm = sensor_s_parm, .g_parm = sensor_g_parm, .s_stream = sensor_s_stream, .g_mbus_config = sensor_g_mbus_config, }; static const struct v4l2_subdev_pad_ops sensor_pad_ops = { .enum_mbus_code = sensor_enum_mbus_code, .enum_frame_size = sensor_enum_frame_size, .get_fmt = sensor_get_fmt, .set_fmt = sensor_set_fmt, }; static const struct v4l2_subdev_ops sensor_ops = { .core = &sensor_core_ops, .video = &sensor_video_ops, .pad = &sensor_pad_ops, }; /* ----------------------------------------------------------------------- */ static struct cci_driver cci_drv = { .name = SENSOR_NAME, .addr_width = CCI_BITS_16, .data_width = CCI_BITS_8, }; static const struct v4l2_ctrl_config sensor_custom_ctrls[] = { { .ops = &sensor_ctrl_ops, .id = V4L2_CID_FRAME_RATE, .name = "frame rate", .type = V4L2_CTRL_TYPE_INTEGER, .min = 15, .max = 120, .step = 1, .def = 120, }, }; static int sensor_init_controls(struct v4l2_subdev *sd, const struct v4l2_ctrl_ops *ops) { struct sensor_info *info = to_state(sd); struct v4l2_ctrl_handler *handler = &info->handler; struct v4l2_ctrl *ctrl; int i; int ret = 0; v4l2_ctrl_handler_init(handler, 2 + ARRAY_SIZE(sensor_custom_ctrls)); ctrl = v4l2_ctrl_new_std(handler, ops, V4L2_CID_EXPOSURE, 0, 65536 * 16, 1, 0); if (ctrl != NULL) ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE; v4l2_ctrl_new_std(handler, ops, V4L2_CID_GAIN, 1 * 1600, 256 * 1600, 1, 1 * 1600); for (i = 0; i < ARRAY_SIZE(sensor_custom_ctrls); i++) v4l2_ctrl_new_custom(handler, &sensor_custom_ctrls[i], NULL); if (handler->error) { ret = handler->error; v4l2_ctrl_handler_free(handler); } sd->ctrl_handler = handler; return ret; } static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct v4l2_subdev *sd; struct sensor_info *info; info = kzalloc(sizeof(struct sensor_info), GFP_KERNEL); if (info == NULL) return -ENOMEM; sd = &info->sd; cci_dev_probe_helper(sd, client, &sensor_ops, &cci_drv); sensor_init_controls(sd, &sensor_ctrl_ops); mutex_init(&info->lock); info->fmt = &sensor_formats[0]; info->fmt_pt = &sensor_formats[0]; info->win_pt = &sensor_win_sizes[0]; info->fmt_num = N_FMTS; info->win_size_num = N_WIN_SIZES; info->sensor_field = V4L2_FIELD_NONE; info->af_first_flag = 1; return 0; } static int sensor_remove(struct i2c_client *client) { struct v4l2_subdev *sd; sd = cci_dev_remove_helper(client, &cci_drv); kfree(to_state(sd)); return 0; } static const struct i2c_device_id sensor_id[] = { {SENSOR_NAME, 0}, {} }; MODULE_DEVICE_TABLE(i2c, sensor_id); static struct i2c_driver sensor_driver = { .driver = { .owner = THIS_MODULE, .name = SENSOR_NAME, }, .probe = sensor_probe, .remove = sensor_remove, .id_table = sensor_id, }; static __init int init_sensor(void) { return cci_dev_init_helper(&sensor_driver); } static __exit void exit_sensor(void) { cci_dev_exit_helper(&sensor_driver); } module_init(init_sensor); module_exit(exit_sensor);
修改后的驱动程序的工作原理与我尝试过的其他所有操作相同,捕获帧超时。
root@TinaLinux:/# camerademo BGGR8 1280 720 30 bmp /tmp 5 [CAMERA]************************[ 193.743051] [imx219]entering sensor_power ********************************[ 193.749768] [imx219]entering sensor_power PWR_ON, pins: 1 0 ** [CAMERA]* [ 193.758780] [imx219]PWR_ON!100 * [CAMERA]* this is camera test. * [CAMERA]* [ 193.773171] [VIN_ERR]imx219 cannot find the match sensor_helper * [CAMERA]****************************************[ 193.790703] [VIN_ERR]imx219 cannot find the match sensor_helper ****************** [CAMERA]****[ 193.797641] [VIN_ERR]imx219 cannot find the match sensor_helper ****************************************************** [CAMERA] open /dev/video0! [CAMERA]****[ 193.814747] [VIN_ERR]imx219 cannot find the match sensor_helper ****************************************************** [CAMERA]********************************************************** [CAMERA] The path to data saving is /tmp. [CAMERA] The number of captured photos is 5. [CAMERA] save bmp format [ 193.842052] [VIN_ERR]imx219 cannot find the match sensor_helper [ 193.861353] [imx219]entering sensor_power [ 193.865910] [imx219]entering sensor_power PWR_ON, pins: 1 0 [ 193.872154] [imx219]PWR_ON!100 [ 193.883647] [VIN_ERR]imx219 cannot find the match sensor_helper [ 193.898305] [VIN_ERR]imx219 cannot find the match sensor_helper [ 193.904951] [VIN_ERR]imx219 cannot find the match sensor_helper [ 193.919592] [VIN_ERR]imx219 cannot find the match sensor_helper [ 193.946278] [VIN_ERR]imx219 cannot find the match sensor_helper [ 193.964736] entering sensor_detect [ 193.969158] [imx219]V4L2_IDENT_SENSOR = 0x219 [ 193.974040] exiting sensor_detect, found [ 193.979674] [VIN_ERR]vin is not support this pixelformat [ 193.985673] [VIN_ERR]sensor pixelformat is 3001 [ 193.990940] [VIN_ERR]vin is not support this pixelformat [ 193.996918] [VIN_ERR]sensor pixelformat is 3001 [ 194.002195] [VIN_ERR]vin is not support this pixelformat [ 194.008161] [VIN_ERR]sensor pixelformat is 3001 [ 194.013424] [VIN_ERR]vin is not support this pixelformat [ 194.019478] [VIN_ERR]sensor pixelformat is 3001 [ 194.024792] [VIN_ERR]vin is not support this pixelformat [ 194.030743] [VIN_ERR]sensor pixelformat is 3001 [ 194.036038] [VIN_ERR]vin is not support this pixelformat [ 194.041987] [VIN_ERR]sensor pixelformat is 3001 [ 194.047283] [VIN_ERR]vin is not support this pixelformat [ 194.053234] [VIN_ERR]sensor pixelformat is 3001 [ 194.058514] [VIN_ERR]vin is not support this pixelformat [ 194.064461] [VIN_ERR]sensor pixelformat is 3001 [ 194.069812] [VIN_ERR]vin is not support this pixelformat [ 194.075786] [VIN_ERR]sensor pixelformat is 3001 [ 194.081055] [VIN_ERR]vin is not support this pixelformat [ 194.087025] [VIN_ERR]sensor pixelformat is 3001 [ 194.092299] [VIN_ERR]vin is not support this pixelformat [ 194.098266] [VIN_ERR]sensor pixelformat is 3001 [ 194.103530] [VIN_ERR]vin is not support this pixelformat [ 194.109497] [VIN_ERR]sensor pixelformat is 3001 [CAMERA]********************************************************[ 194.118170] [imx219]sensor_s_stream on = 1, 1280*720 3001 ** [CAMERA] Using format parameters BGGR8. [CAMERA] camera pix[ 194.131226] [VIN_DEV_I2C_ERR]read from imx219 addr is 0x30eb, data is 0x0, but should be 0x5 elformat: BGGR8 [CAMERA] Resolu[ 194.141789] [VIN_DEV_I2C_ERR]read from imx219 addr is 0x30eb, data is 0x0, but should be 0xc tion size : 1280 * 720 [CAMERA][ 194.154018] [VIN_DEV_I2C]read from imx219 addr is 0x300a, data is 0xff The photo save path is /tmp. [[ 194.164104] [VIN_DEV_I2C]read from imx219 addr is 0x300b, data is 0xff CAMERA] The number of photos tak[ 194.174288] [VIN_DEV_I2C_ERR]read from imx219 addr is 0x30eb, data is 0x0, but should be 0x5 en is 5. [ 194.186439] [VIN_DEV_I2C_ERR]read from imx219 addr is 0x30eb, data is 0x0, but should be 0x9 pid: 883, g_alloc_context = 0xb[ 194.198671] [VIN_DEV_I2C]read from imx219 addr is 0x114, data is 0x1 6db3360 [CAMERA] Camera captur[ 194.208567] [VIN_DEV_I2C]read from imx219 addr is 0x128, data is 0x0 e framerate is 1/1 [CAMERA] VID[ 194.218526] [VIN_DEV_I2C]read from imx219 addr is 0x12a, data is 0x18 IOC_S_FMT succeed [CAMERA] fmt.[ 194.228466] [VIN_DEV_I2C]read from imx219 addr is 0x12b, data is 0x0 type = 9 [CAMERA] fmt.fmt.pix_m[ 194.238365] [VIN_DEV_I2C]read from imx219 addr is 0x160, data is 0x2 p.width = 1280 [CAMERA] fmt.fmt[ 194.248258] [VIN_DEV_I2C]read from imx219 addr is 0x161, data is 0x0 .pix_mp.height = 720 [CAMERA] f[ 194.258149] [VIN_DEV_I2C]read from imx219 addr is 0x162, data is 0xd mt.fmt.pix_mp.pixelformat = BGGR[ 194.268092] [VIN_DEV_I2C]read from imx219 addr is 0x163, data is 0xe8 8 [CAMERA] fmt.fmt.pix_mp.field[ 194.278044] [VIN_DEV_I2C]read from imx219 addr is 0x164, data is 0x3 = 1 [ 194.287929] [VIN_DEV_I2C]read from imx219 addr is 0x165, data is 0xe8 [ 194.295659] [VIN_DEV_I2C]read from imx219 addr is 0x166, data is 0x8 [ 194.303039] [VIN_DEV_I2C]read from imx219 addr is 0x167, data is 0xe7 [ 194.310529] [VIN_DEV_I2C]read from imx219 addr is 0x168, data is 0x3 [ 194.317967] [VIN_DEV_I2C]read from imx219 addr is 0x169, data is 0x68 [ 194.325461] [VIN_DEV_I2C]read from imx219 addr is 0x16a, data is 0x6 [ 194.332841] [VIN_DEV_I2C]read from imx219 addr is 0x16b, data is 0x37 [ 194.340333] [VIN_DEV_I2C]read from imx219 addr is 0x16c, data is 0x5 [ 194.347726] [VIN_DEV_I2C]read from imx219 addr is 0x16d, data is 0x0 [ 194.355113] [VIN_DEV_I2C]read from imx219 addr is 0x16e, data is 0x2 [ 194.362489] [VIN_DEV_I2C]read from imx219 addr is 0x16f, data is 0xd0 [ 194.370021] [VIN_DEV_I2C]read from imx219 addr is 0x170, data is 0x1 [ 194.377423] [VIN_DEV_I2C]read from imx219 addr is 0x171, data is 0x1 [ 194.384804] [VIN_DEV_I2C]read from imx219 addr is 0x174, data is 0x0 [ 194.392184] [VIN_DEV_I2C]read from imx219 addr is 0x175, data is 0x0 [ 194.399578] [VIN_DEV_I2C]read from imx219 addr is 0x18c, data is 0xa [ 194.406965] [VIN_DEV_I2C]read from imx219 addr is 0x18d, data is 0xa [ 194.414343] [VIN_DEV_I2C]read from imx219 addr is 0x301, data is 0x5 [ 194.421774] [VIN_DEV_I2C]read from imx219 addr is 0x303, data is 0x1 [ 194.429173] [VIN_DEV_I2C]read from imx219 addr is 0x304, data is 0x3 [ 194.436568] [VIN_DEV_I2C]read from imx219 addr is 0x305, data is 0x3 [ 194.443947] [VIN_DEV_I2C]read from imx219 addr is 0x306, data is 0x0 [ 194.451344] [VIN_DEV_I2C]read from imx219 addr is 0x307, data is 0x57 [ 194.458830] [VIN_DEV_I2C]read from imx219 addr is 0x309, data is 0x5 [ 194.466260] [VIN_DEV_I2C]read from imx219 addr is 0x30b, data is 0x1 [ 194.473640] [VIN_DEV_I2C]read from imx219 addr is 0x30c, data is 0x0 [ 194.481032] [VIN_DEV_I2C]read from imx219 addr is 0x30d, data is 0x5a [ 194.488574] [VIN_DEV_I2C]read from imx219 addr is 0x100, data is 0x1 [ 194.500109] [imx219]s_fmt set width = 1280, height = 720 [CAMERA] stream on succeed [CAMERA] camera0 capture num is [0] [CAMERA_ERR] camera0[ 196.509907] [imx219]sensor_s_stream on = 0, 1280*720 3001 select timeout,end capture thread! [CAMERA] Capture thread finish [CAMERA] close /dev/video0 [CAMERA_ERR] capture_photo return error root@TinaLinux:/#
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@awwwwa 我已经研究过 @YuzukiTsuru 制作的这个特定驱动程序,它存在一些问题:
- 未正确配置与 OV5647 的接口,V4L2_IDENT_SENSOR 不正确,因为它是 0x5648 而不是 0x5647,如果按原样使用,则永远不会检测到相机,因为在sensor_detect() 中进行了此检查:
#define V4L2_IDENT_SENSOR 0x5648
static int sensor_detect(struct v4l2_subdev *sd) { data_type rdval; unsigned int SENSOR_ID = 0; sensor_read(sd, 0x300A, &rdval); SENSOR_ID |= rdval; SENSOR_ID |= (rdval << 8); sensor_read(sd, 0x300B, &rdval); SENSOR_ID |= (rdval); sensor_print("V4L2_IDENT_SENSOR = 0x%x\n", SENSOR_ID); if (SENSOR_ID != V4L2_IDENT_SENSOR) { sensor_print("ov5648 %s error, chip found is not an target chip", __func__); //return -ENODEV; } return 0; }
- 驱动程序将其传感器报告为“ov5648_mipi”,如果您将相同的内容放入 DTS 中,这并不是什么大问题,但它仍然具有误导性。
#define SENSOR_NAME "ov5648_mipi"
一旦这些基本问题得到解决,驱动程序就会加载并创建 /dev/video 节点,就像我的驱动程序一样。 但我们最终在camerademo应用程序上遇到了完全相同的错误:
唯一的区别是由于缺少配置文件而导致 ISP 上出现一些错误行,但由于我们的错误与超时相关,因此它不应受到任何“像素格式”或 ISP 错误的影响。 因此,即使有了这个驱动程序,我们还是回到了原点。我想知道 MLCK 位于相机内部并且未连接到 V851S 是否会导致问题...
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
请注意,对于上一篇带有图片的文章,有 4 层,因此 mipi 信号通过完整的接地层路由,具有正确的阻抗
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@whycanservice 我完全遵循了 allwinner 提供的文档,我查看了您指出的指南以及专门关于 mipi-csi 的指南,我遵循了所需的所有步骤,甚至将逻辑分析仪连接到单独的树莓派 3 以通过 I2C 发送来收集它 数据来复制它,这至少应该在启用流的 mipi-csi 模式下生成一个配置,然后相应地配置驱动程序(分辨率、VTS/HTS...),但仍然超时并且主板未检测到任何内容。
static int sensor_g_mbus_config(struct v4l2_subdev *sd, struct v4l2_mbus_config *cfg) { cfg->type = V4L2_MBUS_CSI2; cfg->flags = 0 | V4L2_MBUS_CSI2_2_LANE | V4L2_MBUS_CSI2_CHANNEL_0 return 0; }
static struct sensor_win_size sensor_win_sizes[] = { { .width = 1296, //camerademo GBRG10 1296 972 15 bmp /tmp 5 .height = 972, .hoffset = 0, .voffset = 0, .hts = 1128, //Horizontal total size 1852 (unit pclk) .vts = 1200, //Vertical total size 0x1f8 (unit line) .pclk = 46.5*MHZ, .mipi_bps = 1296*972*10*30, .fps_fixed = 30, //fps = camera_clk /(hts * vts) .bin_factor = 1, .intg_min = 16, .intg_max = (1984-4)<<4, .gain_min = 1<<4, .gain_max = 64<<4, .regs = ov5647_rpi3, .regs_size = ARRAY_SIZE(ov5647_rpi3), .set_size = NULL, }, };
static struct regval_list ov5647_rpi3[] = { {0x3000, 0x0F}, {0x3001, 0xFF}, {0x3002, 0xE4}, {0x4800, 0x25}, {0x4202, 0x0F}, {0x300D, 0x01}, {0x0100, 0x00}, {0x0103, 0x01}, {0x3034, 0x1A}, {0x3035, 0x32}, {0x3036, 0x62}, {0x303C, 0x11}, {0x3106, 0xF5}, {0x3827, 0xEC}, {0x370C, 0x03}, {0x3612, 0x59}, {0x3618, 0x00}, {0x5000, 0x06}, //???? //0b01101100 001010000 000000100 010000010 // 6C 50 04 82 {0x5004, 0x82}, {0x5003, 0x08}, {0x5A00, 0x08}, {0x3000, 0x00}, {0x3001, 0x00}, {0x3002, 0x00}, {0x3016, 0x08}, {0x3017, 0xE0}, {0x3018, 0x44}, {0x301C, 0xF8}, {0x301D, 0xF0}, {0x3A18, 0x00}, {0x3A19, 0xF8}, {0x3C01, 0x80}, {0x3B07, 0x0C}, {0x3800, 0x00}, {0x3801, 0x00}, {0x3802, 0x00}, {0x3803, 0x00}, {0x3804, 0x0A}, {0x3805, 0x3F}, {0x3806, 0x07}, {0x3807, 0xA3}, {0x3808, 0x07}, {0x3809, 0xA3}, {0x380A, 0x03}, {0x380B, 0xCC}, {0x380C, 0x07}, {0x380D, 0x68}, {0x3811, 0x0C}, {0x3813, 0x06}, {0x3814, 0x31}, {0x3815, 0x31}, {0x3630, 0x2E}, {0x3632, 0xE2}, {0x3633, 0x23}, {0x3634, 0x44}, {0x3636, 0x06}, {0x3621, 0xE0}, {0x3600, 0x37}, {0x3704, 0xA0}, {0x3703, 0x5A}, {0x3715, 0x78}, {0x3717, 0x01}, {0x370B, 0x60}, {0x3705, 0x1A}, {0x3F05, 0x02}, {0x3F06, 0x10}, {0x3F01, 0x0A}, {0x3A08, 0x01}, {0x3A09, 0x28}, {0x3A0A, 0x00}, {0x3A0B, 0xF6}, {0x3A0D, 0x08}, {0x3A0E, 0x06}, {0x3A0F, 0x58}, {0x3A10, 0x50}, {0x3A1B, 0x58}, {0x3A1E, 0x50}, {0x3A11, 0x60}, {0x3A1F, 0x28}, {0x4001, 0x02}, {0x4004, 0x04}, {0x4000, 0x09}, {REG_DLY,70}, //wait 70ms {0x3500, 0x00}, //exposure {0x3501, 0x59}, {0x3502, 0x70}, {0x350A, 0x00}, //AGC {0x350B, 0x80}, {REG_DLY, 500}, {0x4800, 0x25}, {0x4202, 0x0F}, {0x300D, 0x01}, {0x3000, 0x00}, {0x3001, 0x00}, {0x3002, 0x00}, {0x0100, 0x00}, };
所有数据均正确读回
在 rpi 3 上,相机工作正常,因此相机没有任何问题。
我对 mipi 通道进行了连续性测试,所有通道都正确连接到处理器焊盘,因此没有焊接错误。 走线的阻抗应该足够好,能够像在 rpi 3 上一样工作,即使将飞线测试引线焊接到通道上也是如此。
我尝试了许多不同的配置、DTS、.fex、驱动程序的更改,无论我更改什么,我总是得到相同的结果。 对我来说,没有比这更好的调试方法了。 我已经订购了 yuzukilizard 板来尝试比较该板上的 mipi 信号并使用相机适配器测试我的代码,但这需要一些时间才能到达。
目前,我真的没有任何想法来使这个工作......如果我找不到这个驱动程序有什么问题,我可能会完全改变平台,因为对 V851S 的支持似乎非常有限。
MLCK 没有连接,因为 rpi 相机板上有一个内部时钟振荡器,并且它们的 MLCK 没有断开。
相机已正确开机并正确响应所有 i2c 命令。 -
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@j_biao 目前我还无法让它发挥作用,我仍然停留在与以前相同的位置。 我购买了一台高速逻辑分析仪来尝试看看 mipi 总线上发生了什么。
看起来 mipi 通道的行为根本不像 mipi 通道,这看起来像并行 csi 数据(如果有的话)(时钟通道应该是不同的,但它们不是?)...这很奇怪,因为我仔细检查了两次和三次 我的 i2c/CCI 配置和所有正确的配置应发送到 OV5647 以进入 mipi 模式,而不是并行 csi 模式。
我将尝试获取树莓派 3 来调试它如何设置相机并查看 I2C 和 MIPI 方面的任何差异。
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@alb702 我在驱动程序源代码和camerademo命令中尝试了许多不同的像素格式,但它总是最终无法实际工作并给出某种形式的错误。 除了 RGGB8 之外,相机不支持其他格式,当我使用 RGGB8 时,camerademo 会查询传感器的图像,这意味着它至少可以工作到那时。
然后等待帧返回超时,我仍在尝试理解原因,但显然存在相机配置方式或 allwinner 驱动程序期望如何接收帧的问题。如果这是图像格式的问题,我不会收到这种特定类型的错误:
-
V851S Tina 错误的 libAWIspApi 生成文件
当尝试编译 libAWIspApi 时,您可能会收到编译错误,make 抱怨“all”目标没有构建候选者,这是因为 libAWIspApi makefile 不正确(或者我认为是这样),而不是这样:
/tina-v853-open/openwrt/openwrt/package/subpackage/allwinner/vision/libAWIspApi/Makefileinclude $(TOPDIR)/rules.mk -include machinfo/$(LICHEE_IC)/build.mk PKG_NAME:=libAWIspApi PKG_VERSION:=1 PKG_RELEASE:=1 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) include $(INCLUDE_DIR)/package.mk define Package/$(PKG_NAME) SUBMENU:=Vision SECTION:=allwinner CATEGORY:=Allwinner TITLE:=camera VIN ISP api for Allwinner endef define Package/$(PKG_NAME)/description camera VIN ISP api for allwinner endef define Build/Prepare $(INSTALL_DIR) $(PKG_BUILD_DIR)/src $(CP) ./src/$(ISP_DIR)/* $(PKG_BUILD_DIR)/src endef define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR)/src\ ARCH="$(TARGET_ARCH)" \ AR="$(TARGET_AR)" \ CC="$(TARGET_CC)" \ CXX="$(TARGET_CXX)" \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ C_LIB_TYPE="$(CONFIG_LIBC)$(if $(CONFIG_EXT_TOOLCHAIN_GCC_8_3_0),-gcc8_3_0)" \ CPU_VARIANT="$(TARGET_CPU_VARIANT)$(if $(CONFIG_COMPLILE_KERNEL64_USER32),-user-32bit)" \ all endef define Build/InstallDev $(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ endef define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/usr/lib/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ endef $(eval $(call BuildPackage,$(PKG_NAME)))
它应该是这样的:
include $(TOPDIR)/rules.mk -include machinfo/$(LICHEE_IC)/build.mk PKG_NAME:=libAWIspApi PKG_VERSION:=1 PKG_RELEASE:=1 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) include $(INCLUDE_DIR)/package.mk define Package/$(PKG_NAME) SUBMENU:=Vision SECTION:=allwinner CATEGORY:=Allwinner TITLE:=camera VIN ISP api for Allwinner endef define Package/$(PKG_NAME)/description camera VIN ISP api for allwinner endef define Build/Prepare $(INSTALL_DIR) $(PKG_BUILD_DIR)/src/isp600 $(CP) ./src/isp600/$(ISP_DIR)/* $(PKG_BUILD_DIR)/src/isp600 endef define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR)/src/isp600\ ARCH="$(TARGET_ARCH)" \ AR="$(TARGET_AR)" \ CC="$(TARGET_CC)" \ CXX="$(TARGET_CXX)" \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ C_LIB_TYPE="$(CONFIG_LIBC)$(if $(CONFIG_EXT_TOOLCHAIN_GCC_8_3_0),-gcc8_3_0)" \ CPU_VARIANT="$(TARGET_CPU_VARIANT)$(if $(CONFIG_COMPLILE_KERNEL64_USER32),-user-32bit)" \ all endef define Build/InstallDev $(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ endef define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/usr/lib/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/ endef $(eval $(call BuildPackage,$(PKG_NAME)))
这对我有用。
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
我已经购买了树莓派相机模块 V2 (IMX219),我尝试使用提供的驱动程序模块,很明显它无法像现在一样工作。 我必须将通道设置更改为 2 通道和相应的寄存器,因为驱动程序默认配置为 4 通道 mipi csi 操作。
经过几次测试后,我遇到了同样的问题,camerademo 超时并且不保存任何帧。 正如您在日志中看到的那样,I2C 配置已完美发送,它与我发送的配置匹配,寄存器有意义,数据格式应为 RGB8 位。
root@TinaLinux:/# camerademo RGGB8 1280 720 30 bmp /tmp 5 [CAMERA]************************[ 106.325471] [imx219]entering sensor_power ********************************[ 106.332158] [imx219]entering sensor_power PWR_ON, pins: 1 0 ** [CAMERA]* [ 106.341204] [imx219]PWR_ON!100 * [CAMERA]* this is camera test. [ 106.355469] [VIN_ERR]imx219 cannot find the match sensor_helper * [CAMERA]* * [CAMERA]********[ 106.370358] [VIN_ERR]imx219 cannot find the match sensor_helper ********************************[ 106.377305] [VIN_ERR]imx219 cannot find the match sensor_helper ****************** [CAMERA]********************************************************** [CAMERA][ 106.394725] [VIN_ERR]imx219 cannot find the match sensor_helper open /dev/video0! [CAMERA]********************************************************** [CAMERA]********************************************************** [CAMERA] The path to data saving is /tmp. [CAMERA] The number of captured photos is 5. [CAMERA] sa[ 106.421709] [VIN_ERR]imx219 cannot find the match sensor_helper ve bmp format [ 106.442489] [imx219]entering sensor_power [ 106.446997] [imx219]entering sensor_power PWR_ON, pins: 1 0 [ 106.453243] [imx219]PWR_ON!100 [ 106.464759] [VIN_ERR]imx219 cannot find the match sensor_helper [ 106.479407] [VIN_ERR]imx219 cannot find the match sensor_helper [ 106.486050] [VIN_ERR]imx219 cannot find the match sensor_helper [ 106.500689] [VIN_ERR]imx219 cannot find the match sensor_helper [ 106.526778] [VIN_ERR]imx219 cannot find the match sensor_helper [ 106.546028] [imx219]IMX219 found: 0x19 [ 106.550783] [VIN_ERR]vin is not support this pixelformat [ 106.556950] [VIN_ERR]vin is not support this pixelformat [ 106.563035] [VIN_ERR]vin is not support this pixelformat [ 106.569236] [VIN_ERR]vin is not support this pixelformat [ 106.575351] [VIN_ERR]vin is not support this pixelformat [ 106.581437] [VIN_ERR]vin is not support this pixelformat [ 106.587540] [VIN_ERR]vin is not support this pixelformat [ 106.593920] [VIN_ERR]vin is not support this pixelformat [ 106.600029] [VIN_ERR]vin is not support this pixelformat [ 106.606125] [VIN_ERR]vin is not support this pixelformat [ 106.612205] [VIN_ERR]vin is not support this pixelformat [ 106.618370] [VIN_ERR]vin is not support this pixelformat [ 106.624458] [VIN_ERR]vin is not support this pixelformat [ 106.630563] [VIN_ERR]vin is not support this pixelformat [ 106.636660] [VIN_ERR]vin is not support this pixelformat [ 106.642741] [VIN_ERR]vin is not support this pixelformat [ 106.648841] [VIN_ERR]vin is not support this pixelformat [ 106.654949] [VIN_ERR]vin is not support this pixelformat [ 106.661031] [VIN_ERR]vin is not support this pixelformat [CAMERA]********************************************************[ 106.670585] [imx219]sensor_s_stream on = 1, 1280*720 31384142 ** [CAMERA] Using format parameters RGGB8. [CAMERA] camera pix[ 106.684056] [VIN_DEV_I2C]read from imx219 addr is 0x30eb, data is 0x0 elformat: RGGB8 [CAMERA] Resolu[ 106.692344] [VIN_DEV_I2C]read from imx219 addr is 0x30eb, data is 0x0 tion size : 1280 * 720 [CAMERA][ 106.702334] [VIN_DEV_I2C]read from imx219 addr is 0x300a, data is 0xff The photo save path is /tmp. [[ 106.712417] [VIN_DEV_I2C]read from imx219 addr is 0x300b, data is 0xff CAMERA] The number of photos tak[ 106.722584] [VIN_DEV_I2C]read from imx219 addr is 0x30eb, data is 0x0 en is 5. [ 106.732510] [VIN_DEV_I2C]read from imx219 addr is 0x30eb, data is 0x0 pid: 863, g_alloc_context = 0x2[ 106.742495] [VIN_DEV_I2C]read from imx219 addr is 0x114, data is 0x1 ecd0 [CAMERA] Camera capture f[ 106.752394] [VIN_DEV_I2C]read from imx219 addr is 0x128, data is 0x0 ramerate is 1/1 [CAMERA] VIDIOC[ 106.762271] [VIN_DEV_I2C]read from imx219 addr is 0x12a, data is 0x18 _S_FMT succeed [CAMERA] fmt.typ[ 106.772314] [VIN_DEV_I2C]read from imx219 addr is 0x12b, data is 0x0 e = 9 [CAMERA] fmt.fmt.pix_mp.w[ 106.782168] [VIN_DEV_I2C]read from imx219 addr is 0x160, data is 0x2 idth = 1280 [CAMERA] fmt.fmt.pi[ 106.792056] [VIN_DEV_I2C]read from imx219 addr is 0x161, data is 0x0 x_mp.height = 720 [CAMERA] fmt.[ 106.801948] [VIN_DEV_I2C]read from imx219 addr is 0x162, data is 0xd fmt.pix_mp.pixelformat = RGGB8 [ 106.811838] [VIN_DEV_I2C]read from imx219 addr is 0x163, data is 0xe8 [CAMERA] fmt.fmt.pix_mp.field = [ 106.821877] [VIN_DEV_I2C]read from imx219 addr is 0x164, data is 0x3 1 [ 106.831726] [VIN_DEV_I2C]read from imx219 addr is 0x165, data is 0xe8 [ 106.839218] [VIN_DEV_I2C]read from imx219 addr is 0x166, data is 0x8 [ 106.846610] [VIN_DEV_I2C]read from imx219 addr is 0x167, data is 0xe7 [ 106.854086] [VIN_DEV_I2C]read from imx219 addr is 0x168, data is 0x3 [ 106.861477] [VIN_DEV_I2C]read from imx219 addr is 0x169, data is 0x68 [ 106.869015] [VIN_DEV_I2C]read from imx219 addr is 0x16a, data is 0x6 [ 106.876410] [VIN_DEV_I2C]read from imx219 addr is 0x16b, data is 0x37 [ 106.883888] [VIN_DEV_I2C]read from imx219 addr is 0x16c, data is 0x5 [ 106.891284] [VIN_DEV_I2C]read from imx219 addr is 0x16d, data is 0x0 [ 106.898679] [VIN_DEV_I2C]read from imx219 addr is 0x16e, data is 0x2 [ 106.906067] [VIN_DEV_I2C]read from imx219 addr is 0x16f, data is 0xd0 [ 106.913540] [VIN_DEV_I2C]read from imx219 addr is 0x170, data is 0x1 [ 106.920972] [VIN_DEV_I2C]read from imx219 addr is 0x171, data is 0x1 [ 106.928369] [VIN_DEV_I2C]read from imx219 addr is 0x174, data is 0x0 [ 106.935760] [VIN_DEV_I2C]read from imx219 addr is 0x175, data is 0x0 [ 106.943138] [VIN_DEV_I2C]read from imx219 addr is 0x18c, data is 0xa [ 106.950531] [VIN_DEV_I2C]read from imx219 addr is 0x18d, data is 0xa [ 106.957922] [VIN_DEV_I2C]read from imx219 addr is 0x301, data is 0x5 [ 106.965353] [VIN_DEV_I2C]read from imx219 addr is 0x303, data is 0x1 [ 106.972733] [VIN_DEV_I2C]read from imx219 addr is 0x304, data is 0x3 [ 106.980134] [VIN_DEV_I2C]read from imx219 addr is 0x305, data is 0x3 [ 106.987531] [VIN_DEV_I2C]read from imx219 addr is 0x306, data is 0x0 [ 106.994916] [VIN_DEV_I2C]read from imx219 addr is 0x307, data is 0x57 [ 107.002397] [VIN_DEV_I2C]read from imx219 addr is 0x309, data is 0x5 [ 107.009786] [VIN_DEV_I2C]read from imx219 addr is 0x30b, data is 0x1 [ 107.017220] [VIN_DEV_I2C]read from imx219 addr is 0x30c, data is 0x0 [ 107.024601] [VIN_DEV_I2C]read from imx219 addr is 0x30d, data is 0x5a [ 107.032102] [VIN_DEV_I2C]read from imx219 addr is 0x100, data is 0x1 [ 107.043636] [imx219]s_fmt set width = 1280, height = 720 [CAMERA] stream on succeed [CAMERA] camera0 capture num is [0] [CAMERA_ERR] camera0[ 109.053436] [imx219]sensor_s_stream on = 0, 1280*720 31384142 select timeout,end capture thread! [CAMERA] Capture thread finish [CAMERA] close /dev/video0 [CAMERA_ERR] capture_photo return error root@TinaLinux:/#
目前,要么是我的内核配置有问题,要么是我的 mipi 线路上的主板出现硬件问题……但这两者似乎都不明显,对于如此低的数据速率,我的路由应该“足够好”。
这些“VIN 格式不支持”错误也很奇怪,因为我似乎使用了正确的格式。
我附上了我的IMX219.C驱动程序的修改版本,如果有人想看一下,我现在唯一尝试支持的设置是720P。
imx219.c
ov5647_mipi.c我还附上了主板的完整启动日志,有很多启动错误,但我怀疑它们实际上与当前问题有关,因为所有必需的模块都已加载。
也许有人能够发现我错过的明显的东西......
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@yuzukitsuru 感谢该驱动程序,但我之前已经尝试过但没有成功,它有很多问题(如果您在本文中引用 ov5647_mipi.c 驱动程序),例如:
- 设备ID和传感器名称错误:
#define SENSOR_NAME "ov5648_mipi" #define V4L2_IDENT_SENSOR 0x5648
应该
#define SENSOR_NAME "ov5647_mipi" #define V4L2_IDENT_SENSOR 0x5647
- 读取CHIP_ID的方式也是错误的,导致读取的是0x5657而不是0x5647
sensor_read(sd, 0x300A, &rdval); SENSOR_ID |= rdval; SENSOR_ID |= (rdval << 8); sensor_read(sd, 0x300B, &rdval); SENSOR_ID |= (rdval); sensor_print("V4L2_IDENT_SENSOR = 0x%x\n", SENSOR_ID);
应该
data_type rdval, rdval2; unsigned int SENSOR_ID = 0; printk(KERN_WARNING "entering sensor_detect\n"); sensor_read(sd, CHIP_ID_ADDR, &rdval); sensor_read(sd, CHIP_ID_ADDR_L, &rdval2); SENSOR_ID = (rdval << 8) | rdval2; sensor_print("V4L2_IDENT_SENSOR = 0x%x\n", SENSOR_ID);
- 检测时似乎根本没有给相机加电,所以它永远找不到它(我必须在 INIT 函数中添加对传感器电源的调用才能检测到我的)
static int sensor_init(struct v4l2_subdev *sd, u32 val) { int ret = 0; struct sensor_info *info = to_state(sd); printk(KERN_WARNING "entering sensor_init\n"); sensor_print("sensor_init\n"); sensor_power(sd, PWR_ON); //added
总体而言,这个驱动程序似乎是基于 OV5648.c 的,该驱动程序已经存在所有这些问题,您是否真的让它在某个时刻与 OV5647 一起工作,或者它只是一个草案?
-
回复: V851S I2C/TWI 损坏(xfer 错误)
@alb702 这个问题已经解决了,我只需要使用足够低的上拉电阻,并将DTS中I2C引脚的驱动强度设置为1,就可以正常工作了。 我的主要问题是驱动强度设置
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@awwwwa 我知道 OV5647 不支持开箱即用,我想通过修改内核中已有的 OV5648 驱动程序来为其制作一个驱动程序。 我在驱动程序中仔细设置了 I2C 上每个必需的寄存器,其方式类似于 linux 内核 6.1 驱动程序处理它的方式(因为 linux 6.1 内置了 0V5647 驱动程序)。
我按照 allwinner 提供的在 tina-linux 下移植相机的指南进行操作,我的驱动程序成功加载、发送相机配置并正确报告。 mipi-csi 时钟和数据通道上也有活动(但它们太快了,我无法正确调试),这表明相机确实对其新配置做出了反应。
现在我当然可以选择支持更好的 GC 相机,但这不是目标,我正在尝试在这个平台上支持 rapsberry pi 1.3 相机。 我这样做是因为许多廉价模块都采用这种 15 针外形尺寸,但 GC 系列相机很难找到这种格式。
接下来我可能会尝试 IMX219(树莓派相机 V2),因为当前的 4.9 内核中已经有它的驱动程序,但目前 OV5647 仍然超时与camerademo,并且没有太多关于应该采取的行动过程的信息 在这种情况下,请参见 PDF 的常见问题解答。
您认为有什么东西可能会破坏我的 allwinner Eyesee 框架方面的驱动程序吗? 我还必须考虑硬件不兼容的可能性,并验证我猜的所有 mipi 逻辑级别...
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
@alb702 这是个好建议,我可能会这样做,因为传感器由于某种原因仍然没有发送其 mipi 帧......它至少会让调试更容易
-
回复: V851S tina linux ov5647 驱动程序没有 dmesg
我让它工作了,似乎驱动程序需要在启动时正确加载,否则 DTS 将传感器设置为“禁用”。
另一方面,我基于 ov5647 的 ov5648 官方 allwinner 驱动程序的寄存器似乎完全错误! 它是一个 mipi 驱动程序,它修改相机中与并行 csi 相关的寄存器,完全是废话......我正在从头开始重写它。
//these register maps are completely wrong, even for the ov5648 for which this driver was originally written static struct regval_list sensor_qsxga_regs[] = { /*2592x1944 15fps 2 lane MIPI 420Mbps/lane */ {0x0100, 0x00}, //start software sleep {0x3501, 0x7b}, //exposure {0x2502, 0x00}, //unknown? {0x3708, 0x63}, //unknown? {0x3709, 0x12}, //unknown? {0x370c, 0xc0}, //unknown? {0x3800, 0x00}, //TIMING_X_ADDR_START {0x3801, 0x00}, //TIMING_X_ADDR_START {0x3802, 0x00}, //TIMING_Y_ADDR_START {0x3803, 0x00}, //TIMING_Y_ADDR_START {0x3804, 0x0a}, //TIMING_X_ADDR_END {0x3805, 0x3f}, //TIMING_X_ADDR_END {0x3806, 0x07}, //TIMING_Y_ADDR_END {0x3807, 0xa3}, //TIMING_Y_ADDR_END {0x3808, 0x0a}, //TIMING_X_OUTPUT_SIZE {0x3809, 0x20}, //TIMING_X_OUTPUT_SIZE {0x380a, 0x07}, //TIMING_Y_OUTPUT_SIZE {0x380b, 0x98}, //TIMING_Y_OUTPUT_SIZE {0x380c, 0x0b}, //TIMING_HTS {0x380d, 0x00}, //TIMING_HTS {0x380e, 0x07}, //TIMING_VTS {0x380f, 0xc0}, //TIMING_VTS {0x3810, 0x00}, //TIMING_ISP_X_WIN {0x3811, 0x10}, //TIMING_ISP_X_WIN {0x3812, 0x00}, //TIMING_ISP_Y_WIN {0x3813, 0x06}, //TIMING_ISP_Y_WIN {0x3814, 0x11}, //TIMING_X_INC {0x3815, 0x11}, //TIMING_Y_INC //TIMING_HSYNCST is missing?? {0x3817, 0x00}, //TIMING_HSYNCST {0x3820, 0x40}, //TIMING_TC_REG20 {0x3821, 0x06}, //TIMING_TC_REG21 {0x4004, 0x04}, //BLC CTRL04 {0x4005, 0x1a}, //BLC CTRL05 {0x350b, 0x40}, //AGC (gain) {0x4837, 0x17}, //PCLK_PERIOD {0x0100, 0x01}, //end software sleep };
-
V851S tina linux ov5647 驱动程序没有 dmesg
大家好,
在修复了我的 i2c 并使用 i2cDetect 和手动 GPIO 选择手动检测到我的相机后,我正在尝试为相机制作一个驱动程序。
我将它基于已经存在的 OV5468 mipi 驱动程序。 我更改了所有必需的标识符和寄存器/值,以使其符合 ov5647 的要求,我编辑了必要的 makefile 来构建它,并为新传感器配置了板的 DTS。
我的问题是这样的:
当我使用 insmod 加载 ov5647_mipi.ko 内核模块时,没有任何反应。 即使我将日志级别设置为 8,并且我在驱动程序中放置了各种 printk() 调用,但 dmesg 中根本没有出现任何消息,但这些调用实际上都没有显示在日志中。 你们知道我可能错过了什么吗? 也许是某个特定的配置使日志静音? DTS 错误?root@TinaLinux:/lib/modules/4.9.191# ls ov5640.ko soc_camera.ko videobuf-core.ko ov5647_mipi.ko soc_camera_platform.ko videobuf2-dma-contig.ko ov5648_mipi.ko soc_mediabus.ko vin_io.ko ov5658.ko uvcvideo.ko vin_v4l2.ko root@TinaLinux:/lib/modules/4.9.191# lsmod Module Size Used by vin_v4l2 176157 0 vin_io 19952 1 vin_v4l2 videobuf2_dma_contig 8632 1 vin_v4l2 root@TinaLinux:/lib/modules/4.9.191# insmod ov5647_mipi.ko root@TinaLinux:/lib/modules/4.9.191# lsmod Module Size Used by ov5647_mipi 6469 0 vin_v4l2 176157 0 vin_io 19952 2 ov5647_mipi,vin_v4l2 videobuf2_dma_contig 8632 1 vin_v4l2 root@TinaLinux:/lib/modules/4.9.191# dmesg | tail root@TinaLinux:/lib/modules/4.9.191#
我的DTS:
soc@03000000 { /*wlan: wlan@0 { compatible = "allwinner,sunxi-wlan"; pinctrl-names = "default"; clock-names = "32k-fanout0"; clocks = <&clk_fanout0>; wlan_busnum = <0x1>; wlan_regon = <&pio PE 6 1 0x1 0x2 0>; wlan_hostwake = <&pio PE 7 14 0x1 0x2 0>; chip_en; power_en; status = "io_disabled"; wakeup-source; };*/ 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 = "okay"; }; tdm0:tdm@0 { work_mode = <0>; }; isp00:isp@0 { work_mode = <0>; }; scaler00:scaler@0 { work_mode = <0>; }; scaler10:scaler@4 { work_mode = <0>; }; scaler20:scaler@8 { work_mode = <0>; }; scaler30:scaler@12 { work_mode = <0>; }; 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 = "ov5647_mipi"; sensor0_twi_cci_id = <1>; sensor0_twi_addr = <0x6c>; 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 = <1800000>; sensor0_iovdd_vol = <>; sensor0_avdd-supply = <2800000>; sensor0_avdd_vol = <>; sensor0_dvdd-supply = <1200000>; sensor0_dvdd_vol = <>; sensor0_reset = <>; //sensor0_power_en = <>; //sensor0_pwdn = <>; sensor0_power_en = <&pio PA 9 1 0 1 0>; sensor0_pwdn = <&pio PA 8 1 0 1 0>; /*sensor0_sm_hs = <&pio PE 2 1 0 1 0>;*/ /*sensor0_sm_vs = <&pio PE 3 1 0 1 0>;*/ flash_handle = <&flash0>; //&flash0 act_handle = <&actuator0>; //&actuator0 status = "okay"; }; sensor1:sensor@1 { device_type = "sensor1"; sensor1_mname = "ov5640"; sensor1_twi_cci_id = <2>; sensor1_twi_addr = <0x30>; 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 = <>; sensor1_iovdd_vol = <1800000>; sensor1_avdd-supply = <>; sensor1_avdd_vol = <2800000>; sensor1_dvdd-supply = <>; sensor1_dvdd_vol = <1200000>; sensor1_power_en = <>; sensor1_reset = <>; sensor1_pwdn = <>; sensor1_sm_hs = <&pio PE 2 1 0 1 0>; sensor1_sm_vs = <&pio PE 3 1 0 1 0>; flash_handle = <>; act_handle = <>; status = "disabled"; }; 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 = <0x0>; status = "okay"; }; vinc01:vinc@1 { vinc1_csi_sel = <2>; vinc1_mipi_sel = <0xff>; vinc1_isp_sel = <1>; vinc1_isp_tx_ch = <1>; vinc1_tdm_rx_sel = <1>; vinc1_rear_sensor_sel = <0>; vinc1_front_sensor_sel = <0>; 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 = <0x0>; status = "okay"; }; vinc11:vinc@5 { vinc5_csi_sel = <2>; vinc5_mipi_sel = <0xff>; vinc5_isp_sel = <1>; vinc5_isp_tx_ch = <1>; vinc5_tdm_rx_sel = <1>; vinc5_rear_sensor_sel = <0>; vinc5_front_sensor_sel = <0>; 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 = <0x0>; 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 = <0>; 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 = <0x0>; 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"; }; }; };
最后是我的驱动程序,如您所见,它实现了各种日志:
#include <linux/init.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/i2c.h> #include <linux/delay.h> #include <linux/videodev2.h> #include <linux/clk.h> #include <media/v4l2-device.h> #include <media/v4l2-mediabus.h> #include <linux/io.h> #include "camera.h" #include "sensor_helper.h" MODULE_AUTHOR("YG"); MODULE_DESCRIPTION("A low-level driver for OV5647 sensors"); MODULE_LICENSE("GPL"); #define MCLK (24*1000*1000) #define V4L2_IDENT_SENSOR 0x5647 #define DEV_DBG_EN 1 /* * Our nominal (default) frame rate. */ #define SENSOR_FRAME_RATE 30 /* * The ov5647 i2c address */ #define I2C_ADDR 0x6c #define SENSOR_NAME "ov5647_mipi" /* * The default register settings */ static struct regval_list sensor_default_regs[] = { /*2lane initial*/ /*Slave_ID=0x6c*/ {0x0100, 0x00}, {0x0103, 0x01}, // delay(5ms) {REG_DLY, 0x25}, {0x3001, 0x00}, {0x3002, 0x00}, {0x3011, 0x02}, {0x3018, 0x4c}, {0x3022, 0x00}, {0x3034, 0x1a}, {0x3035, 0x21}, {0x3036, 0x69}, {0x3037, 0x03}, {0x3038, 0x00}, {0x3039, 0x00}, {0x303a, 0x00}, {0x303b, 0x19}, {0x303c, 0x11}, {0x303d, 0x30}, {0x3105, 0x11}, {0x3106, 0x05}, {REG_DLY, 0x05}, {0x3304, 0x28}, {0x3305, 0x41}, {0x3306, 0x30}, {0x3308, 0x00}, {0x3309, 0xc8}, {0x330a, 0x01}, {0x330b, 0x90}, {0x330c, 0x02}, {0x330d, 0x58}, {0x330e, 0x03}, {0x330f, 0x20}, {0x3300, 0x00}, {0x3500, 0x00}, {0x3501, 0x3d}, {0x3502, 0x00}, {0x3503, 0x07}, {0x350a, 0x00}, {0x350b, 0x40}, {0x3601, 0x33}, {0x3602, 0x00}, {0x3611, 0x0e}, {0x3612, 0x2b}, {0x3614, 0x50}, {0x3620, 0x33}, {0x3622, 0x00}, {0x3630, 0xad}, {0x3631, 0x00}, {0x3632, 0x94}, {0x3633, 0x17}, {0x3634, 0x14}, {0x3704, 0xc0}, {0x3705, 0x2a}, {0x3708, 0x66}, {0x3709, 0x52}, {0x370b, 0x23}, {0x370c, 0xc3}, {0x370d, 0x00}, {0x370e, 0x00}, {0x371c, 0x07}, {0x3739, 0xd2}, {0x373c, 0x00}, {0x3800, 0x00}, {0x3801, 0x00}, {0x3802, 0x00}, {0x3803, 0x00}, {0x3804, 0x0a}, {0x3805, 0x3f}, {0x3806, 0x07}, {0x3807, 0xa3}, {0x3808, 0x05}, {0x3809, 0x10}, {0x380a, 0x03}, {0x380b, 0xcc}, {0x380c, 0x0b}, {0x380d, 0x00}, {0x380e, 0x03}, {0x380f, 0xe0}, {0x3810, 0x00}, {0x3811, 0x08}, {0x3812, 0x00}, {0x3813, 0x04}, {0x3814, 0x31}, {0x3815, 0x31}, {0x3817, 0x00}, {0x3820, 0x08}, {0x3821, 0x07}, {0x3826, 0x03}, {0x3829, 0x00}, {0x382b, 0x0b}, {0x3830, 0x00}, {0x3836, 0x00}, {0x3837, 0x00}, {0x3838, 0x00}, {0x3839, 0x04}, {0x383a, 0x00}, {0x383b, 0x01}, {0x3b00, 0x00}, {0x3b02, 0x08}, {0x3b03, 0x00}, {0x3b04, 0x04}, {0x3b05, 0x00}, {0x3b06, 0x04}, {0x3b07, 0x08}, {0x3b08, 0x00}, {0x3b09, 0x02}, {0x3b0a, 0x04}, {0x3b0b, 0x00}, {0x3b0c, 0x3d}, {0x3f01, 0x0d}, {0x3f0f, 0xf5}, {0x4000, 0x89}, {0x4001, 0x02}, {0x4002, 0x45}, {0x4004, 0x02}, {0x4005, 0x18}, {0x4006, 0x08}, {0x4007, 0x10}, {0x4008, 0x00}, {0x4300, 0xf8}, {0x4303, 0xff}, {0x4304, 0x00}, {0x4307, 0xff}, {0x4520, 0x00}, {0x4521, 0x00}, {0x4511, 0x22}, {0x4800, 0x14}, {0x481f, 0x3c}, {0x4826, 0x00}, {0x4837, 0x18}, {0x4b00, 0x06}, {0x4b01, 0x0a}, {0x5000, 0xff}, {0x5001, 0x00}, {0x5002, 0x41}, {0x5003, 0x0a}, {0x5004, 0x00}, {0x5043, 0x00}, {0x5013, 0x00}, {0x501f, 0x03}, {0x503d, 0x00}, {0x5180, 0x08}, {0x5a00, 0x08}, {0x5b00, 0x01}, {0x5b01, 0x40}, {0x5b02, 0x00}, {0x5b03, 0xf0}, {0x301a, 0xf0}, {0x0100, 0x01}, {0x4837, 0x17}, }; static struct regval_list sensor_qsxga_regs[] = { /*2592x1944 15fps 2 lane MIPI 420Mbps/lane */ {0x0100, 0x00}, {0x3501, 0x7b}, {0x2502, 0x00}, {0x3708, 0x63}, {0x3709, 0x12}, {0x370c, 0xc0}, {0x3800, 0x00}, {0x3801, 0x00}, {0x3802, 0x00}, {0x3803, 0x00}, {0x3804, 0x0a}, {0x3805, 0x3f}, {0x3806, 0x07}, {0x3807, 0xa3}, {0x3808, 0x0a}, {0x3809, 0x20}, {0x380a, 0x07}, {0x380b, 0x98}, {0x380c, 0x0b}, {0x380d, 0x00}, {0x380e, 0x07}, {0x380f, 0xc0}, {0x3810, 0x00}, {0x3811, 0x10}, {0x3812, 0x00}, {0x3813, 0x06}, {0x3814, 0x11}, {0x3815, 0x11}, {0x3817, 0x00}, {0x3820, 0x40}, {0x3821, 0x06}, {0x4004, 0x04}, {0x4005, 0x1a}, {0x350b, 0x40}, {0x4837, 0x17}, {0x0100, 0x01}, }; static struct regval_list sensor_720p_regs[] = { /* 1280x720 30fps 2 lane MIPI 420Mbps/lane */ {0x0100, 0x00}, {0x3501, 0x2d}, {0x3502, 0xc0}, {0x3708, 0x66}, {0x3709, 0x52}, {0x370c, 0xcf}, {0x3800, 0x00}, {0x3801, 0x10}, {0x3802, 0x00}, {0x3803, 0xfe}, {0x3804, 0x0a}, {0x3805, 0x2f}, {0x3806, 0x06}, {0x3807, 0xa5}, {0x3808, 0x05}, {0x3809, 0x00}, {0x380a, 0x02}, {0x380b, 0xd0}, {0x380c, 0x0e}, {0x380d, 0xc4}, {0x380e, 0x02}, {0x380f, 0xe6}, {0x3810, 0x00}, {0x3811, 0x08}, {0x3812, 0x00}, {0x3813, 0x02}, {0x3814, 0x31}, {0x3815, 0x31}, {0x3817, 0x00}, {0x3820, 0x08}, {0x3821, 0x07}, {0x4004, 0x02}, {0x4005, 0x18}, {0x3b0b, 0x80}, {0x4837, 0x17}, {0x0100, 0x01}, }; static struct regval_list sensor_fmt_raw[] = { }; /* * Code for dealing with controls. * fill with different sensor module * different sensor module has different settings here * if not support the follow function ,retrun -EINVAL */ static int sensor_g_exp(struct v4l2_subdev *sd, __s32 *value) { struct sensor_info *info = to_state(sd); *value = info->exp; sensor_dbg("sensor_get_exposure = %d\n", info->exp); return 0; } static int sensor_s_exp(struct v4l2_subdev *sd, unsigned int exp_val) { unsigned char explow, expmid, exphigh; struct sensor_info *info = to_state(sd); if (exp_val > 0xfffff) exp_val = 0xfffff; if (exp_val < 7) exp_val = 7; exphigh = (unsigned char)((0x0f0000 & exp_val) >> 16); expmid = (unsigned char)((0x00ff00 & exp_val) >> 8); explow = (unsigned char)(0x0000ff & exp_val); sensor_write(sd, 0x3502, explow); sensor_write(sd, 0x3501, expmid); sensor_write(sd, 0x3500, exphigh); info->exp = exp_val; return 0; } static int sensor_g_gain(struct v4l2_subdev *sd, __s32 *value) { struct sensor_info *info = to_state(sd); *value = info->gain; sensor_dbg("sensor_get_gain = %d\n", info->gain); return 0; } static int sensor_s_gain(struct v4l2_subdev *sd, unsigned int gain_val) { struct sensor_info *info = to_state(sd); unsigned char gainlow = 0; unsigned char gainhigh = 0; if (gain_val < 1 * 16) gain_val = 16; if (gain_val > 64 * 16 - 1) gain_val = 64 * 16 - 1; gainlow = (unsigned char)(gain_val & 0xff); gainhigh = (unsigned char)((gain_val >> 8) & 0x3); sensor_write(sd, 0x350b, gainlow); sensor_write(sd, 0x350a, gainhigh); info->gain = gain_val; return 0; } static int ov5647_sensor_vts; static int sensor_s_exp_gain(struct v4l2_subdev *sd, struct sensor_exp_gain *exp_gain) { int exp_val, gain_val, shutter, frame_length; unsigned char explow = 0, expmid = 0, exphigh = 0; unsigned char gainlow = 0, gainhigh = 0; struct sensor_info *info = to_state(sd); exp_val = exp_gain->exp_val; gain_val = exp_gain->gain_val; if (gain_val < 1*16) gain_val = 16; if (gain_val > 64*16-1) gain_val = 64*16-1; if (exp_val > 0xfffff) exp_val = 0xfffff; gainlow = (unsigned char)(gain_val & 0xff); gainhigh = (unsigned char)((gain_val >> 8)&0x3); exphigh = (unsigned char)((0x0f0000&exp_val) >> 16); expmid = (unsigned char)((0x00ff00&exp_val) >> 8); explow = (unsigned char)((0x0000ff&exp_val)); shutter = exp_val/16; if (shutter > ov5647_sensor_vts - 4) frame_length = shutter + 4; else frame_length = ov5647_sensor_vts; sensor_write(sd, 0x3208, 0x00);//enter group write sensor_write(sd, 0x3503, 0x07); sensor_write(sd, 0x380f, (frame_length & 0xff)); sensor_write(sd, 0x380e, (frame_length >> 8)); sensor_write(sd, 0x350b, gainlow); sensor_write(sd, 0x350a, gainhigh); sensor_write(sd, 0x3502, explow); sensor_write(sd, 0x3501, expmid); sensor_write(sd, 0x3500, exphigh); sensor_write(sd, 0x3208, 0x10);//end group write sensor_write(sd, 0x3208, 0xa0);//init group write info->exp = exp_val; info->gain = gain_val; return 0; } static void sensor_s_sw_stby(struct v4l2_subdev *sd, int on_off) { int ret = 0; return ret; } /* * Stuff that knows about the sensor. */ static int sensor_power(struct v4l2_subdev *sd, int on) { int ret = 0; printk(KERN_WARNING "entering sensor_power\n"); sensor_dbg("zzz5648 sensor_power\n"); switch (on) { case STBY_ON: printk(KERN_WARNING "entering sensor_power STBY_ON\n"); sensor_print("STBY_ON!\n"); cci_lock(sd); sensor_s_sw_stby(sd, STBY_ON); usleep_range(1000, 1200); cci_unlock(sd); break; case STBY_OFF: printk(KERN_WARNING "entering sensor_power STBY_OFF\n"); sensor_print("STBY_OFF!\n"); cci_lock(sd); usleep_range(1000, 1200); sensor_s_sw_stby(sd, STBY_OFF); cci_unlock(sd); break; case PWR_ON: printk(KERN_WARNING "entering sensor_power PWR_ON, pins: %d %d\n",PWDN ,POWER_EN); gpio_direction_output(GPIOA(8), 0); //led enable gpio_direction_output(GPIOA(9), 0); //power enable sensor_print("PWR_ON!100\n"); cci_lock(sd); vin_gpio_set_status(sd, PWDN, 1); //vin_gpio_write(sd, RESET, CSI_GPIO_HIGH); //not needed for the rpi ov5647 modules vin_gpio_set_status(sd, POWER_EN, 1); vin_gpio_write(sd, PWDN, CSI_GPIO_HIGH); //special case, since PWDN is the led we power it ON //vin_gpio_write(sd, RESET, CSI_GPIO_LOW); //ignore reset vin_gpio_write(sd, POWER_EN, CSI_GPIO_HIGH); usleep_range(7000, 8000); vin_set_pmu_channel(sd, IOVDD, ON); usleep_range(7000, 8000); vin_set_pmu_channel(sd, AVDD, ON); vin_set_pmu_channel(sd, AFVDD, ON); usleep_range(7000, 8000); vin_set_pmu_channel(sd, DVDD, ON); usleep_range(7000, 8000); vin_set_mclk_freq(sd, MCLK); vin_set_mclk(sd, ON); usleep_range(10000, 12000); //vin_gpio_write(sd, RESET, CSI_GPIO_HIGH); //these calls are useless as well //vin_gpio_write(sd, PWDN, CSI_GPIO_HIGH); vin_set_pmu_channel(sd, CAMERAVDD, ON);/*AFVCC ON*/ usleep_range(10000, 12000); cci_unlock(sd); break; case PWR_OFF: sensor_print("PWR_OFF!\n"); cci_lock(sd); vin_gpio_write(sd, PWDN, CSI_GPIO_LOW); //LED off //vin_gpio_write(sd, RESET, CSI_GPIO_HIGH); vin_set_mclk(sd, OFF); usleep_range(7000, 8000); vin_set_pmu_channel(sd, DVDD, OFF); //vin_gpio_write(sd, PWDN, CSI_GPIO_LOW); //vin_gpio_write(sd, RESET, CSI_GPIO_LOW); vin_gpio_write(sd, POWER_EN, CSI_GPIO_LOW); //turn off power to the camera vin_set_pmu_channel(sd, AVDD, OFF); vin_set_pmu_channel(sd, IOVDD, OFF); vin_set_pmu_channel(sd, AFVDD, OFF); vin_set_pmu_channel(sd, CAMERAVDD, OFF);/*AFVCC ON*/ cci_unlock(sd); break; default: return -EINVAL; } return 0; } static int sensor_reset(struct v4l2_subdev *sd, u32 val) { printk(KERN_WARNING "entering sensor_reset\n"); //this camera modules doesn't need to reset /* switch (val) { case 0: vin_gpio_write(sd, RESET, CSI_GPIO_HIGH); usleep_range(100, 120); break; case 1: vin_gpio_write(sd, RESET, CSI_GPIO_LOW); usleep_range(100, 120); break; default: return -EINVAL; } */ return 0; } static int sensor_detect(struct v4l2_subdev *sd) { printk(KERN_WARNING "entering sensor_detect\n"); data_type rdval; unsigned int SENSOR_ID = 0; sensor_read(sd, 0x300A, &rdval); SENSOR_ID |= rdval; SENSOR_ID |= (rdval << 8); sensor_read(sd, 0x300B, &rdval); SENSOR_ID |= (rdval); sensor_print("V4L2_IDENT_SENSOR = 0x%x\n", SENSOR_ID); if (SENSOR_ID != 0x5648) { sensor_print("ov5647 %s error, chip found is not an target chip", __func__); printk(KERN_WARNING "exiting sensor_detect, not found\n"); //return -ENODEV; } printk(KERN_WARNING "exiting sensor_detect, found\n"); return 0; } static int sensor_init(struct v4l2_subdev *sd, u32 val) { printk(KERN_WARNING "entering sensor_init\n"); int ret; struct sensor_info *info = to_state(sd); sensor_print("sensor_init\n"); /*Make sure it is a target sensor */ ret = sensor_detect(sd); if (ret) { printk(KERN_WARNING "exiting sensor_init, not found\n"); sensor_err("chip found is not an target chip.\n"); return ret; } info->focus_status = 0; info->low_speed = 0; info->width = 1280; info->height = 720; info->hflip = 0; info->vflip = 0; info->gain = 0; info->tpf.numerator = 1; info->tpf.denominator = 30; /* 30fps */ info->preview_first_flag = 1; return 0; } static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { int ret = 0; struct sensor_info *info = to_state(sd); switch (cmd) { case GET_CURRENT_WIN_CFG: if (info->current_wins != NULL) { memcpy(arg, info->current_wins, sizeof(struct sensor_win_size)); ret = 0; } else { sensor_err("empty wins!\n"); ret = -1; } break; case SET_FPS: ret = 0; break; case VIDIOC_VIN_SENSOR_EXP_GAIN: ret = sensor_s_exp_gain(sd, (struct sensor_exp_gain *)arg); break; case VIDIOC_VIN_SENSOR_CFG_REQ: sensor_cfg_req(sd, (struct sensor_config *)arg); break; case VIDIOC_VIN_ACT_INIT: ret = actuator_init(sd, (struct actuator_para *)arg); break; case VIDIOC_VIN_ACT_SET_CODE: ret = actuator_set_code(sd, (struct actuator_ctrl *)arg); break; default: return -EINVAL; } return ret; } /* * Store information about the video data format. */ static struct sensor_format_struct sensor_formats[] = { { .desc = "Raw RGB Bayer", .mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10, .regs = sensor_fmt_raw, .regs_size = ARRAY_SIZE(sensor_fmt_raw), .bpp = 1 }, }; #define N_FMTS ARRAY_SIZE(sensor_formats) /* * Then there is the issue of window sizes. Try to capture the info here. */ static struct sensor_win_size sensor_win_sizes[] = { #if 0 /* 720p */ { .width = HD720_WIDTH, .height = HD720_HEIGHT, .hoffset = 0, .voffset = 0, .hts = 3780, .vts = 742, .pclk = 84*1000*1000, .mipi_bps = 420*1000*1000, .fps_fixed = 30, .bin_factor = 1, .intg_min = 16, .intg_max = (742-4)<<4, .gain_min = 1<<4, .gain_max = 64<<4, .regs = sensor_720p_regs,// .regs_size = ARRAY_SIZE(sensor_720p_regs),// .set_size = NULL, }, #endif /* qsxga */ { .width = QSXGA_WIDTH, .height = QSXGA_HEIGHT, .hoffset = 0, .voffset = 0, .hts = 2816, .vts = 1984, .pclk = 84*1000*1000, .mipi_bps = 420*1000*1000, .fps_fixed = 15, .bin_factor = 1, .intg_min = 16, .intg_max = (1984-4)<<4, .gain_min = 1<<4, .gain_max = 64<<4, .regs = sensor_qsxga_regs, .regs_size = ARRAY_SIZE(sensor_qsxga_regs), .set_size = NULL, }, }; #define N_WIN_SIZES (ARRAY_SIZE(sensor_win_sizes)) static int sensor_reg_init(struct sensor_info *info) { int ret; struct v4l2_subdev *sd = &info->sd; struct sensor_format_struct *sensor_fmt = info->fmt; struct sensor_win_size *wsize = info->current_wins; ret = sensor_write_array(sd, sensor_default_regs, ARRAY_SIZE(sensor_default_regs)); if (ret < 0) { sensor_err("write sensor_default_regs error\n"); return ret; } sensor_print("sensor_reg_init\n"); sensor_write_array(sd, sensor_fmt->regs, sensor_fmt->regs_size); if (wsize->regs) sensor_write_array(sd, wsize->regs, wsize->regs_size); if (wsize->set_size) wsize->set_size(sd); info->width = wsize->width; info->height = wsize->height; info->exp = 0; info->gain = 0; ov5647_sensor_vts = wsize->vts; sensor_print("s_fmt set width = %d, height = %d\n", wsize->width, wsize->height); return 0; } static int sensor_s_stream(struct v4l2_subdev *sd, int enable) { struct sensor_info *info = to_state(sd); sensor_print("%s on = %d, %d*%d fps: %d code: %x\n", __func__, enable, info->current_wins->width, info->current_wins->height, info->current_wins->fps_fixed, info->fmt->mbus_code); if (!enable) return 0; return sensor_reg_init(info); } static int sensor_g_mbus_config(struct v4l2_subdev *sd, struct v4l2_mbus_config *cfg) { cfg->type = V4L2_MBUS_CSI2; cfg->flags = 0 | V4L2_MBUS_CSI2_2_LANE | V4L2_MBUS_CSI2_CHANNEL_0; return 0; } static int sensor_g_ctrl(struct v4l2_ctrl *ctrl) { struct sensor_info *info = container_of(ctrl->handler, struct sensor_info, handler); struct v4l2_subdev *sd = &info->sd; switch (ctrl->id) { case V4L2_CID_GAIN: return sensor_g_gain(sd, &ctrl->val); case V4L2_CID_EXPOSURE: return sensor_g_exp(sd, &ctrl->val); } return -EINVAL; } static int sensor_s_ctrl(struct v4l2_ctrl *ctrl) { struct sensor_info *info = container_of(ctrl->handler, struct sensor_info, handler); struct v4l2_subdev *sd = &info->sd; switch (ctrl->id) { case V4L2_CID_GAIN: return sensor_s_gain(sd, ctrl->val); case V4L2_CID_EXPOSURE: return sensor_s_exp(sd, ctrl->val); } return -EINVAL; } /* ----------------------------------------------------------------------- */ static const struct v4l2_ctrl_ops sensor_ctrl_ops = { .g_volatile_ctrl = sensor_g_ctrl, .s_ctrl = sensor_s_ctrl, }; static const struct v4l2_subdev_core_ops sensor_core_ops = { .reset = sensor_reset, .init = sensor_init, .s_power = sensor_power, .ioctl = sensor_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl32 = sensor_compat_ioctl32, #endif }; static const struct v4l2_subdev_video_ops sensor_video_ops = { .s_parm = sensor_s_parm, .g_parm = sensor_g_parm, .s_stream = sensor_s_stream, .g_mbus_config = sensor_g_mbus_config, }; static const struct v4l2_subdev_pad_ops sensor_pad_ops = { .enum_mbus_code = sensor_enum_mbus_code, .enum_frame_size = sensor_enum_frame_size, .get_fmt = sensor_get_fmt, .set_fmt = sensor_set_fmt, }; static const struct v4l2_subdev_ops sensor_ops = { .core = &sensor_core_ops, .video = &sensor_video_ops, .pad = &sensor_pad_ops, }; /* ----------------------------------------------------------------------- */ static struct cci_driver cci_drv = { .name = SENSOR_NAME, .addr_width = CCI_BITS_16, .data_width = CCI_BITS_8, }; static const struct v4l2_ctrl_config sensor_custom_ctrls[] = { { .ops = &sensor_ctrl_ops, .id = V4L2_CID_FRAME_RATE, .name = "frame rate", .type = V4L2_CTRL_TYPE_INTEGER, .min = 15, .max = 120, .step = 1, .def = 120, }, }; static int sensor_init_controls(struct v4l2_subdev *sd, const struct v4l2_ctrl_ops *ops) { struct sensor_info *info = to_state(sd); struct v4l2_ctrl_handler *handler = &info->handler; struct v4l2_ctrl *ctrl; int i; int ret = 0; v4l2_ctrl_handler_init(handler, 2 + ARRAY_SIZE(sensor_custom_ctrls)); v4l2_ctrl_new_std(handler, ops, V4L2_CID_GAIN, 1 * 1600, 256 * 1600, 1, 1 * 1600); ctrl = v4l2_ctrl_new_std(handler, ops, V4L2_CID_EXPOSURE, 0, 65536 * 16, 1, 0); if (ctrl != NULL) ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE; for (i = 0; i < ARRAY_SIZE(sensor_custom_ctrls); i++) v4l2_ctrl_new_custom(handler, &sensor_custom_ctrls[i], NULL); if (handler->error) { ret = handler->error; v4l2_ctrl_handler_free(handler); } sd->ctrl_handler = handler; return ret; } static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct v4l2_subdev *sd; struct sensor_info *info; printk(KERN_WARNING "entering sensor_probe\n"); info = kzalloc(sizeof(struct sensor_info), GFP_KERNEL); if (info == NULL) return -ENOMEM; sd = &info->sd; cci_dev_probe_helper(sd, client, &sensor_ops, &cci_drv); sensor_init_controls(sd, &sensor_ctrl_ops); mutex_init(&info->lock); #ifdef CONFIG_SAME_I2C info->sensor_i2c_addr = I2C_ADDR >> 1; #endif info->fmt = &sensor_formats[0]; info->fmt_pt = &sensor_formats[0]; info->win_pt = &sensor_win_sizes[0]; info->fmt_num = N_FMTS; info->win_size_num = N_WIN_SIZES; info->sensor_field = V4L2_FIELD_NONE; info->stream_seq = MIPI_BEFORE_SENSOR; info->af_first_flag = 1; info->exp = 0; info->gain = 0; return 0; } static int sensor_remove(struct i2c_client *client) { struct v4l2_subdev *sd; printk(KERN_WARNING "entering sensor_remove\n"); sd = cci_dev_remove_helper(client, &cci_drv); kfree(to_state(sd)); return 0; } static const struct i2c_device_id sensor_id[] = { {SENSOR_NAME, 0}, {} }; MODULE_DEVICE_TABLE(i2c, sensor_id); static struct i2c_driver sensor_driver = { .driver = { .owner = THIS_MODULE, .name = SENSOR_NAME, }, .probe = sensor_probe, .remove = sensor_remove, .id_table = sensor_id, }; static __init int init_sensor(void) { return cci_dev_init_helper(&sensor_driver); } static __exit void exit_sensor(void) { cci_dev_exit_helper(&sensor_driver); } module_init(init_sensor); module_exit(exit_sensor);
-
回复: V851S I2C/TWI 损坏(xfer 错误)
@awwwwa 它在端口 A 上,端口 A 仅是 1.8V 逻辑,因此上拉电阻拉至 1.8V。 我确实在某个时候尝试过上拉至 3.3V,但当拉至 1.8V 时却没有任何效果。
-
回复: V851S I2C/TWI 损坏(xfer 错误)
@whycanservice2 我已经将上拉电阻降低到2.5K,但当时仍然不起作用,我想我会尝试1K,看看是否可以降低上拉电压,同时仍然具有I2C功能。
-
回复: V851S I2C/TWI 损坏(xfer 错误)
我让它工作了!
我必须编辑 DTS 将驱动强度增加到 1,并将 1.8V 总线电压从 1.7V 提高到 2V 才能注册,现在我的相机出现了!
默认的 0 驱动强度永远不会起作用。 编辑 DTS 是关键。
-
回复: V851S I2C/TWI 损坏(xfer 错误)
@awwwwa 这确实消除了警告,所以感谢这一点,但是 i2cdetect 的结果仍然完全错过了总线上的任何 I2C 设备...所以根本问题仍然存在...
-
回复: V851S I2C/TWI 损坏(xfer 错误)
@yuzukitsuru 这是我的 TWI 配置:
&twi0 { clock-frequency = <400000>; pinctrl-0 = <&twi0_pins_a>; pinctrl-1 = <&twi0_pins_b>; pinctrl-names = "default", "sleep"; /* For stability and backwards compatibility, we recommend setting ‘twi_drv_used’ to 0 */ twi_drv_used = <0>; twi_pkt_interval = <0>; status = "okay"; }; &twi1 { clock-frequency = <400000>; pinctrl-0 = <&twi1_pins_a>; pinctrl-1 = <&twi1_pins_b>; pinctrl-names = "default", "sleep"; /* For stability and backwards compatibility, we recommend setting ‘twi_drv_used’ to 0 */ twi_drv_used = <0>; twi_pkt_interval = <0>; status = "okay"; }; &twi2 { clock-frequency = <400000>; pinctrl-0 = <&twi2_pins_a>; pinctrl-1 = <&twi2_pins_b>; pinctrl-names = "default", "sleep"; /* For stability and backwards compatibility, we recommend setting ‘twi_drv_used’ to 0 */ twi_drv_used = <0>; twi_pkt_interval = <0>; status = "okay"; }; &twi3 { clock-frequency = <400000>; pinctrl-0 = <&twi3_pins_a>; pinctrl-1 = <&twi3_pins_b>; pinctrl-names = "default", "sleep"; /* For stability and backwards compatibility, we recommend setting ‘twi_drv_used’ to 0 */ twi_drv_used = <0>; twi_pkt_interval = <0>; status = "disabled"; };
但 I2C 总线通常表现得很奇怪,如果我在总线上不放置任何东西,我会得到看起来很糟糕的信号(上升和下降时间长,并且它给我“xfer 不完整”错误),但是如果我在总线上放置一个设备 I2C 总线根本没有发送任何内容(并且我收到 xfer 超时错误)!
考虑到测量的时钟速度,它显然试图在 400khz 下工作,但这个信号看起来仍然很糟糕。 我想知道这是否与 DTS 中的驱动强度设置有关。 -
回复: V851S kernel_menuconfig 设置未应用
事实证明 .ko 文件确实是由“make”命令构建的,但它们只是没有被发送到图像:
为了能够将它们包含在图像中,我必须编辑 openwrt/target/v851S/<board_name> 中的文件:
添加我需要的各种 ov 驱动程序并注释掉我不需要的 gc2053 驱动程序
这仍然有点奇怪,这不是自动配置的,需要您手动编辑这些 makefile...感觉很笨重
-
回复: V851S I2C/TWI 损坏(xfer 错误)
事实证明我缺少这些线路的上拉电阻。 现在它们不再出现“调节器”错误,而是所有地址都超时。 我现在有一个 MPU6050 连接到总线进行测试,这是扫描日志,您可以看到它什么也没发现。 mpu6050的地址应该是0x68或0x69,两者都很清楚:
root@TinaLinux:/# i2cdetect 1 -y [ 26.316647] i2c i2c-1: ioctl, cmd=0x705, arg=0xbebcac8c 0 1 2 3 4 5 6 7 8 [ 26.322650] i2c i2c-1: ioctl, cmd=0x703, arg=0x03 9 a b c d e f 00: [ 26.330781] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 26.339311] i2c i2c-1: master_xfer[0] W, addr=0x03, len=0 [ 31.366572] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x3) -- [ 31.374170] i2c i2c-1: ioctl, cmd=0x703, arg=0x04 [ 31.379777] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 31.385639] i2c i2c-1: master_xfer[0] W, addr=0x04, len=0 ... // 为简洁起见而删减 60: [ 495.059785] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 495.066137] i2c i2c-1: master_xfer[0] W, addr=0x60, len=0 [ 500.086565] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x60) -- [ 500.094231] i2c i2c-1: ioctl, cmd=0x703, arg=0x61 [ 500.099774] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 500.105629] i2c i2c-1: master_xfer[0] W, addr=0x61, len=0 [ 505.126562] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x61) -- [ 505.134222] i2c i2c-1: ioctl, cmd=0x703, arg=0x62 [ 505.139767] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 505.145622] i2c i2c-1: master_xfer[0] W, addr=0x62, len=0 [ 510.166586] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x62) -- [ 510.174251] i2c i2c-1: ioctl, cmd=0x703, arg=0x63 [ 510.179792] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 510.185648] i2c i2c-1: master_xfer[0] W, addr=0x63, len=0 [ 515.206563] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x63) -- [ 515.214226] i2c i2c-1: ioctl, cmd=0x703, arg=0x64 [ 515.219819] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 515.225678] i2c i2c-1: master_xfer[0] W, addr=0x64, len=0 [ 520.246561] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x64) -- [ 520.254226] i2c i2c-1: ioctl, cmd=0x703, arg=0x65 [ 520.259765] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 520.265622] i2c i2c-1: master_xfer[0] W, addr=0x65, len=0 [ 525.286562] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x65) -- [ 525.294226] i2c i2c-1: ioctl, cmd=0x703, arg=0x66 [ 525.299767] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 525.305622] i2c i2c-1: master_xfer[0] W, addr=0x66, len=0 [ 530.326561] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x66) -- [ 530.334223] i2c i2c-1: ioctl, cmd=0x703, arg=0x67 [ 530.339766] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 530.345623] i2c i2c-1: master_xfer[0] W, addr=0x67, len=0 [ 535.366587] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x67) -- [ 535.374251] i2c i2c-1: ioctl, cmd=0x703, arg=0x68 [ 535.379799] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 535.385655] i2c i2c-1: master_xfer[0] W, addr=0x68, len=0 [ 540.406582] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x68) -- [ 540.414247] i2c i2c-1: ioctl, cmd=0x703, arg=0x69 [ 540.419837] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 540.425696] i2c i2c-1: master_xfer[0] W, addr=0x69, len=0 [ 545.446563] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x69) -- [ 545.454231] i2c i2c-1: ioctl, cmd=0x703, arg=0x6a [ 545.459774] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 545.465630] i2c i2c-1: master_xfer[0] W, addr=0x6a, len=0 [ 550.486562] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x6a) -- [ 550.494228] i2c i2c-1: ioctl, cmd=0x703, arg=0x6b [ 550.499769] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 550.505625] i2c i2c-1: master_xfer[0] W, addr=0x6b, len=0 [ 555.526561] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x6b) -- [ 555.534225] i2c i2c-1: ioctl, cmd=0x703, arg=0x6c [ 555.539771] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 555.545628] i2c i2c-1: master_xfer[0] W, addr=0x6c, len=0 [ 560.566588] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x6c) -- [ 560.574248] i2c i2c-1: ioctl, cmd=0x703, arg=0x6d [ 560.579791] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 560.585647] i2c i2c-1: master_xfer[0] W, addr=0x6d, len=0 [ 565.606563] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x6d) -- [ 565.614225] i2c i2c-1: ioctl, cmd=0x703, arg=0x6e [ 565.619817] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 565.625675] i2c i2c-1: master_xfer[0] W, addr=0x6e, len=0 [ 570.646562] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x6e) -- [ 570.654224] i2c i2c-1: ioctl, cmd=0x703, arg=0x6f [ 570.659766] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 570.665623] i2c i2c-1: master_xfer[0] W, addr=0x6f, len=0 [ 575.686561] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x6f) -- [ 575.694255] i2c i2c-1: ioctl, cmd=0x703, arg=0x70 70: [ 575.699777] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 575.706129] i2c i2c-1: master_xfer[0] W, addr=0x70, len=0 [ 580.726587] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x70) -- [ 580.734251] i2c i2c-1: ioctl, cmd=0x703, arg=0x71 [ 580.739800] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 580.745655] i2c i2c-1: master_xfer[0] W, addr=0x71, len=0 [ 585.766565] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x71) -- [ 585.774229] i2c i2c-1: ioctl, cmd=0x703, arg=0x72 [ 585.779823] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 585.785682] i2c i2c-1: master_xfer[0] W, addr=0x72, len=0 [ 590.806562] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x72) -- [ 590.814226] i2c i2c-1: ioctl, cmd=0x703, arg=0x73 [ 590.819771] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 590.825626] i2c i2c-1: master_xfer[0] W, addr=0x73, len=0 [ 595.846562] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x73) -- [ 595.854226] i2c i2c-1: ioctl, cmd=0x703, arg=0x74 [ 595.859773] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 595.865630] i2c i2c-1: master_xfer[0] W, addr=0x74, len=0 [ 600.886561] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x74) -- [ 600.894216] i2c i2c-1: ioctl, cmd=0x703, arg=0x75 [ 600.899762] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 600.905618] i2c i2c-1: master_xfer[0] W, addr=0x75, len=0 [ 605.926601] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x75) -- [ 605.934261] i2c i2c-1: ioctl, cmd=0x703, arg=0x76 [ 605.939803] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 605.945659] i2c i2c-1: master_xfer[0] W, addr=0x76, len=0 [ 610.966564] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x76) -- [ 610.974220] i2c i2c-1: ioctl, cmd=0x703, arg=0x77 [ 610.979815] i2c i2c-1: ioctl, cmd=0x720, arg=0xbebcac6c [ 610.985675] i2c i2c-1: master_xfer[0] W, addr=0x77, len=0 [ 616.006564] sunxi_i2c_do_xfer()1967 - [i2c1] xfer timeout (dev addr:0x77)
所以这里还是有些不对劲...
-
回复: V851S I2C/TWI 损坏(xfer 错误)
我似乎忘记了i2c上拉电阻(每个人都会遇到哈哈),现在调节器问题消失了,但通信似乎仍然失败:
[ 102.176976] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.184713] i2c i2c-1: master_xfer[0] W, addr=0x60, len=0 [ 102.190934] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x60) (sunxi_i2c_do_xfer) [ 102.202379] i2c i2c-1: ioctl, cmd=0x703, arg=0x61 [ 102.207685] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.213540] i2c i2c-1: master_xfer[0] W, addr=0x61, len=0 [ 102.219770] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x61) (sunxi_i2c_do_xfer) [ 102.231144] i2c i2c-1: ioctl, cmd=0x703, arg=0x62 [ 102.236440] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.242295] i2c i2c-1: master_xfer[0] W, addr=0x62, len=0 [ 102.248581] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x62) (sunxi_i2c_do_xfer) [ 102.259960] i2c i2c-1: ioctl, cmd=0x703, arg=0x63 [ 102.265237] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.271113] i2c i2c-1: master_xfer[0] W, addr=0x63, len=0 [ 102.277333] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x63) (sunxi_i2c_do_xfer) [ 102.288706] i2c i2c-1: ioctl, cmd=0x703, arg=0x64 [ 102.293981] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.299908] i2c i2c-1: master_xfer[0] W, addr=0x64, len=0 [ 102.306117] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x64) (sunxi_i2c_do_xfer) [ 102.317489] i2c i2c-1: ioctl, cmd=0x703, arg=0x65 [ 102.322766] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.328642] i2c i2c-1: master_xfer[0] W, addr=0x65, len=0 [ 102.334848] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x65) (sunxi_i2c_do_xfer) [ 102.346263] i2c i2c-1: ioctl, cmd=0x703, arg=0x66 [ 102.351544] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.357425] i2c i2c-1: master_xfer[0] W, addr=0x66, len=0 [ 102.363631] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x66) (sunxi_i2c_do_xfer) [ 102.374999] i2c i2c-1: ioctl, cmd=0x703, arg=0x67 [ 102.380296] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.386161] i2c i2c-1: master_xfer[0] W, addr=0x67, len=0 [ 102.392361] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x67) (sunxi_i2c_do_xfer) [ 102.403786] i2c i2c-1: ioctl, cmd=0x703, arg=0x68 [ 102.409092] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.414946] i2c i2c-1: master_xfer[0] W, addr=0x68, len=0 [ 102.421170] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x68) (sunxi_i2c_do_xfer) [ 102.432538] i2c i2c-1: ioctl, cmd=0x703, arg=0x69 [ 102.437837] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.443692] i2c i2c-1: master_xfer[0] W, addr=0x69, len=0 [ 102.449969] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x69) (sunxi_i2c_do_xfer) [ 102.461344] i2c i2c-1: ioctl, cmd=0x703, arg=0x6a [ 102.466640] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.472498] i2c i2c-1: master_xfer[0] W, addr=0x6a, len=0 [ 102.478726] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x6a) (sunxi_i2c_do_xfer) [ 102.490089] i2c i2c-1: ioctl, cmd=0x703, arg=0x6b [ 102.495363] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.501290] i2c i2c-1: master_xfer[0] W, addr=0x6b, len=0 [ 102.507517] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x6b) (sunxi_i2c_do_xfer) [ 102.518889] i2c i2c-1: ioctl, cmd=0x703, arg=0x6c [ 102.524165] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.530041] i2c i2c-1: master_xfer[0] W, addr=0x6c, len=0 [ 102.536259] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x6c) (sunxi_i2c_do_xfer) [ 102.547670] i2c i2c-1: ioctl, cmd=0x703, arg=0x6d [ 102.552946] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.558825] i2c i2c-1: master_xfer[0] W, addr=0x6d, len=0 [ 102.565029] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x6d) (sunxi_i2c_do_xfer) [ 102.576442] i2c i2c-1: ioctl, cmd=0x703, arg=0x6e [ 102.581722] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.587602] i2c i2c-1: master_xfer[0] W, addr=0x6e, len=0 [ 102.593808] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x6e) (sunxi_i2c_do_xfer) [ 102.605227] i2c i2c-1: ioctl, cmd=0x703, arg=0x6f [ 102.610530] i2c i2c-1: ioctl, cmd=0x720, arg=0xbeef1c7c [ 102.616399] i2c i2c-1: master_xfer[0] W, addr=0x6f, len=0 [ 102.622606] sunxi_i2c_do_xfer()1974 - [i2c1] incomplete xfer (status: 0x20, dev addr: 0x6f) (sunxi_i2c_do_xfer) 60: -- -- -- -- -- -- -- -- -- -[ 102.634085] i2c i2c-1: ioctl, cmd=0x703, arg=0x70 - -- -- -- -- -- --
0x6C 处应该有一个有效的设备。 从我的示波器中,我清楚地看到该设备正在接收 SCL 和 SDA 信号,但没有读回任何内容......
-
V851S I2C/TWI 损坏(xfer 错误)
大家好,
我的 V851S (tina-linux) 上的 i2c/twi 总线似乎有问题,每次我尝试使用 i2cdump 或 i2cDetect 等 shell i2C 实用程序时,我都会收到以下错误 (i2cget 和 i2cwrite 也会发生这种情况):root@TinaLinux:/sys/devices/platform/soc/pio/gpiochip0/gpio/gpio8# i2cdetect 1 [ 786.358195] i2c i2c-1: ioctl, cmd=0x705, arg=0xbea72c6c i2cdetect: WARNING! This program can confuse your I2C bus Continue? [y/N] y 0 1 2 3 4 5 6 7 8 [ 789.513384] i2c i2c-1: ioctl, cmd=0x703, arg=0x03 9 a b c d e f 00: [ 789.521510] i2c i2c-1: ioctl, cmd=0x720, arg=0xbea72c4c [ 789.530134] i2c i2c-1: master_xfer[0] W, addr=0x03, len=0 [ 789.536525] twi_start()508 - [i2c1] START can't sendout! [ 789.542553] sunxi_i2c_do_xfer()1951 - [i2c1] twi_regulator: [ 789.549191] twi_start()508 - [i2c1] START can't sendout! [ 789.555137] sunxi_i2c_do_xfer()1951 - [i2c1] twi_regulator: [ 789.561763] twi_start()508 - [i2c1] START can't sendout! [ 789.567722] sunxi_i2c_do_xfer()1951 - [i2c1] twi_regulator: -- [ 789.574219] i2c i2c-1: ioctl, cmd=0x703, arg=0x04 [ 789.579759] i2c i2c-1: ioctl, cmd=0x720, arg=0xbea72c4c [ 789.585615] i2c i2c-1: master_xfer[0] W, addr=0x04, len=0 [ 789.591919] twi_start()508 - [i2c1] START can't sendout! [ 789.597882] sunxi_i2c_do_xfer()1951 - [i2c1] twi_regulator: [ 789.604494] twi_start()508 - [i2c1] START can't sendout! [ 789.610452] sunxi_i2c_do_xfer()1951 - [i2c1] twi_regulator: [ 789.617068] twi_start()508 - [i2c1] START can't sendout! [ 789.623016] sunxi_i2c_do_xfer()1951 - [i2c1] twi_regulator: -- [ 789.629512] i2c i2c-1: ioctl, cmd=0x703, arg=0x05 [ 789.635030] i2c i2c-1: ioctl, cmd=0x720, arg=0xbea72c4c [ 789.640964] i2c i2c-1: master_xfer[0] W, addr=0x05, len=0 [ 789.647206] twi_start()508 - [i2c1] START can't sendout! [ 789.653155] sunxi_i2c_do_xfer()1951 - [i2c1] twi_regulator: [ 789.659783] twi_start()508 - [i2c1] START can't sendout! [ 789.665728] sunxi_i2c_do_xfer()1951 - [i2c1] twi_regulator: [ 789.672352] twi_start()508 - [i2c1] START can't sendout! [ 789.678309] sunxi_i2c_do_xfer()1951 - [i2c1] twi_regulator:
这是我的 I2C 内核配置:
和我的 i2c“menuconfig”:
我知道至少已经有一篇关于此问题的帖子,但这只是一条警告消息,在我的情况下,它无法正常工作,因为我在 I2C 1 的地址 0x36 上有一个未检测到的设备。我怎样才能摆脱这些错误?
我的 twi DTS 配置如下:
twi0_pins_a: twi0@0 { allwinner,pins = "PA16", "PA17"; allwinner,pname = "twi0_scl", "twi0_sda"; allwinner,function = "twi0"; allwinner,muxsel = <4>; allwinner,drive = <0>; allwinner,pull = <1>; }; twi0_pins_b: twi0@1 { allwinner,pins = "PA16", "PA17"; allwinner,function = "io_disabled"; allwinner,muxsel = <0xf>; allwinner,drive = <0>; allwinner,pull = <0>; }; twi1_pins_a: twi1@0 { allwinner,pins = "PA6", "PA7"; allwinner,pname = "twi1_scl", "twi1_sda"; allwinner,function = "twi1"; allwinner,muxsel = <4>; allwinner,drive = <0>; allwinner,pull = <1>; }; twi1_pins_b: twi1@1 { allwinner,pins = "PA6", "PA7"; allwinner,function = "io_disabled"; allwinner,muxsel = <0xf>; allwinner,drive = <0>; allwinner,pull = <0>; }; twi2_pins_a: twi2@0 { allwinner,pins = "PH11", "PH12"; allwinner,pname = "twi2_scl", "twi2_sda"; allwinner,function = "twi2"; allwinner,muxsel = <5>; allwinner,drive = <0>; allwinner,pull = <1>; }; twi2_pins_b: twi2@1 { allwinner,pins = "PH11", "PH12"; allwinner,function = "io_disabled"; allwinner,muxsel = <0xf>; allwinner,drive = <0>; allwinner,pull = <0>; }; twi3_pins_a: twi3@0 { allwinner,pins = "PI3", "PI4"; allwinner,pname = "twi3_scl", "twi3_sda"; allwinner,function = "twi6"; allwinner,muxsel = <6>; allwinner,drive = <0>; allwinner,pull = <1>; }; twi3_pins_b: twi3@1 { allwinner,pins = "PI3", "PI4"; allwinner,function = "io_disabled";//io_disabled allwinner,muxsel = <0xf>; allwinner,drive = <0>; allwinner,pull = <0>; }; twi4_pins_a: twi4@0 { allwinner,pins = "PI1", "PI2"; allwinner,pname = "twi4_scl", "twi4_sda"; allwinner,function = "twi4"; allwinner,muxsel = <5>; allwinner,drive = <0>; allwinner,pull = <1>; }; twi4_pins_b: twi4@1 { allwinner,pins = "PI1", "PI2"; allwinner,function = "io_disabled"; allwinner,muxsel = <0xf>; allwinner,drive = <0>; allwinner,pull = <0>; };
-
V851S kernel_menuconfig 设置未应用
大家好,
当我在 kernel_menuconfig 中将 OV5640 和 OV5658 驱动程序设置为编译为模块 (M) 时(并且禁用 gc_2053):
我编辑 DTS 以反映更改:
并编译/运行,似乎没有考虑到更改。 menuconfig 中的其他更改确实适用于图像,但 kernel_menuconfig 中完成的某些更改则不然。 看这里,gc_2053 驱动程序仍然处于活动状态,而 OV 驱动程序却不见踪影:
知道为什么会出现这种情况吗? -
回复: V851s buildroot openwrt 编译GCC失败
@awwwwa 这是有道理的,谢谢你告诉我。 我只是很好奇,因为它是菜单配置中的一个选项。 我仍然觉得有趣的是,当在 menuconfig 中选择时,像 python 3.9 这样的包实际上会针对这个平台进行编译
-
V851s buildroot openwrt 警告
大家好,我目前正在为 V851S 构建映像,并且我总是在“make”期间看到弹出这些警告:
Check Vendor Package... CreateSoftLink /home/kanken/code/tina-v853-open/openwrt/openwrt/package/subpackage link to /home/kanken/code/tina-v853-open/openwrt/package end WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-libav/Makefile' has a build dependency on 'libgstreamer1', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-libav/Makefile' has a build dependency on 'gstreamer1-plugins-base', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-omx/Makefile' has a dependency on 'libgst1gl', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-aw/Makefile' has a build dependency on 'libgstreamer1', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-aw/Makefile' has a build dependency on 'gstreamer1-plugins-base', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-aw/Makefile' has a build dependency on 'gstreamer1-plugins-good', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-bad/Makefile' has a dependency on 'wayland', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-bad/Makefile' has a dependency on 'wayland-protocols', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-bad/Makefile' has a dependency on 'libgst1badvideo', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-bad/Makefile' has a dependency on 'libgst1gl', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-bad/Makefile' has a build dependency on 'libgstreamer1', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-bad/Makefile' has a build dependency on 'gstreamer1-plugins-base', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-base/Makefile' has a build dependency on 'libgstreamer1', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-good/Makefile' has a build dependency on 'libgstreamer1', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-good/Makefile' has a build dependency on 'gstreamer1-plugins-base', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-ugly/Makefile' has a build dependency on 'libgstreamer1', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/multimedia/gstreamer/gst1-plugins-ugly/Makefile' has a build dependency on 'gstreamer1-plugins-base', which does not exist WARNING: Makefile 'package/kernel/linux/Makefile' has a dependency on 'kmod-sunxi-rf-wlan', which does not exist WARNING: Makefile 'package/subpackage/allwinner/eyesee-mpp/middleware/Makefile' has a dependency on 'awsystrace', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/gui/qt/qt5/Makefile' has a dependency on 'weston', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/gui/qt/qt5/Makefile' has a dependency on 'wayland', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/gui/qt/qt5/Makefile' has a dependency on 'qt5-multimediawidgets', which does not exist WARNING: Makefile 'package/subpackage/thirdparty/gui/qt/qt5/Makefile' has a build dependency on 'libstdcpp', which does not exist copy from /home/kanken/code/tina-v853-open/openwrt/target/v851s/v851s-lizard/defconfig
它们引用了我已经安装在我的电脑上的软件包,但它们不会消失,这是正常的还是我错过了这里的一个步骤?我应该忽略这些警告吗?
-
V851s buildroot openwrt 编译GCC失败
大家好,
我已经使用 yukilizard 项目的 BSP 以及 tina-V853 存储库成功为 V851S 构建了映像。 但现在我想为 V851S 构建 GCC。 当我在 Developpement->GCC 中启用该选项(它自己启用其他选项)并且我“make”时,它编译得很好,直到到达 GCC,此时我遇到了此错误:
make menuconfig options
error有谁知道我如何/是否可以解决这个问题?
-
回复: YuzuKi X 100ask V851s 体验, 含编译和烧录nand系统
感谢您的帖子,我忘记对 SD 卡执行“pack -d”操作,这会在 SD 卡中使用时导致损坏,现在它可以工作了。
-
基于V851S的USB-UVC摄像头板
大家好,
我是一名嵌入式系统的学生(来自法国),我正在围绕 V851S 制作这个小板。 它应该用于连接树莓派相机或 esp32-cam 相机,并使用 usb-uvc 将它们用作 USB 网络摄像头。
该项目仍处于早期阶段,我是这个论坛的新手,所以我想我只是将其作为介绍发布。以下是该板的一些图片: