I2C2 stops working when plugging in any serial device in GPS2 in Cubepilot Cube Orange

Hello,

I have a Cube Orange with PX4-Autopilot firmware (tested 1.13.3 and 1.14). I am trying to connect a Lightware SF11 rangefinder using the I2C2 port.
This works fine and the data can be viewed e.g. in QGroundControl. However, as soon as I plug in anything into the GPS2 port like a telemetry or GPS device, even the included buzzer, the I2C communication stops working and only reports erros from then on out.

nsh> lightware_laser_i2c status
INFO  [SPI_I2C] Running on I2C Bus 2, Address 0x66
lightware_laser_i2c: read: 32215 events, 9600150us elapsed, 298.00us avg, min 101us max 1909us 16.778us rms
lightware_laser_i2c: com err: 662 events

Also, this is the output before and after plugging in the serial device, it seems that the I2C device isn’t even detected anymore:

Before:

nsh> i2cdetect -b 2
Scanning I2C bus: 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- 66 -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

After:

nsh> i2cdetect -b 2
Scanning I2C bus: 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Further findings:

  • When I plug in the serial device, in this case SimpleRTK3B, into the TELEM1 port, everything works fine
  • When I plug it in the TELEM2 port, the I2C communication stops shortly but the resumes to work
  • Using the I2C port in the GPS1 port also works fine and no errors occur when the serial device is plugged into the GPS2 port

Sadly, I can’t use the GPS1 port’s I2C connection because all the serial ports are already occupied (2x telemetry, 1x microRTPS bridge to companion computer, 1x GPS).

I would greaty appreciate any ideas on how to fix or even debug this problem further. If you have any suggestions please let me know, thanks in advance.

Greetings,
Andy

Attachments:

QGroundcontrol recording 1: Rangefinder plugged in and works, then serial device gets connected to GPS2 and only error occur from that point onwards
px4_default_then_plug_gps2
QGroundcontrol recording 2: Rangefinder plugged in and works, at Count: 837 serial device gets plugged into GPS2 => so more messages, then it gets unplugged again and at Count: 866 it gets plugged into TELEM2 => it hangs shorty, then we gat a faulty message with current_distance: 13000 and the the rangefinder resumes to work correctly
screen-capture

Hello,

I am running into a similar issue, were you able to figure a solution for this? I was able to fix it by disconnecting the SCL and SDA cables on the connector plugging into GPS2

I’m looking into this. @madhuareti what GPS are you connecting to GPS2? Just so I can try to reproduce it correctly.

Ok, I think I understand what is going on here.

If we look at the connector pinout of GPS2 (see docs), we see that I2C 2 bus is not only brought out in the I2C connector but also in the GPS 2 connector in pin 4 and 5.

In the case of @agreiner and @madhuareti what happens is that the device plugged in is interfering with these two I2C bus lines:

  • Telemetry: this has port 4 and 5 used as flow control (CTS, RTS), so that is definitely going to interfere.
  • Included buzzer: I’m not sure on that one, I’d have to know what is connected there, but if the buzzer uses pin 4 and 5 that would be problematic and not work.
  • GPS device: this one should work if the GPS has the pinout mentioned above. If it has something else connected on pin 4 and 5, that will again interfere.

I have tested this on my bench with an airspeed sensor connected to the I2C port and a GPS with external mag connected to the GPS 2 port. Both, the airspeed sensor and the external mag, work as expected. They both show up on I2C 2. This tells me the pinout is correct and should be working as expected.

nsh> i2cdetect -b 2
Scanning I2C bus: 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1e --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 -- -- -- -- -- -- -- -- --

I have a Holybro telemetry module connected in that port. So, my issue was fixed by changing the connector itself.

1 Like