cancel
Showing results for 
Search instead for 
Did you mean: 

I can't find the PULL UP menu in STM32CubeMx. (to use i2c1)

dKim.1
Associate II

Hi All

I have simple question about STM32CubMX.

I use the STM32F103RBT and test the i2c with eeprom.

When I set the pin for i2c, I should change the GPIO Pull-up/Pull-down in STM32FCubMx.

But This menu is not in STM32FCubMX.

I don't connect external pull up in hardware, to use internal pull up.

Below is my STM32FCubMx GPIO set Menu.

0693W000007ERMPQA4.png

I can't use internal pull-up ??

Please help me.

Thank you.​

1 ACCEPTED SOLUTION

Accepted Solutions
Khouloud ZEMMELI
ST Employee

Hello @dKim.1​ 

Thanks for raising the question,

Actually, for the F1 serie the Pull parameter is only used with Input, Event and IT modes.

In the case of I2C, which has the Alternate function Open Drain as GPIO mode, only speed and mode are requested and needed, so the pull parameter is not supported (as mentioned in the part of code below from the stm32f1xx_hal_gpio.c) and for this reason the GPIO pull-up/pull-down panel in I2C GPIO settings is empty.

case GPIO_MODE_AF_OD:
          /* Check the GPIO speed parameter */
          assert_param(IS_GPIO_SPEED(GPIO_Init->Speed));
          config = GPIO_Init->Speed + GPIO_CR_CNF_AF_OUTPUT_OD;
          break;

Hope my answer helped you, when your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Thanks again, Khouloud

View solution in original post

2 REPLIES 2
Khouloud ZEMMELI
ST Employee

Hello @dKim.1​ 

Thanks for raising the question,

Actually, for the F1 serie the Pull parameter is only used with Input, Event and IT modes.

In the case of I2C, which has the Alternate function Open Drain as GPIO mode, only speed and mode are requested and needed, so the pull parameter is not supported (as mentioned in the part of code below from the stm32f1xx_hal_gpio.c) and for this reason the GPIO pull-up/pull-down panel in I2C GPIO settings is empty.

case GPIO_MODE_AF_OD:
          /* Check the GPIO speed parameter */
          assert_param(IS_GPIO_SPEED(GPIO_Init->Speed));
          config = GPIO_Init->Speed + GPIO_CR_CNF_AF_OUTPUT_OD;
          break;

Hope my answer helped you, when your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Thanks again, Khouloud

Thanks for your answer.

I used external pull-up.