STM32F4 I2C Not Recognizing Ack

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

RedEyer
Posts: 3
Joined: Sun Aug 07, 2016 4:16 pm
Has thanked: 1 time

Re: STM32F4 I2C Not Recognizing Ack

Post by RedEyer »

Hi,

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!
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F4 I2C Not Recognizing Ack

Post by Giovanni »

Hi,

I am glad it is solved, however it is not like I helped much, I don't have any HW where I am now (small vacation),

Anyway I2C is tricky, there is an history of problems caused by unexpected sources.

Giovanni
Post Reply