2016-07-04 06:52 AM
Hi,
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. #hal #can #canbus #i2c #stm322016-07-05 06:58 AM
Hi safikhani.arman,
Would you mention the device you are using , and I2C transfer type you have done ( polling, interruption or DMA) ? -Hannibal-2017-07-02 02:22 AM
any luck?
i have the same issue with USB CDC & MPU 6050, using I2C
polling.
2017-07-02 07:17 AM
Try to put I2C interrupt priority higher than can interrupt. = lower level. This to check if it is a timing issue. Otherwise, check for signal crosstalk on pcb generating glitches.