STM32G491 restarts when using I²C
Hi,
I am having a problem with a unexpected restart.
The first time I use the I²C bus by invoking HAL_I2C_Master_Transmit, the MCU restarts after reaching this line:
line 7276 of stm32g4xx_hal_i2c.c
/* update CR2 register */
MODIFY_REG(hi2c->Instance->CR2, \
((I2C_CR2_SADD | I2C_CR2_NBYTES | I2C_CR2_RELOAD | I2C_CR2_AUTOEND | \
(I2C_CR2_RD_WRN & (uint32_t)(Request >> (31U - I2C_CR2_RD_WRN_Pos))) | \
I2C_CR2_START | I2C_CR2_STOP)), tmp);
It just goes straight to the reset handler, no hard fault is triggered. I am using I2C1, and that shares the BOOT0 pin with I²C1-SCL, but that should be irrelevant, as we are already running in the user code. I'm really at loss what is going on here. I appreciate any suggestions.
