I found the root of evil
Something wrong with my logic analyzer. There are 3.3V 0.8 mA on the all channel of my logic analyzer.
I wrote this code:
Code: Select all
while (1){
ret = i2cMasterTransmitTimeout(&I2CD1, MPU6050_ADDRESS_AD0_LOW, g_addr, sizeof(g_addr), g_data, sizeof(g_data), TIME_INFINITE);
if(ret != MSG_OK){
palSetPad(GPIOD, GPIOD_LED5);
chThdSleepMilliseconds(delay);
palClearPad(GPIOD, GPIOD_LED5);
chThdSleepMilliseconds(delay);
}
else if(ret == MSG_OK){
palSetPad(GPIOD, GPIOD_LED6);
chThdSleepMilliseconds(delay);
palClearPad(GPIOD, GPIOD_LED6);
chThdSleepMilliseconds(delay);
}
chThdSleepMilliseconds(delay);
}
So, when i2cMasterTransmitTimeout() returns error, the red LED is blinking, if success the blue LED is blinking.
When I disconnected my logic analyzer - the blue LED starts blinking, when connect - the red LED starts blinking.
Result - the logic analyzer influences on I2C bus.
Giovanni, thanks for your answers!