我未能使用C/C++通过I2C总线访问我系统上的图像传感器on 5645‘S寄存器。下面是有关我的系统的一些信息:
Hardware:
Dragonboard 410c +
96Boards MIPI Adapter with Dual OV5645
(https://www.ebay.com/itm/96Boards-MIPI-Adapter-with-Dual-OV5645/253645902432?hash=item3b0e795260%25253Ag%25253AL38AAOSwCmNZyJq5%252525EF%252525BC%25252589)
OS :
Linaro Linux 19.01由于我可以使用GStreamer来控制两个OV5645来反馈捕获的图像,所以硬件连接似乎很好。下面是关于我的系统中的I2C主程序和OV5645的一些信息:
linaro@linaro-developer:~$ sudo i2cdetect -l
i2c-3 i2c QUP I2C adapter I2C adapter
i2c-1 i2c QUP I2C adapter I2C adapter
i2c-4 i2c Qualcomm Camera Control Interface I2C adapter
i2c-0 i2c QUP I2C adapter I2C adapter
linaro@linaro-developer:~$ dmesg | grep ov5645
[ 11.825197] ov5645 4-003b: OV5645 detected at address 0x3b
[ 12.290626] ov5645 4-003a: OV5645 detected at address 0x3a下面是我的简短节目:https://gist.github.com/oliverjungen/6f25e9e77167a17d677e7a3c0678c41e
它所做的只是:
file = open(filename, O_RDWR);0x3b errno = ioctl(file, I2C_SLAVE_FORCE, CAM_REAR_I2C_ADDR);0x300a发送到此I2C从ret = write(file, ®, 2);然而,当它运行时,我总是得到:
Write i2c internal address error: Input/output error此消息由perror()在此程序的第54行中打印,将寄存器地址(0x300a,传感器芯片ID高字节)写入OV5645。
我发现,当发生此错误时,内核模块i2c-qcom-cci报告的错误消息如下:
linaro@linaro-developer:~$ dmesg | grep cci
[ 1280.099448] i2c-qcom-cci 1b0c000.cci: Master 0 error 0x08000000
[ 1280.099502] i2c-qcom-cci 1b0c000.cci: master 0 queue 0 error -5
[ 1280.104247] i2c-qcom-cci 1b0c000.cci: cci i2c xfer error -5这些I2C从站(这些OV5645)实际上是由内核模块拥有的。这就是为什么我在设置I2C_SLAVE_FORCE从地址:errno = ioctl(file, I2C_SLAVE_FORCE, CAM_REAR_I2C_ADDR);时使用I2C而不是I2C_SLAVE作为标志的原因。
我想知道我是否不能使用ioctl()来控制内核模块拥有的设备?
发布于 2019-08-12 13:03:06
任何人可能会担心:这个症状的根本原因是:or 5645‘S内核模块将关闭or 5645’S电源(还是省电?)在初始化之后。在手动打开电源后,现在可以访问on 5645‘S寄存器了。财政年度。
https://unix.stackexchange.com/questions/534473
复制相似问题