cancel
Showing results for 
Search instead for 
Did you mean: 

Problems during stop 2 mode issue.

ngodoanvan
Senior

Hi,

I created my new project follow the SubGHz Phy Ping Pong project. I want to write ADC values to FLASH for 5ms then enter stop 2 mode for 1000ms. In PWR_EnterStopMode() function, the HAL_SuspendTick() funciton is called, but my project enter stop 2 mode and exit stop 2 mode imediately. What wrong ?

I confused how to use sequencer correctly.

Please recommend me how to fix this problem.

My code below,

void PWR_EnterStopMode(void)
{
  /* USER CODE BEGIN EnterStopMode_1 */
  /* Disable ADC */
  HAL_ADC_DeInit(&hadc);
  /* Disable ADC voltage regulator */
  HAL_ADCEx_DisableVoltageRegulator(&hadc);
  /* USER CODE END EnterStopMode_1 */
  HAL_SuspendTick();
  /* Clear Status Flag before entering STOP/STANDBY Mode */
  LL_PWR_ClearFlag_C1STOP_C1STB();
  /* USER CODE BEGIN EnterStopMode_2 */
  HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
  HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 2000, RTC_WAKEUPCLOCK_RTCCLK_DIV16, 0);
  /* USER CODE END EnterStopMode_2 */
  HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
  /* USER CODE BEGIN EnterStopMode_3 */
 
  /* USER CODE END EnterStopMode_3 */
}

Thanks.

0 REPLIES 0