|
发表于 2017-9-4 18:14:47
14008 浏览 4 回复
i2c总线问题(对应视频31)
本帖最后由 TOPEET_moon 于 2017-9-4 19:25 编辑
有问题可以跟帖~ |
|
|
|
|
|
|
|
发表于 2018-9-27 13:58:17
本帖最后由 ch122633 于 2018-9-27 14:01 编辑
你好,我的问题可能有点奇怪:
我使用4412精英板,因为发现I2C6是3.3v的接口。然后还能连接出来,手头有个MPU9250模块,就想连上试试。
我卸载了内核的
menuconfig中去掉触摸的驱动
- Device Drivers --->
- Input device support --->
- Touchscreens --->
- FT5X0X based touchscreens(去掉)
然后是去掉RC522的驱动(SPI占用I2C了)
- Device Drivers --->
- SPI support --->
- < > RC522 Module driver support(去掉)
-> Networking support (NET [=y])
-> CAN bus subsystem support (CAN [=y])
-> CAN Device Drivers
-> Platform CAN drivers with Netlink support (CAN_DEV [=y])
< > Microchip MCP251x SPI CAN controllers
然后在arch/arm/mach-exynos/mach-itop4412.c中注释了
- /*
- sclk = clk_get(spi2_dev, "dout_spi2");
- if (IS_ERR(sclk))
- dev_err(spi2_dev, "failed to get sclk for SPI-2\n");
- prnt = clk_get(spi2_dev, "mout_mpll_user");
- if (IS_ERR(prnt))
- dev_err(spi2_dev, "failed to get prnt\n");
- if (clk_set_parent(sclk, prnt))
- printk(KERN_ERR "Unable to set parent %s of clock %s.\n",
- prnt->name, sclk->name);
- clk_set_rate(sclk, 800 * 1000 * 1000);
- clk_put(sclk);
- clk_put(prnt);
-
- if (!gpio_request(EXYNOS4_GPC1(2), "SPI_CS2")) {
- gpio_direction_output(EXYNOS4_GPC1(2), 1);
- s3c_gpio_cfgpin(EXYNOS4_GPC1(2), S3C_GPIO_SFN(1));
- s3c_gpio_setpull(EXYNOS4_GPC1(2), S3C_GPIO_PULL_UP);
- exynos_spi_set_info(2, EXYNOS_SPI_SRCCLK_SCLK,
- ARRAY_SIZE(spi2_csi));
- }
- for (gpio = EXYNOS4_GPC1(1); gpio < EXYNOS4_GPC1(5); gpio++)
- s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV3);
- spi_register_board_info(spi2_board_info, ARRAY_SIZE(spi2_board_info));
- */
复制代码 然后在I2C6中添加部分代码:
- static struct i2c_board_info i2c_devs6[] __initdata = {
- {
- I2C_BOARD_INFO("mpu9250", MPU9250_ADDRESS>>1),
- },
- };
复制代码 然后用视频里的方法发送数据,然后下面是错误信息:
[root@iTOP-4412]# insmod i2c6_9250.ko
[ 30.696430] ==i2c_mpu9250_init:
[ 30.698349] ==i2c_mpu9250_probe:
[ 35.710029] s3c-i2c s3c2440-i2c.6: timeout waiting for bus idle
[ 35.714526] mpu9250 who am i ret value is 0
[root@iTOP-4412]# insmod i2c6_9250.ko
insmod: can't insert 'i2c6_9250.ko': File exists
[root@iTOP-4412]# rmmod i2c6_9250
[ 45.833934] ==i2c_mpu9250_exit:
[ 45.835786] ==i2c_mpu9250_remove:
[root@iTOP-4412]# insmod i2c6_9250.ko
[ 47.618201] ==i2c_mpu9250_init:
[ 47.620257] ==i2c_mpu9250_probe:
[ 51.620152] s3c-i2c s3c2440-i2c.6: cannot get bus (error -110)
[ 55.620040] s3c-i2c s3c2440-i2c.6: cannot get bus (error -110)
[ 55.624500] read reg (0x75) error, -121
[ 55.628228] mpu9250 who am i ret value is 255
[root@iTOP-4412]# rmmod i2c6_9250
[ 56.911676] ==i2c_mpu9250_exit:
[ 56.913568] ==i2c_mpu9250_remove:
另外我发现开发板上电启动后,I2C6的SCL一直的低电平。
我现在束手无策,请问我应该超哪个方向解决,是可能还有驱动占用着I2C6的部分,还是其他什么原因。。谢谢
|
|
|
|
|
|
|
|
发表于 2019-5-15 11:31:39
请问你现在解决了这个问题吗 我现在也有这个问题的困扰 |
|
|
|
|
|
|
|
发表于 2020-1-9 15:41:54
视频31的代码在我板子运行时出现错误,menuconfig和平台文件都已经按照视频操作了,还是出错,请问是因为什么呢 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|
|
|
|
|
|
|
发表于 2020-8-29 15:50:20
视频31的代码在我板子运行时出现错误,menuconfig和平台文件都已经按照视频操作了,还是出错,请问是因为什么呢 |
|
|
|
|
|
|
登录或注册
扫一扫关注迅为公众号
![群号652692981](template/rabbit_office/image/wchat.png)
![](static/image/common/security.png)
|