cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G030F6 MCU : Shutdown mode

gailu96
Associate II

Hi Experts,

We are building a battery based product based STM32G030F6 MCU. We are using Arduino environment as we need multiple Arduino libraries for the project.

Well our software is working fine, however we are facing issue with the current consumption. It has to wakeup every 5 seconds and send some data. We are able to put microcontroller in DeepSleep mode using STM32LowPower Library In deepSleep mode it takes around 175uA current. We need to further reduce the current consumption to less 20-25uA. So we are trying to use shutdown mode but not able to use it.

When we use shutdown mode, it still takes 175 uA. When analyzed the code we found that it is falling back to deep sleep mode when it does not found LSE. When LSE is available it tries to call function 

HAL_PWREx_EnterSHUTDOWNMode() 

It is available in Arduino core for STM32. File name stm32g0xx_hal_pwr_ex.c

 
We tried to call this function (with LSI enabled) in library's
LowPower_shutdown() function instead of falling back to deepsleep just to check if the code compiles or not. When compiled we got error 
Spoiler
undefined reference to HAL_PWREx_EnterSHUTDOWNMode
 Before we work out on LSE we have some queries as below. Your help and expert advise is appreciated.
 
1) Does STM32G030F6 supports shutdown mode? (It does not have VBAT pin but based on documentation we believe that VDD will power VBAT) Is our understanding correct?
 
2) Why we get HAL_PWREx_EnterSHUTDOWNMode as undefined reference. Is it not available for STM32G030F6 ?
 
3) How do we properly enable LSE in Arduino environment  after connecting 32KHz crystal on PC14 and PC15 ?
 
1 ACCEPTED SOLUTION

Accepted Solutions

Don't have a G0 at hand, but with STM32C071K8, I built a HAL project using STM32CubeMX with default settings, a GPIO LED pin, IWDG period of 10s for periodic wakeup, and added few lines of code:

 

 

  /* USER CODE BEGIN 2 */
  HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_SET);
  HAL_Delay(3000);
  HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
  HAL_IWDG_Refresh(&hiwdg);
  HAL_PWR_EnterSTANDBYMode();
  /* USER CODE END 2 */

 

 

Got 8.3 µA @ 3.3V in standby mode, which is close to the data sheet. Could be further optimized, see low power posts in the forum.

Measuring low currents with an Ammeter can be tricky, I used the X-NUCLEO-LPM01A Power Measurement board.

hth

KnarfB

View solution in original post

11 REPLIES 11
KnarfB
Principal III

Shutdown mode is not mentioned in the DS12991 Rev 4 datasheet for STM32G030F6, but in the DS12992 Rev 3 data sheet for STM32G031F6 and similar.

hth

KnarfB

Thanks KnarfB,

 

DS12991 Rev 4 datasheet for STM32G030F6 mentions the stop0 and stop1 mode. We are looking to use stop1 mode. How can I use stop1 mode using HAL functions?

current consumption to less 20-25uA.

With stop modes, you won't meet your requirements.

Why not using standby with a periodic wakeup from IWDG or RTC?

Further reading

Getting started with PWR - stm32mcu

Re: Low power modes for STM32G0 series - STMicroelectronics Community

hth

KnarfB

Hello @gailu96 

To enter stop1 mode please read the section how to use the HAL PWR driver.

Saket_Om_0-1737383044939.png

For more details, please refer to the RM0454 section 4.3.7 

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar

Dear Sir,

Thanks for your help so far. It helped me to progress but not much.

I managed to put microcontroller in to standby mode but current consumption is still around 160 uA. I used RTC clocked with LSI for wakeup from standby on STM32G030F6. It goes in to standby and wakeup correctly. but current consumption is nowhere near to the figures provided in datasheet (19uA worst case).

I initially put some serial print to check if it is waking correctly. After verifying I just removed print also and as soon as controller start I put it in standby mode but it still takes 160uA. 

What could be the reason?

I am using this module . Only connected 3.3V VDD and GND to power module and measured current. No other pin connected to any external peripheral. 

Any help is appreciated to reach current consumption near to the documented figures if not exactly matching to the value in data sheet. Current gap is too far.

 

HAL_PWR_EnterSTANDBYMode() is the function used to put controller in to standby mode.
 
Your help is appreciated.

> I am using this module .

This is STM8, not STM32G0

Hello @gailu96 

To measure the current consumption, you should remove the IDD jumper and connect your amperemeter. 

Saket_Om_0-1737452666057.png

Please refer to the UM2591 for more details.

 

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar

Sorry KnarfB,

 

I provided the wrong link by mistake. Here is the correct link 

 

In this module we are giving VDD through Ammeter on 3.3V Pin

Don't have a G0 at hand, but with STM32C071K8, I built a HAL project using STM32CubeMX with default settings, a GPIO LED pin, IWDG period of 10s for periodic wakeup, and added few lines of code:

 

 

  /* USER CODE BEGIN 2 */
  HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_SET);
  HAL_Delay(3000);
  HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
  HAL_IWDG_Refresh(&hiwdg);
  HAL_PWR_EnterSTANDBYMode();
  /* USER CODE END 2 */

 

 

Got 8.3 µA @ 3.3V in standby mode, which is close to the data sheet. Could be further optimized, see low power posts in the forum.

Measuring low currents with an Ammeter can be tricky, I used the X-NUCLEO-LPM01A Power Measurement board.

hth

KnarfB