cancel
Showing results for 
Search instead for 
Did you mean: 

Datasheet and CubeMX not matching with pin alternate functions

JS8
Senior

Hi,

I have a project involving an STM32F030C8T6 MCU. The datasheet says that pin PF0-OSC_IN and PF1-OSC_OUT have I2C1_SDA and I2C1_SCL as their Alternate Functions. When I go CubeMX to select them as such, it doesn't give me an option to do so, even though the datasheet says that it should be possible? How can I set them as I2C pins? If it's not possible in CubeMX, how can I manually do it in software? If that's not possible, could I be constantly reading the value on unused I2C pins and setting PF0 and PF1 to their values, because my I2C bus is already on PF0 and PF1. I was trusting the datasheet.

Thank you for help.

3 REPLIES 3
Peter BENSCH
ST Employee

Welcome @JS8, to the community!

You can trust the data sheet, but you have overlooked a footnote in column Alternate functions and under table 11:

  • PF0-OSC_IN (PF0) --> alternate function: I2C1_SDA (5)
  • PF1-OSC_OUT (PF1) --> alternate function: I2C1_SCL (5)

And this footnote (5) says:

5. For STM32F030xC devices only.

Since you are using an STM32F030C8T6, which is to be understood as STM32F030x8, your STM32 provides the functions I2C1_SDA and I2C1_SCL not on PF0 (pin 5) and PF1 (pin 6) but on PB6 (pin 42) and PB7 (pin 43).

I'm very sorry, but I can't give a more positive answer.

Hope that helps anyway?

Good luck!
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks for the response, Peter.

PB6 and PB7 are not in use in my circuit board. Would it be possible to use those pins as I2C, but then constantly update the state of PF0 and PF1 to match those of PB6 and PB7?

There's no way to connect PF0/PF1 to PB6/PB7 internally, or to mirror their states at the speed that you would need.

Software emulation of I2C is possible.

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