title: I can't get data with I2C from mpu6050 on STM32F103
body: <p>I am new I2C communication. I examined some running code. And I used function their used. But I can't get any data. I wonder if I2C have to do initial config? Where is the problem. This is function I wrote:</p>
  
  <pre class="lang-c prettyprint-override"><code>void GetI2CAccelerometer(uint8_t slaveAddress,uint8_t accelData[6])
  {   
      // slaveAddress=0x68 (default address is written in datasheet)  
      HAL_I2C_Master_Transmit(&amp;hi2c1,slaveAddress&lt;&lt;1,1,0x3B,1,200);
      HAL_I2C_Master_Receive(&amp;hi2c1,slaveAddress&lt;&lt;1,accelData,6,200);
      HAL_I2C_Mem_Read(&amp;hi2c1,(slaveAddress&lt;&lt;1)+1,0x3B,1,accelData,1,200);
      // i tried this function too but not working
  }
  </code></pre>
  
  <p>I created this project with CubeMX. This is initial I2C config and also GPIO_A clock line is activated in another function which I did not write:</p>
  
  <pre class="lang-c prettyprint-override"><code>static void MX_I2C1_Init(void) 
  {
      hi2c1.Instance = I2C1;
      hi2c1.Init.ClockSpeed = 100000;
      hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
      hi2c1.Init.OwnAddress1 = 208;
      hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
      hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
      hi2c1.Init.OwnAddress2 = 0;
      hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
      hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
  
      if (HAL_I2C_Init(&amp;hi2c1) != HAL_OK)
      {
          Error_Handler();
      }
  }
  </code></pre>