cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble configuring I2C pins in CubeMx

table
Associate

Can someone please explain to me how this is even possible on the same device?

STM32F030C8T6New.png

STM32F030C8T6Old.png

They are the exact same device yet I can not seem to get the same pin config in different projects.
The one project somehow got the PIN Layout where PB6(SCL) and PB7(SDA) is the I2C1 BUT on the other exact same device the I2C1 operates on PB8(SCL) PB7(SDA)?
When I run the I2C1 on the PB8(SCL) PB7(SDA) config it works fine.
When I run the I2C1 on the PB6(SCL) and PB7(SDA) config it does not work.
When I try and reconfig my PB6(SCL) and PB7(SDA) to be PB8(SCL) PB7(SDA) then I can not set PIN8 on the AF register....

1 REPLY 1
Ghofrane GSOURI
ST Employee

Hello @table 

If you activate the USART1 and I2C1 , CubeMX will choose the PA9 and PA10 for USART_TX and USART_RX and  PB6(SCL) and PB7(SDA) (First screenshot).If you manually change USART_TX from PA9 to PB6 you will get the configuration of the second screenshot .Both configuration are correct based on the datasheet 

GhofraneGSOURI_0-1735317942266.png