i2c device issues

Post Reply
IET_DEMO
Posts: 59
Joined: Wed Sep 30, 2015 3:48 am
languages_spoken: english
ODROIDs: U3,Xu4,c1,C1+
Has thanked: 2 times
Been thanked: 0
Contact:

i2c device issues

Post by IET_DEMO »

Hi,

I have an odroid C2 with this relay board plugged on the i2c bus->
https://wiki.seeedstudio.com/Raspberry_ ... oard_v1.0/

Sometimes it disconnects for unknown reasons.
When it happens, i need to disconnect the power cord and plug it back to see the relay shield again.

Is there a way to close the 3v3 on the bus or to hard reset the gpios or the hard reset the i2c devices in any possible way?

I have a lot of these devices so it's not a faulty odroid or faulty relay shield.

There is just something that seems to jam the bus on the i2c device.

I join the log of the kernel when the error occurs.

I am running this version of android on my device, but here is a short example of the errors:

Code: Select all

<3>[287074.114827@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.115013@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x20

<3>[287074.120859@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.126617@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x20

<3>[287074.132425@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.138128@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x20

<3>[287074.144095@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.149685@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x21

<3>[287074.155551@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.161289@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x21

<3>[287074.167089@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.172808@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x21

<3>[287074.178731@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.184374@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x22

<3>[287074.190204@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.195922@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x22

<3>[287074.201768@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.207473@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x22

<3>[287074.213402@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.219030@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x23

<3>[287074.224891@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.230588@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x23

<3>[287074.236441@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.242152@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x23

<3>[287074.248067@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.253718@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x24

<3>[287074.259549@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.265267@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x24

<3>[287074.271106@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.276824@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x24

<3>[287074.282745@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.288375@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x25

<3>[287074.294234@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.299932@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x25

<3>[287074.305818@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.311498@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x25

<3>[287074.317416@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.323065@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x26

<3>[287074.328894@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.334612@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x26

<3>[287074.340452@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.346169@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x26

<3>[287074.352097@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.357720@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x27

<3>[287074.363580@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.369278@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x27

<3>[287074.375131@2] i2c i2c-1: [aml_i2c_xfer] error ret = -5 (-EIO)

<3>[287074.380835@2] i2c i2c-1: token 1, master_no(1) 300K addr 0x27
Androis version
5.1.1

Kernel version
3.14.29

Build number
odroidc2-end5.1.1LMY49M
odroidc2-eng-s905_5.1.1_master-322 test-keys

Thanks.
Attachments
dmesg.log
(412.67 KiB) Downloaded 13 times

User avatar
odroid
Site Admin
Posts: 36930
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1595 times
Been thanked: 1072 times
Contact:

Re: i2c device issues

Post by odroid »

There is no way to close the 3v3 on the bus or to hard reset the gpios or the hard reset the i2c devices.
The i2c -EIO error message appears when an I2C device doesn't send an ACK signal.

Can you capture any voltage changes on the 5Volt and 3.3Volt power rails when the relays turn & off with an oscilloscope?
Are the relays isolated by optocouplers?

IET_DEMO
Posts: 59
Joined: Wed Sep 30, 2015 3:48 am
languages_spoken: english
ODROIDs: U3,Xu4,c1,C1+
Has thanked: 2 times
Been thanked: 0
Contact:

Re: i2c device issues

Post by IET_DEMO »

odroid wrote:
Tue Jan 26, 2021 11:34 am
There is no way to close the 3v3 on the bus or to hard reset the gpios or the hard reset the i2c devices.
The i2c -EIO error message appears when an I2C device doesn't send an ACK signal.

Can you capture any voltage changes on the 5Volt and 3.3Volt power rails when the relays turn & off with an oscilloscope?
Are the relays isolated by optocouplers?
->I can capture voltage for both do i need to connect the oscilloscope on 3v3 and any ground pin?
->I can capture voltage for both do i need to connect the oscilloscope on 5v5 and any ground pin?

Do I need to add optocouplers, if i look at the schema, there seems to be:
https://files.seeedstudio.com/wiki/Rasp ... 20v1.0.pdf

Is there a way to reset(hard reboot) the odroid so it could reset everything?

Let me know what you think.

thank you!

User avatar
odroid
Site Admin
Posts: 36930
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1595 times
Been thanked: 1072 times
Contact:

Re: i2c device issues

Post by odroid »

IET_DEMO wrote:
Wed Jan 27, 2021 12:04 am
->I can capture voltage for both do i need to connect the oscilloscope on 3v3 and any ground pin?
->I can capture voltage for both do i need to connect the oscilloscope on 5v5 and any ground pin?
- Yes
- Yes

I don't think there is any optocoupler on your relay board.
We tested another 8ch relay board long time ago. Each channel on the board had an optocoupler IC PC817.
viewtopic.php?f=97&t=36823&p=273497#p273497
https://www.waveshare.com/w/upload/d/db ... ematic.pdf

IET_DEMO
Posts: 59
Joined: Wed Sep 30, 2015 3:48 am
languages_spoken: english
ODROIDs: U3,Xu4,c1,C1+
Has thanked: 2 times
Been thanked: 0
Contact:

Re: i2c device issues

Post by IET_DEMO »

odroid wrote:
Wed Jan 27, 2021 10:17 am
IET_DEMO wrote:
Wed Jan 27, 2021 12:04 am
->I can capture voltage for both do i need to connect the oscilloscope on 3v3 and any ground pin?
->I can capture voltage for both do i need to connect the oscilloscope on 5v5 and any ground pin?
- Yes
- Yes

I don't think there is any optocoupler on your relay board.
We tested another 8ch relay board long time ago. Each channel on the board had an optocoupler IC PC817.
viewtopic.php?f=97&t=36823&p=273497#p273497
https://www.waveshare.com/w/upload/d/db ... ematic.pdf
Yes but your board was not I2c controlled, where should i add optocoupler on my board to help?
I will post the oscilloscope results later today or tomorrow!

thanks

User avatar
joerg
Posts: 1306
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 82 times
Been thanked: 180 times
Contact:

Re: i2c device issues

Post by joerg »

The PCA9535 is a well known chip that works. I use with my C2 self backed IO boards not with PCA9535 but with 12 x PCF8574. 6 of the boards are with 8 relays controlled without opto coupler. It's normally not possible that this standard chips do not return ACK, means that the level stays low.
The difference at my setup is that I use a level shifter to connect to the i2c devices. And I use mainline kernel. I bet that the root cause is the bad coded amlogic driver on stock kernel. I dealed with this kind of errors in the past. But since I changed to C2 with mainline kernel, I don't have this kind of errors anymore.
Why the driver doesn't reset the I2C lines when this error occurs?
Maybe some tests can be done by you:
If the kernel driver is loadable you can unload and load again, too see if the i2c comes back again.
What happens when the error appears and you disconnect the two wires? It would be interesting if on side of 40p header the levels return to high, or on side of the relay board the levels return to high.
Are you fixed to use Android with stock kernel, or do you can try Armbian with mainline kernel?

IET_DEMO
Posts: 59
Joined: Wed Sep 30, 2015 3:48 am
languages_spoken: english
ODROIDs: U3,Xu4,c1,C1+
Has thanked: 2 times
Been thanked: 0
Contact:

Re: i2c device issues

Post by IET_DEMO »

joerg wrote:
Fri Jan 29, 2021 3:17 am
The PCA9535 is a well known chip that works. I use with my C2 self backed IO boards not with PCA9535 but with 12 x PCF8574. 6 of the boards are with 8 relays controlled without opto coupler. It's normally not possible that this standard chips do not return ACK, means that the level stays low.
The difference at my setup is that I use a level shifter to connect to the i2c devices. And I use mainline kernel. I bet that the root cause is the bad coded amlogic driver on stock kernel. I dealed with this kind of errors in the past. But since I changed to C2 with mainline kernel, I don't have this kind of errors anymore.
Why the driver doesn't reset the I2C lines when this error occurs?

Maybe some tests can be done by you:
If the kernel driver is loadable you can unload and load again, too see if the i2c comes back again.
->Even if i soft reboot the odroid it doesnt works and the driver is embedded inside kernel
What happens when the error appears and you disconnect the two wires? It would be interesting if on side of 40p header the levels return to high, or on side of the relay board the levels return to high.
->the shield is directly connected on the board i can't disconnect any wires.
Are you fixed to use Android with stock kernel, or do you can try Armbian with mainline kernel?
->I absolutely need android on my device.
Honestly i think the 2amps power supply is not enough for my application maybe?
I use the droid Hi-FI shield+ and one or two relay shields at the same time, depending on the application.

IET_DEMO
Posts: 59
Joined: Wed Sep 30, 2015 3:48 am
languages_spoken: english
ODROIDs: U3,Xu4,c1,C1+
Has thanked: 2 times
Been thanked: 0
Contact:

Re: i2c device issues

Post by IET_DEMO »

Hi guys, i've took some reading with the oscilloscope and it doesn't seem to be any drops of voltage on 3v3 or 5v5.
Do you think i should go for a 3 amp power supply?

User avatar
odroid
Site Admin
Posts: 36930
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1595 times
Been thanked: 1072 times
Contact:

Re: i2c device issues

Post by odroid »

If there is no voltage drop at all when all the relays turn on and off frequently, you don't need to use a larger PSU.
But, it is still worth to try a 3 amp or 4 amp PSU to confirm the power budget.

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 10 guests