Skip to main content
Graduate
September 21, 2024
Solved

STM32G030 is support I2C master?

  • September 21, 2024
  • 3 replies
  • 1642 views

Have an issue with connection I2C sensor to STM32G030 chip. 

Function HAL_I2C_IsDeviceReady alvais return HAL_ERROR. 

Looks like this controller are not support I2C master, but documentation said:

Features of the I2C peripheral:

I2C-bus specification and user manual rev. 5 compatibility:

Slave and master modes, multimaster capability

 

 

    This topic has been closed for replies.
    Best answer by TDK

    Yes, of course it does I2C master.

     

    HAL_I2C_IsDeviceReady returns HAL_ERROR if your device does not respond. Perhaps you are not using the correct slave address, or the slave is not powered or otherwise hooked up right. Slave addresses should be left-shifted by one bit.

    3 replies

    TDKAnswer
    Super User
    September 21, 2024

    Yes, of course it does I2C master.

     

    HAL_I2C_IsDeviceReady returns HAL_ERROR if your device does not respond. Perhaps you are not using the correct slave address, or the slave is not powered or otherwise hooked up right. Slave addresses should be left-shifted by one bit.

    BigdanAuthor
    Graduate
    September 21, 2024

    It's looks strange because I checked on STM32F401 and there works fine, sensor detected.  So, I know exactly the i2c sensor address and wires connected correct. Also checked signals SDA and SCL using oscilloscope, they show nothing. Looks like I2C are not started or it in slave mode and waiting for master start communication 

    BigdanAuthor
    Graduate
    September 21, 2024

    Add configuration screen of STM32G030.

    Screenshot 2024-09-21 at 20.39.07.png

     

    Have a two boards with this chip and for both I2c are not worked. 

    Also add config of STM32F401. Where i2c works. There MASTER section present. In STM32G030 no MASTER section.

    Screenshot 2024-09-21 at 20.37.45.png

     

    Super User
    September 22, 2024

    The peripheral is different and so the configuration screen is different. But it can be an I2C master. Perhaps share your code. What does HAL_I2C_IsDeviceReady return?

    BigdanAuthor
    Graduate
    September 22, 2024

    Found the issue. First one SDA pin was interrupted by jumper. Main purpose of this pin use for external oscillator, Second one, device address specified  by manufacture need shift to one bit (((.