I2C不通的分析思路

本篇文章主要介绍了"I2C不通的分析思路",主要涉及到I2C不通的分析思路方面的内容,对于I2C不通的分析思路感兴趣的同学可以参考一下。

[DESCRIPTION] 在camera porting的过程中,有很多原因会导致Camera I2C不通 此篇FAQ的目的是为camera i2c没通的情况,提供一个大概的思路   [SOLUTION] I2C不通,有两种原因,一种是device端(也就是我们的camera sensor)本身就没有回ACK,另一中就是在master端(也就是我们的baseband端),如果我们的,master端就本身异常。那么I2C不通就不足为奇了   我们可以从kernel log里面搜索I2C的关键字,无非是“I2C_TIMEOUT”和“I2C_ACKERR”。。 如果您搜索到了I2C_ACKERR,那么问题多半在slave端,您需要检查您的上电时需是否符合sensor spec的规范,和模组厂的工程师或者sensor厂的工程师一起修改sensor的上电时需, 如果您搜索到的是I2C_TIMEOUT,那么问题多半在master端。 [DESCRIPTION]         I2C as the bridge which communicate during the image sensor and BB. It used to send and rececive command / data interaction with its fundamental role, especially importante in the porting process, i2c is the first step when porting a new sensor.   [SOLUTION]      I2C ACK error scenario as follows: Condition1:   pin reverse(HW)     1) SCL and SDA pin is reversed.     2) So I2C controller only send out address waveform.   Condition2: Slave device is not connected to host(HW)     1) SCL/SDA default level is high     2) I2C controller only send out address waveform.     3) Slave can not response action   Condition 3: Slave address is wrong(SW)     1) The same as not exit      Condition 4: Slave device is connected to host but not in right ststus.     1) Slave is busy, can not process host date.     2) Continue sending dummy data to draw back slave status     3) Reset slave device.   Condition 5: This case include slave is not power on     1) Check the power supply of device.   Conidtion 6: This case include slave is not enable     1) Check if the chip select is active.   Condition 7: Some special device need work in WR mode.     1) need use WR mode after send the Camera ID Command. If not suit it the device will send ACK error to Baseband.     client->addr |= I2C_RS_FLAG | I2C_WR_FLAG; [DESCRIPTION] 在开机过程中,感觉开机的时间过长,发现是search sensor导致的。 如果您从kernel_log.boot中搜索关键字I2C_TIMEOUT,若搜索到如下图所示,您可以参考这篇FAQ [SOLUTION]  从上图所示,在开机过程中因为I2C_TIMEOUT,就浪费了4s多的时间  至于是代码的那个地方造成的I2C_TIMEOUT,我们得根据具体问题具体分析,  但是,我们只需要把握一点,就是出现I2C_TIMEOUT的rootcause来推测这个问题,我们的问题就迎刃而解  出现I2C_TIMEOUT的rootcause之一是,在I2C bus上没有电的情况下去操作I2C,就会出现timeout  一般来说,我们正常的follow:  Camera Power On --> Write/Read I2C ---> Camera Power Off  在下面的follow下,就会有I2C timeout: Camera Power Off --> Write/Read I2C  我们根据上述条件,通过代码和log去跟踪camera  power on/off和write/read I2C的follow,找出异常点,那么这个问题就迎刃而解   P.S I2C timeraout的root cause有很多,但是在I2C bus上没有电的情况下去操作I2C是最常见的 [DESCRIPTION] 关于I2C 传输时相关flag的说明   [SOLUTION] i2c传输前需要对 client->ext_flag 做设定,或上相关标志,各个flag解释如下:    ▪I2C_DMA_FLAG –开启DMA传输,default 为fifo mode传输 ▪I2C_WR_FLAG  –Enable write and read tranfer mode, Must set I2C_RS_FLAG ,Don’t support in DMA mode ▪I2C_RS_FLAG    –Enable REPEATED-START ▪I2C_HS_FLAG  –Enable high speed mode,default 为低速和快速  ▪I2C_PUSHPULL_FLAG –使能pushpull mode,default 为open drain ▪I2C_ENEXT_FLAG  –Allows slaves to hold the SCL line low if it is not yet ready for further processing ,Open open-drain mode of the SCL line
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值