cancel
Showing results for 
Search instead for 
Did you mean: 

GPIOs configurations in low-power Standby Mode: STM32G0B1RET

Kmax18
Senior II

I am using this MCU on a battery-supplied custom board: STM32G0B1RET.
I am looking for clarification re. the GPIO availability in Standby Mode.
Table 26 in Reference Manual RM0444 (see below) seems to offer one of two (exclusive) possibilities:

  1. Without wakeup capability: wakeup pins are not available, but I/Os can be configured with internal pull-up, pull-down or floating. That would mean a GPIO pin can be assign 0 in Standby Mode.
  2. With wakeup capability: wakeup pins are available, but GPIOs cannot be configured and are floating.

Please confirm. Thank you!

Kmax18_1-1741959775481.png

 

 

 

 

6 REPLIES 6
TDK
Guru

Third option:

All GPIOs can be configured with internal pull-up, pull-down or floating. Out of those pins, 5 (6?) of them have an additional wakeup capability which can be used in addition to the pullups.

 

TDK_0-1741962714605.png

 

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

Thank you, @TDK.

The solution that you suggested sounds exactly what I am looking for. I attempted to implement that, please see the below code snippet.  However, the result is not what I expected.

I expected that the GPIO pin PC4 is LOW (pull-down) after entering the low-power Standby Mode. However, entering Standby Mode does the opposite, it pulls the output up to HI.
Please advise what is wrong with my code, or what is missing. Thank you!

PWR->CR3 |= (0xFFFF & PWR_CR3_APC);       // Set APC bit 10
PWR->PDCRC |= (0xFFFF & PWR_PDCRC_PD4);   // Set pull-down bit PD4 for pin PC4
/* Wakeup source: enable the WakeUp6 Pin PB5 with PWR_WAKEUP_PIN6_LOW, i.e.
 * with a falling edge */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN6_LOW);

/* Clear all related wakeup flags*/
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF6);

/* Enter the Standby mode */
HAL_PWR_EnterSTANDBYMode();

 

Pull is weak check pdf, typic around >15k. In standby only RTC pins can drive low.

What is your chip part number?

TDK_0-1742075568485.png

 

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

Thank you, @TDK. I am using this MCU on a battery-supplied custom board:
STM32G0B1RET.

Thank you, @MM..1!
Sorry, I am not familiar with the acronym 'pdf'. Is it ?pull-down frequency'? And it should be > 15 kHz?
If Standby Mode is not suitable, is the low-power Shutdown Mode an option, or another mode?
Thanks!