MLAB-project / pymlab

Library for interfacing with MLAB modules in Python
https://www.mlab.cz
GNU General Public License v3.0
10 stars 1 forks source link

ODROID I2C IOError #9

Closed kakl closed 8 years ago

kakl commented 8 years ago

After a while I2C input and output operations with this code https://github.com/MLAB-project/pymlab/commit/8d32f31cc9e8aa3c85a3b86bfbade359b82fd8b2 an error ocured:

(most recent call last): File "./ble.py", line 92, in spi.SPI_write_byte(spi.I2CSPI_SS0, 0x39) File "/home/odroid/git/pymlab/src/pymlab/sensors/bus_translators.py", line 53, in SPI_write_byte self.bus.write_byte_data(self.address, chip_select, data) File "/home/odroid/git/pymlab/src/pymlab/sensors/init.py", line 220, in write_byte_data return self.driver.write_byte_data(address, register, value) File "/home/odroid/git/pymlab/src/pymlab/sensors/iic.py", line 106, in write_byte_data return self.smbus.write_byte_data(address, register, value) IOError: [Errno 11] Resource temporarily unavailable

After that the I2C is permanently unavailable.

kakl commented 8 years ago

dmesg: [ 318.150578@0] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0xd [ 318.159435@0] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0xd [ 318.168334@0] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0xe [ 318.177130@0] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0xe [ 318.186008@0] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0xe [ 318.194902@0] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0xf [ 318.203704@0] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0xf

kakl commented 8 years ago

I found this issue: http://forum.odroid.com/viewtopic.php?f=115&t=12366

kakl commented 8 years ago

It was solved by kernel Linux odroid 3.10.80-134 #1 SMP PREEMPT Wed Nov 25 04:52:16 BRST 2015 armv7l armv7l armv7l GNU/Linux

syslog after patch: [39839.169090@1] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0x2e [47051.804139@1] i2c i2c-1: Controller Error! manual_en = 0, ack_ignore = 1 [47051.805254@1] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0x2e [47192.952977@1] i2c i2c-1: Controller Error! manual_en = 0, ack_ignore = 1 [47192.954092@1] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0x2e [47288.975176@1] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0x2e [47366.221540@0] i2c i2c-1: Controller Error! manual_en = 0, ack_ignore = 1 [47366.222665@0] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO) token 1, master_no(1) 100K addr 0x2e [47374.911466@0] i2c i2c-1: Controller Error! manual_en = 0, ack_ignore = 1