2025-01-19 11:38 AM
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
Solved! Go to Solution.
2025-01-21 09:07 AM - edited 2025-01-21 09:08 AM
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
2025-01-19 11:58 AM
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
2025-01-19 07:26 PM
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?
2025-01-19 11:01 PM
> 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
2025-01-20 06:29 AM
2025-01-21 12:45 AM - edited 2025-01-21 02:08 AM
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.
2025-01-21 01:17 AM
> I am using this module .
This is STM8, not STM32G0
2025-01-21 01:47 AM - edited 2025-01-21 01:48 AM
2025-01-21 02:07 AM - edited 2025-01-21 02:18 AM
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
2025-01-21 09:07 AM - edited 2025-01-21 09:08 AM
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