AnsweredAssumed Answered

I2C and CAN-Bus conflict, Gyro freezes

Question asked by Safikhani.Arman on Jul 4, 2016
Latest reply on Jul 2, 2017 by KIC8462852 EPIC204278916

I'm using MPU-6050 (3-axis gyro and 3-axis accelerometer) and CAN-Bus on a STM32F105 chip.

I'm pulling data from gyro every 100ms, it works fine until I enable Receive Interrupt of CAN1 (In which is connected to car ecu can bus)

I have configured filters for CAN1 to receive only 4-5 can frames, so I don't think the micro is being flooded with CAN frames.

The weird issue is that after a while of working (10 - 20 minutes), the program will freeze on I2C_WaitOnFlagUntilTimeout, seems that the I2C transfer is interrupted or something.

Are CAN1 and I2C1 have conflicts when it comes to receive interrupts of CAN1?
I2C1 is mapped to PB6 (SCL pin) and PB7 (SDA pin) and CAN1 is mapped to PB8 (TX pin) and PB9 (RX pin).

I should mention that if I don't enable the receive interrupt of CAN1, the Gyro works fluently for days!

What can be the cause of this?
If it's necessary to provide some code, please tell me.