Skip to main content
gkovelman
Associate II
September 7, 2016
Question

STM32F4 - Reinitializing I2C driver

  • September 7, 2016
  • 1 reply
  • 1485 views
Posted on September 07, 2016 at 09:41

Hi,

I'm trying to deinit and then init the I2C driver during runtime of the STM32F411.

I2C1 generally works when initializing the drivers once, but when I deinit and then init them, I get a start-bit timeout - the logic analyzer shows that nothing changes on the SDA/SCL lines after the re-initialization.

I'm using the HAL drivers generated by the STM32CubeMX. To deinit, I'm using HAL_I2C_MspDeInit. To init, I'm using MX_I2C1_Init.

Any suggestion on this problem?

Best regards.
    This topic has been closed for replies.

    1 reply

    gkovelman
    gkovelmanAuthor
    Associate II
    September 7, 2016
    Posted on September 07, 2016 at 09:56

    Disregard this issue - I should have used HAL_I2C_DeInit and not HAL_I2C_MspDeInit.