Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

raspberry pi - How to use I2C slave EEPROM backend

I have a raspberry pi3 and a working board. I'd like one as a i2c master(pi3), and another one is slave(working board). I'd like to read/write to working board from pi3.

I found it on the Internet. https://www.spinics.net/lists/linux-i2c/msg30208.html

Following this steps. I set CONFIG_I2C_SLAVE=y, CONFIG_I2C_SLAVE_EEPROM=y and CONFIG_I2C_CHARDEV=y to kernel of my working board, and set

# echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device
[  233.396818] i2c i2c-5: new_device: Instantiated device slave-24c02 at 0x64
#

I ran the i2cdetect. I can see the 0x64 device from my working board, but my pi3 can not see it.

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

I just connect SDA1 and SCL1 to working board from pi3.

How to fix it?

my pi3 kerenl: 4.19.97-v8(buildroot-2020.02.8)

Thanks

question from:https://stackoverflow.com/questions/65938035/how-to-use-i2c-slave-eeprom-backend

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...