LPTIM1 not running
Hello,
I'm using the STM32H750VB and want to use the LPTIM1 to wakeup for CSTOP.
But i'm not able to let the LPTIM1 run.
Code:
SysInt_RegisterIsr(WAKEUP_PIN_IRQn, WakeUpPinInterrupt);
SysInt_SetPriority(WAKEUP_PIN_IRQn, 1, 0);
SysInt_EnableIsr(WAKEUP_PIN_IRQn);
SysInt_RegisterIsr(LPTIM1_IRQn, LowPowerTimerInterupt);
SysInt_SetPriority(LPTIM1_IRQn, 0, 0);
SysInt_EnableIsr(LPTIM1_IRQn);
LSI_ClockEnable();
/* ### - 1 - Re-target the LSI to Clock the LPTIM Counter ################# */
/* Select the LSI clock as LPTIM peripheral clock */
RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LPTIM1;
RCC_PeriphCLKInitStruct.Lptim1ClockSelection = RCC_LPTIM1CLKSOURCE_LSI;
HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct);
LptimHandle.Instance = LPTIM1;
LptimHandle.Init.Clock.Source = LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC;
LptimHandle.Init.Clock.Prescaler = LPTIM_PRESCALER_DIV16;
LptimHandle.Init.Trigger.Source = LPTIM_TRIGSOURCE_0;
LptimHandle.Init.Trigger.ActiveEdge = LPTIM_ACTIVEEDGE_RISING;
LptimHandle.Init.CounterSource = LPTIM_COUNTERSOURCE_INTERNAL;
LptimHandle.Init.Input1Source = LPTIM_INPUT1SOURCE_GPIO;
LptimHandle.Init.Input2Source = LPTIM_INPUT2SOURCE_GPIO;
/* Initialize LPTIM peripheral according to the passed parameters */
HAL_LPTIM_Init(&LptimHandle);
/* Period = 65535
* Pulse = 32767
* According to this configuration (LPTIMER clocked by LSI & compare = 32767,
* the Timeout period = (compare + 1)/LSI_Frequency = 1s
*/
HAL_LPTIM_TimeOut_Start_IT(&LptimHandle, 0xFFFF, 0x8000);
