Home automation V4 ioplus card hangs i2c bus with "SDA stuck at low"

GordDel

New member
My ioplus V4 card will eventually hang the i2c bus with a "SDA stuck at low" kernel error when being polled. This requires a power-cycle of the Pi/ioplus to recover the system (ie: just rebooting the Pi doesn't clear the hangup). I've tried the ioplus card on 3 Pi's (Pi5/8GB, Pi5/4GB, Pi4/2GB), and 2 different Bookworm kernels (6.6.31 and 6.1.0 both 64-bit) without resolving the problem. The PI's have no other peripherals and are powered with a Pi 27-watt USB supply. The failure occurs regardless of the polling speed and generally happens in between 2000-10000 card accesses.

ioplus board info: Hardware 04.00, Firmware 01.34, CPU temperature 31 C, voltage 3.31 V

I've written a small bash script ("test3") to demonstrate the problem:
#!/bin/bash
#
delay=0.100
cnt=0
echo `date +"%Y%m%d-%H%M%S "` "Starting i2c ioplus polling test. Rate: $delay seconds"
echo "Starting i2c ioplus polling test. Rate: $delay seconds" | logger -i
while [ true ]
do
/usr/local/bin/ioplus 0 optrd >/dev/null
if [ $? != 0 ]; then
echo `date +"%Y%m%d-%H%M%S "` "i2c ioplus test failed after $cnt passes."
echo "i2c ioplus test failed after $cnt passes." | logger -i
exit
fi
((cnt+=1))
sleep $delay
done
exit


Here is a sample test result:
root@RPi-Test1:/usr/local/ioplus-rpi# ./test3
20240819-131333 Starting i2c ioplus polling test. Rate: 0.100 seconds
20240819-132705 i2c ioplus test failed after 7893 passes.
root@RPi-Test1:/usr/local/ioplus-rpi# journalctl --since "-1h" | grep i2c
Aug 19 13:13:33 RPi-Test1 root[126209]: Starting i2c ioplus polling test. Rate: 0.100 seconds
Aug 19 13:27:05 RPi-Test1 kernel: i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: SDA stuck at low
Aug 19 13:27:05 RPi-Test1 root[143126]: i2c ioplus test failed after 7893 passes.
Aug 19 13:27:06 RPi-Test1 kernel: i2c_designware 1f00074000.i2c: timeout in disabling adapter


and another:
...
Aug 18 12:52:43 RPi-Test1 root[3313]: Starting i2c ioplus polling test. Rate: 0.010 seconds
Aug 18 12:53:15 RPi-Test1 kernel: i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: SDA stuck at low
Aug 18 12:53:15 RPi-Test1 root[8234]: i2c ioplus test failed after 2437 passes.
Aug 18 12:53:16 RPi-Test1 kernel: i2c_designware 1f00074000.i2c: timeout in disabling adapter


I'm not sure if I have a defective ioplus board, or if something else is at play.
Anyone with thoughts?

Gord
 

alexburcea

Moderator
Staff member
Hi,
This is a strange thing that has not been reported before. We will look into that and let you know. Could you try to increase the speed of the Raspberry I2C port to 1M and test again?

Alex
 

GordDel

New member
Thanks, Alex. I added the ",i2c_arm_baudrate=1000000" parameter to config.txt and retested. It's still running clean after 90 minutes at 50 msec cycles so about 108K passes without error. Very much improved! I'll post an update later with longer term results. A quick question - some docs imply that 400K is the maximum baudrate - is 1M really valid, or does that just force whatever the maximum is for the Pi hardware?

Thanks again,

Gord
 

alexburcea

Moderator
Staff member
I am glad you got better results, anyway, I need to dig into it because not everybody can increase the I2C speed because they might have devices that do not support it. I must reproduce the problem and find at least a way to recover when happens.
The 1M is the maximum supported by the microcontroller on the card and as far as I know by the Raspberry Pi.

Alex.
 

GordDel

New member
Hi, Alex. I've been testing for almost 24 hours at a 5 msec cycle and have had no problems. I'm going to consider this issue closed for me and leave the i2C speed at 1M.

Thanks again for the help.

Gord
 
Top