HAL_I2C_IsDeviceReady timeout w/ eeprom
I've been using a Microchip I2C eeprom in a commercial product that uses an F730 for a bit over a year. I've been using the same code to flash hundreds of units and have never had any issues.
I've opened up my project recently and got prompted for an update by STM32CubeIDE, after which I've migrated my project to the latest fw package. I don't know if my issue is related to the update or if it's simply a coincidence.
My code now hangs during HAL_I2C_IsDeviceReady() and the I2C device never gets initialized and timeout eventually happens.
I tried launching a new barebones project with just I2C configured and I get the same results.
This is all I'm trying to do:
while (HAL_I2C_IsDeviceReady(&hi2c1, 0xA0, 2, 100)!=HAL_OK);Here's the init code from Cube:
/**
* @brief I2C1 Initialization Function
* @param None
* @retval None
*/
static void MX_I2C1_Init(void)
{
/* USER CODE BEGIN I2C1_Init 0 */
/* USER CODE END I2C1_Init 0 */
/* USER CODE BEGIN I2C1_Init 1 */
/* USER CODE END I2C1_Init 1 */
hi2c1.Instance = I2C1;
hi2c1.Init.Timing = 0x00100003;
hi2c1.Init.OwnAddress1 = 0;
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_DISABLE;
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();
}
/* USER CODE BEGIN I2C1_Init 2 */
/* USER CODE END I2C1_Init 2 */
}I'm really stumped. I swear this was working just a couple weeks ago and I haven't touched anything beyond updating and migrating to the latest fw package.
For what it's worth, I have the same issue using an L0 and the same eeprom on a product prototype I'm working on.
Any clue or help is appreciated! Thank you!
