STM32F103C, I2C_ErrorCode 4 with MPU6050
Hello,
I setup i2c1 as per below. I am trying to get data from a MPU6050 device on I2C but I got error code 4.
On the same hardware I tested using Arduino IDE and I can read data from MPU without problems.
Can one support please guide me where should I look for the problem?
I2C configuration:
hi2c1.Instance = I2C1;
hi2c1.Init.ClockSpeed = 100000;
hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
hi2c1.Init.OwnAddress1 = 0;
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;
My test code called after MX_I2C1_Init() call:
uint8_t Check=0x00;
HAL_I2C_Mem_Read(&hi2c1, 0x68, 0x75, 1, &Check, 1, HAL_MAX_DELAY);
