cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB09 deepstop mode

jens0501
Visitor

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

3 REPLIES 3

@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:

AndrewNeil_0-1739358646406.png

https://www.st.com/en/embedded-software/stm32cubewb0.html#documentation

@STTwo-32 - where is the full User Manual?

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.

 

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:

  1. Why is this manual not listed on the Product Page?
  2. Why is it incomplete?

 

If you use the IDE's 'Go To Definition' feature, there should be comments in the source documenting the function ...