Problem with LPTIM on Zephyr


Raz <raziebe@...>
 

hello.
I am trying to use the LPTIM for the nucleos 476  by integrating it from CUBE. I ported the code below to Zephyr:

 HAL_Init();

  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_LPTIM1_Init();
  for (;i<2;i++) {
 HAL_GPIO_TogglePin (GPIOA, GPIO_PIN_5);
 HAL_Delay(1000);
  }
  /*
   * LSE Input freq is 32768 hz.
   *  32768/64 = 512hz
   * */
  int secs = 3;
  if (HAL_LPTIM_Counter_Start_IT(&hlptim1, 512* secs + 1) != HAL_OK) {
     Error_Handler();
  }
  HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
  while (1)
  {
 HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
  }
  /* USER C

However, the timer does not start. Anyone is familiar with this problem ?

Kind regards

Join users@lists.zephyrproject.org to automatically receive all group messages.