Showing results for 
Search instead for 
Did you mean: 

Hi, I use CubeIDE to setup STM32G031F6P6 I2C2. I simply check the box for I2C2, see attached. In my circuit, I have pull ups on the I2C lines. However, when I try to send a I2C message, the SCL line shows no clock activity. The SDA line is always low.


I notice that the I2C1 setup in the IDE is different than the I2C2 setup. I will try I2C1 to see if it can work, but how would I get I2C2 working?


Well options there are that whatever else is attached to the bus is clamping them, or not in I2C mode (perhaps some SPI/I2C mode device), or that PA9/PA10 are in some initialized state (USART1) and conflicting with the settings on PA11/PA12

Check all your GPIO pin settings in code, and at register level.

Disconnect other portions of the circuit.

Check for shorts.

Perhaps check driving the GPIOs directly.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..