2025-02-12 3:04 AM
Hello,
I am working with a STM32WB09KE mcu on a custom pcb. I am trying to write a softwareloop that measures something every x min and afterwards goes into deepstop mode. I was following some online documentation, but it seems like the wb09-series is not represented alot. Currently I have configured the RTC to generate an alarm at every 5 minutes (at 12:05:00, 12:10:00, etc exact). This interrupt is confirmed to be working.
Now I am writing a function to enter deepstop mode in the main loop based on some examples online. Currently I have this:
void Enter_DeepStopMode(void)
{
__HAL_PWR_CLEAR_FLAG(PWR_WU_FLAG_ALL);
HAL_SuspendTick();
__HAL_RCC_LSI_ENABLE();
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
HAL_ResumeTick();
SystemClock_Config();
}
The problem is that the compiler (using STM32CubeIDE) does not find this function and argument 'HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);'
I'm not sure if the wb09 can use this function. I have looked through the examples in the wb09 firmware repository and there the following is used:
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0xFFFF, RTC_WAKEUPCLOCK_RTCCLK_DIV16);
sConfigDEEPSTOP.deepStopMode = PWR_DEEPSTOP_WITH_SLOW_CLOCK_ON;
/* Enter the Deepstop mode */
HAL_PWR_ConfigDEEPSTOP(&sConfigDEEPSTOP);
HAL_PWR_EnterDEEPSTOPMode();
Is this the correct way to enter deepstop mode and if so, will this work with my rtc alarm if i remove the 'HAL_RTCEx_setwakeuptimer line or do I need to configure something else if I want to use the alarm interrupt?
best regards
2025-02-12 3:12 AM - edited 2025-02-12 3:12 AM
@jens0501 wrote:I'm not sure if the wb09 can use this function. rds
That should be answered by looking in the HAL User Manual for the STM32CubeWB0 software package.
But there is no full User Manual listed - just a Getting Started guide:
https://www.st.com/en/embedded-software/stm32cubewb0.html#documentation
@STTwo-32 - where is the full User Manual?
2025-02-12 3:18 AM
Hi Andrew,
I found the HAL user manual here: https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.st.com/resource/en/user_manual/DM01082059.pdf&ved=2ahUKEwjYpozfgL6LAxVcR6QEHTXbOIMQFnoECBkQAQ&usg=AOvVaw1jR9shtM4pG7LTVwDupZdS
HAL_PWREx_EnterSTOP2Mode() is mentioned there under the following section:
STM32WB0 low-power management features:
– HAL_PWREx_EnterSTOP0Mode()
– HAL_PWREx_EnterSTOP1Mode()
– HAL_PWREx_EnterSTOP2Mode()
– HAL_PWREx_EnterSHUTDOWNMode()
But this is the only occurrence of this function in the whole document. So I think it should work on the wb09 according to the document, however I (and the compiler) cannot find this function in the firmware.
2025-02-12 3:34 AM
Good find.
Link without the Google tracking stuff: https://www.st.com/resource/en/user_manual/DM01082059.pdf
You're right: Section 24, HAL PWR Extension Driver, just lists a load of defines - it has no function documentation.
So another one for @STTwo-32:
If you use the IDE's 'Go To Definition' feature, there should be comments in the source documenting the function ...
2025-03-11 2:59 AM
Hello @jens0501
the functions HAL_PWREx_EnterSTOP0Mode(), HAL_PWREx_EnterSTOP1Mode() and HAL_PWREx_EnterSTOP2Mode() are not yet implemented on the STM32CubeWB0. So, I suggest you use the same method as the PWR_DEEPSTOP and the PWR_DEEPSTOP_RTC. Also, I've escalated this to the concerned team to review what will be implemented on the driver and what will be updated on the UM3363. (Under internal ticket number 205073). For adding the UM3363 to the STM32CubeWB0 web page, I've sent this request to the concerned team.
Best Regards.
STTwo-32
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.