Unable to wakeup from WKUPx when UTIL_SEQ_Run is executed.
Good Day
I am programming a stm32wb55rg to
start up
Do some ADC sampling
Start up BLE using APPE_Init();
Load all values in characteristic.
And then i sit in loop running:
UTIL_SEQ_Run( UTIL_SEQ_DEFAULT );
After 60 seconds I put device in standby mode. I am happy using standby mode and have device have to reset completely when wakeup. I Use a check on power up to see if device is woken up from standby, NVIC_SystemReset();
The device works great and my standby wakeup is RTC clock for 15 minutes.
I also want to wake up device using wakeup pin 3.
I have a 100k external pull down resistor on this pin.
When I use a bare program wakeup pin works 100%
As soon as i add UTIL_SEQ_Run( UTIL_SEQ_DEFAULT ); to my while loop , wakeup pin does NOT wake up mcu anymore. While RTC wakeup from standby works.
Here is my standby code ,partly taken from standby example:
/-------------------------
/* The Following Wakeup sequence is highly recommended prior to each Standby mode entry
mainly when using more than one wakeup source this is to not miss any wakeup event.
- Disable all used wakeup sources,
- Clear all related wakeup flags,
- Re-enable all used wakeup sources,
- Enter the Standby mode.
*/
/* Disable all used wakeup sources*/
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
/* Clear all related wakeup flags */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, storedValueWakeUpTimer, RTC_WAKEUPCLOCK_CK_SPRE_16BITS); //Set wakeup timer in seconds
if( (LL_PWR_IsActiveFlag_C1SB() == 0) || (LL_PWR_IsActiveFlag_C2SB() == 0))
{
/* Set the lowest low-power mode for CPU2: shutdown mode */
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
}
HAL_GPIO_WritePin(Out_GPIO_Port, Out_Pin,GPIO_PIN_RESET); //pull output CLR pin low again
HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_A,PWR_GPIO_BIT_4);
HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_A,PWR_GPIO_BIT_6);
HAL_PWREx_EnablePullUpPullDownConfig();
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN3_HIGH);
/* Enter the Standby mode */
HAL_PWR_EnterSTANDBYMode(); //standby mode has been triggered by either rotational trigger timer or BLE comms timeout or command from Edge Computer.
//code should never get past this point.
/----------------------------------------------
What am i missing