我正在开发基于 iMX6Q 处理器的定制板,它使用 linux-imx 内核 4.9.11 ( http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/?h =imx_4.9.11_1.0.0_ga)。但是,当我向其中一个外围设备发送 I2C 消息(我在 i2c-2 总线上有 4 个从设备,处理器是唯一的主设备)时,控制器会出现以下错误:
[ 82.972843] i2c i2c-2: ioctl, cmd=0x703, arg=0x5c
[ 82.972854] i2c i2c-2: ioctl, cmd=0x720, arg=0x7ec06bbc
[ 82.972865] i2c i2c-2: master_xfer[0] R, addr=0x5c, len=1
[ 82.972871] i2c i2c-2: <i2c_imx_xfer>
[ 82.972877] i2c i2c-2: <i2c_imx_start>
[ 82.973053] i2c i2c-2: <i2c_imx_bus_busy>
[ 83.482804] i2c i2c-2: <i2c_imx_bus_busy> I2C bus is busy
[ 83.482810] i2c i2c-2: Trying i2c bus recovery
[ 83.482854] i2c i2c-2: <i2c_imx_start>
[ 83.483029] i2c i2c-2: <i2c_imx_bus_busy>
[ 83.992804] i2c i2c-2: <i2c_imx_bus_busy> I2C bus is busy
[ 83.992816] i2c i2c-2: <i2c_imx_xfer> exit with: error: -110
用示波器看一下,我可以看到总线处于空闲状态时为高电平(如预期的那样)。然而,当我尝试开始传输时,主机设置总线上的启动条件,然后,总线保持低电平(SDA 和 SCL)直到传输超时并且驱动程序警告总线正忙于超时错误(虽然它真的不是!)。我知道这不是硬件问题/错误,因为我可以通过 U-Boot(以及较旧的内核版本,例如 4.1.15)通过 I2C 进行通信。
我已经检查了 I2C 内核配置,似乎没问题。此外,I2C 总线控制器已在设备树中正确配置。
PD:默认内核配置 (imx_v7_defconfig) 不起作用。
谢谢!
干杯,
丹尼尔