cancel
Showing results for 
Search instead for 
Did you mean: 

i2c slave transmission

AH.21
Associate

Hello All.

I am trying to establish an I2C communication between STM32F091VCT6 which is configured as a slave and another controller as a master.

I am trying to send data in blocking mode and facing certain issues. I am able to verify an address acknowledgement from stm and able to send a test 1 value data.

I see an issue while transmitting multiple data in a buffer. Using breakpoints, I can see that the code is stuck checking TXIS flag, which never seems to be set and eventually gets timed out.

Any support will be helpful.

I2C initialization code:

hi2c1.Instance = I2C1;
  hi2c1.Init.Timing = 0x00101D2D;
  hi2c1.Init.OwnAddress1 = 90;
  hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
  hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
  hi2c1.Init.OwnAddress2 = 0;
  hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
  hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
  hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_ENABLE;
  if (HAL_I2C_Init(&hi2c1) != HAL_OK)
  {
    Error_Handler();
  }
  /** Configure Analogue filter 
  */
  if (HAL_I2CEx_ConfigAnalogFilter(&hi2c1, I2C_ANALOGFILTER_DISABLE) != HAL_OK)
  {
    Error_Handler();
  }
  /** Configure Digital filter 
  */
  if (HAL_I2CEx_ConfigDigitalFilter(&hi2c1, 0) != HAL_OK)
  {
    Error_Handler();
  }

Thanks in advance.

1 REPLY 1
AH.21
Associate

0693W000003RpaBQAS.jpg0693W000003RpZNQA0.jpgSDA and SCL lines- 1st image single data and 2nd image buffered data