cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO going to zero in STOP3 Mode even if connected with internal pull-up STM32U5A5

gianmarco.cerutti
Associate II

Hello,

I'm developing an application on the NUCLEO-U5A5ZJ-Q. I need some pins to stay high while the microcontroller is in Stop3 mode.

The Datasheet suggests to use internal pull ups, because the GPIO peripheral is not active in Stop3 mode. For this reason, I have configured the GPIO as input and with internal pull-up before entering Stop3 mode.

I've used the following functions:

 

 

 LL_GPIO_SetPinPull(GPIOC, LL_GPIO_PIN_6, GPIO_PULLUP); 
 LL_GPIO_SetPinMode(GPIOC, LL_GPIO_PIN_6, LL_GPIO_MODE_INPUT);

 

It works and the pin stays high. However, whenever the microcontroller go into Stop3 mode, the GPIO voltage goes to zero.

Any Idea? Am I missing something?

Thank you in Advance

1 ACCEPTED SOLUTION

Accepted Solutions
Sarra.S
ST Employee

Hello @gianmarco.cerutti

Please check whether the APC bit in the PWR_APCR register is setAccording to RM, the I/O state in stop3 mode is determined by this bit

If the APC bit is set, the I/Os can be configured either with a pull-up (see PWR_PUCRx registers), or with a pull-down (see PWR_PDCRx registers), or can be kept in an analog state if none of the PWR_PUCRx or PWR_PDCRx register is set.

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.

View solution in original post

2 REPLIES 2
Sarra.S
ST Employee

Hello @gianmarco.cerutti

Please check whether the APC bit in the PWR_APCR register is setAccording to RM, the I/O state in stop3 mode is determined by this bit

If the APC bit is set, the I/Os can be configured either with a pull-up (see PWR_PUCRx registers), or with a pull-down (see PWR_PDCRx registers), or can be kept in an analog state if none of the PWR_PUCRx or PWR_PDCRx register is set.

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.

Thank you for your answer.

Yes the problem was not configuring the Pull Up through the PWR_PUCRx register but through the GPIO peripheral.

I write here a snippet of code that worked for me.

 

	SET_BIT(PWR->APCR, PWR_APCR_APC);
	HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_C, GREEN_LED_Pin);

Best Regards