I2C2 stuck in timeout on STM32L4S9
HW situation is:
I2C2_SCL on PB10 (pin L4)
I2C2_SDA on PB11 (pin M4)
Both have a pull-up resistor of 18K.
The sensor attached to these lines is removed, so nothing is connected.
This is not a dev-board but our own design.
I have generated code through STMcubeMX (version 5.4.0).


Using the internal clock as a source:

I have added to the while loop in main:
status = HAL_I2C_Mem_Read(&hi2c2, 0xA0, 0x0F, I2C_MEMADD_SIZE_8BIT, &id, 2, 100);The program gets stuck at:
static HAL_StatusTypeDef I2C_RequestMemoryRead(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout, uint32_t Tickstart)
{
I2C_TransferConfig(hi2c, DevAddress, (uint8_t)MemAddSize, I2C_SOFTEND_MODE, I2C_GENERATE_START_WRITE);
/* Wait until TXIS flag is set */
if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, Tickstart) != HAL_OK)
{
return HAL_ERROR; //<=== we end-up here
}
And nothing happens on the SCL line, no clock signal. The SDA line is pulled down.
We also tried:
status = HAL_I2C_Master_Transmit(&hi2c2, 0x40, &id, 2, 100);Same result.
It is consistent on several different boards.
Any suggestions? Thanks.