linux - 未检测到 OMAP 3 Linux I2C SMBUS SmartBattery (SBS)

标签 linux linux-kernel embedded-linux battery i2c

我正在使用 OMAP 3730 开发一个嵌入式 Linux 项目。我们使用的是 3.2.23 版本的内核。 I2C 工作正常,我可以在总线 #2 上看到板上的各种传感器。 I2C 总线 #3 仅连接了一个智能电池,我可以拔掉电源线,电池使电路板保持运行。问题是我无法检测或扫描智能电池。我尝试了 i2ctools 中的各种程序,但没有成功。我们将板连接到示波器上,可以看到 3 号总线上的事件。我还在内核中的设备驱动程序 > I2C 支持下启用了每个相关选项。

如何在 i2c 总线上查看我的智能电池?我需要在内核中启用其他功能吗?

Standard SMBus slave address assignments for SBS devices include:
0x10 -- SMBus System Host
0x12 -- Smart Battery Charger
0x14 -- Smart Battery Selector
0x16 -- Smart Battery

# ls /dev/i2c-?
/dev/i2c-1  /dev/i2c-2  /dev/i2c-3

# i2cget -y 3 0x10 0x00 w p
Error: Read failed
# 
# i2cget -y 3 0x0b 0x00 w p
Error: Read failed

# i2cdetect -r 3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-3 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 

# i2cdetect -F 3
Functionalities implemented by /dev/i2c-3:
I2C                              yes
SMBus Quick Command              no
SMBus Send Byte                  yes
SMBus Receive Byte               yes
SMBus Write Byte                 yes
SMBus Read Byte                  yes
SMBus Write Word                 yes
SMBus Read Word                  yes
SMBus Process Call               yes
SMBus Block Write                yes
SMBus Block Read                 no
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes

# i2cdetect -l
i2c-1   i2c         OMAP I2C adapter                    I2C adapter
i2c-2   i2c         OMAP I2C adapter                    I2C adapter
i2c-3   i2c         OMAP I2C adapter                    I2C adapter

最佳答案

解决方案是将电量计芯片所在总线的总线速度降低至 100 KHz。之后我得到:

# i2cdetect -y -r 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- 0b -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

关于linux - 未检测到 OMAP 3 Linux I2C SMBUS SmartBattery (SBS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12116660/

相关文章:

linux - gethostbyname() 有时无法永远 dns

linux - 应该如何调用 init_module (在用户空间中)

android - 选择安卓wifi channel

linux - 使用浏览器和 IP 而不是 DNS 访问服务器

linux - 使用 VC 和 MinGW

linux - 使用模板使用 g++ -std=c++11 创建静态库

在 qstr 结构中找不到哈希引用

无法从 Yocto 为 BeagleBone 编译 Linux 内核 DTSI 文件

c++ - Linux 内存分析工具

linux - 使用awk在top命令中进行字段分隔