cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G030 is support I2C master?

Bigdan
Associate II

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

5 REPLIES 5
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".
Bigdan
Associate II

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 

Bigdan
Associate II

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

 

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?

If you feel a post has answered your question, please click "Accept as Solution".
Bigdan
Associate II

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 (((.