raspberry pi3 - SMBUS on the RPI gives IOError: [Errno 121] Remote I/O error -
i have tried communication between rpi3 , stm32 on i2c. first of have installed i2c-tools , python-smbus. in have used python script on rpi below:
import smbus bus = smbus.smbus(1) address = 0x0a data = [1,2,3,4,5,6,7,8] bus.write_i2c_block_data(address, 0, data) when run script, can see following error:
ioerror: [errno 121] remote i/o error stm32 configured i2c slave, both device connected correctly(sda, scl , gnd). how know that? have made program using bcm2835 library. c program worked correctly. c program sent buffer without errors. stm32 received buffer without errors. can tell me, have been doing wrong?
thank in advance.
i ran same problem. figured out error code 121 stated when none of slaves acks command send master. happens if trying contact not used address or command not slaves expect.
in case tried send reset command tlc59116. these ics expect command "0xa5 0x5a" on address 0x6b.
so tried send similar snippet yours:
import smbus bus = smbus.smbus(0) address = 0x6b data = [0xa5,0x5a] bus.write_i2c_block_data(address, 0, data) but in raw communication command leads msg [0x00 0xa5 0x5a], leading start address, these ics did not allow , answer correct nack -> error 121.
o.t.: solved problem sending
bus.write_data(address,0xa5,0x5a)
Comments
Post a Comment