F446 and I2C-SMBUS HAL problem
Using Cube IDE. Generated a fresh project for a stm32f446ve target.
Activated with CubeMX uinder I2C a port with "SMBUS-two-wire-interface".
Then, without doing nothing more i have builded the configuration and flashed to target.
as soon as i start the mcu, it goes to hardfault.
Further investigation led to a DIVISION_BY_ZERO during SMSUS peripheral initialization (HAL_SMBUS_Init(&hsmbus1) ).
The division by zero arise when doing :
MODIFY_REG(hsmbus->Instance->CCR, (I2C_CCR_FS | I2C_CCR_DUTY | I2C_CCR_CCR), SMBUS_SPEED_STANDARD(pclk1, hsmbus->Init.ClockSpeed));hsmbus->Init.ClockSpeed is not set, nor in the cube-mx i have the entry to input it.
Is that a bug or i am not using correctly that ?
i was succesfull in interfacing a fuel gauge with an F3 (STM32F302) mcu and HAL.
thanks !
