2017-09-06 07:16 AM
Hello
i using STM32F103ZET6 & STM32CubeMX V4.22.0 & Firmware F1 V1.6
i want Send Data Via I2c But HAL_I2C_Master_Transmit Return HAL_BUSY
i Remove My I2c device (AT24C512) but Still
HAL_I2C_Master_Transmit Return
HAL_BUSY
How can I fix this problem?
Thank
2017-09-06 07:25 AM
Do you have external pull up resistors on the SDA/SCL pins?
2017-09-06 08:07 AM
I thought I found the problem
When I comment on the code below, it works correctly and
HAL_I2C_Master_Transmit
Return HAL_TIMEOUT
__HAL_AFIO_REMAP_I2C1_ENABLE();
but why ?
2017-09-06 09:31 AM
yes i do , i using resistors 10k on sda/scl
But HAL_I2C_Master_Transmit Return HAL_BUSY2017-09-06 09:50 AM
Ok, then look at how the pins vs peripheral are initialized, the F1 parts were always a bit awkward in terms of when the I2C bus was enabled wrt the state of the pins. Not familiar with HAL implementation on the F1.