I have this problem driving me insane the last couple of weeks.
My setup is:
Arduino Due (genuine)
Adafruit MTK3339 GPS
Adafruit 10DOF IMU
The IMU is connected to pin 20 and 21 (SCL, SDA) on the Due. I'm powering the IMU with 3.3V, so the lever shifter in the IMU is not active.
The GPS is connected to the Serial2, powered by 3.3V, using 9600 baud setting, only NMEA $GPRMC sentence active.
I have a test sketch reading the IMU sensors (rate, acceleration, magnetic, pressure), and reading the GPS NMEA sentence.
Occasionally (<5 min) the I2C communication fails when calling endTransmission(), returns code 2, and I need to power cycle the entire thing to get it up and running again. This seems to occur when the GPS sends its message. If I tell the GPS to be silent, but still active, I never see this issue (running four hours, reading sensors at around 200 Hz).
I have tried different I2C frequencies, different GPS NMEA output rates and baud rates. Nothing help. I have tried to separate the I2C lines as far as possible from the serial lines (in case of EMC issue). Added capacitor to the 3.3V (voltage taken from the Due). No difference.
I have been diving in the Arduino code libs after clues - the Wire/TwoWire/TWI code is a bloody mess. But obviously it works when the GPS isn't sending NMEA.
I'm using 1.5.8, so the Wire library fix shall be included.
Please advice before I permanently goes insane and take up knitting as a hobby instead.
Let me know what else information you need.