2024-08-09 12:34 AM - last edited on 2024-08-09 08:23 AM by Amel NASRI
Hi,
We are using NUCLEO-WL55JC1 board for our development.
we are trying to combine the project of LPTIMER and LORAWAN Slave...The Lorawan uses HAL library and LPTIMER uses LL libraries the program compiles completely and burn in to the board. but it is not going in the LPTIMER interrupt. As we have tried with both separately its working perfectly fine.... can you suggest any setting we are missing on the settings....We have tried to use separate HAL Library HAL library for LPTIMER its not working...even the sample so we have used LL library for LPTIMER and HAL Library for LORAWAN....
If anyone have idea on this please reply
2024-08-09 02:37 AM - edited 2024-08-09 02:37 AM
Hello @Omkar_123
If the interrupt flag is set and it is not going to execute the IRQ handler, please check your interrupts priority.
2024-08-09 02:40 AM
What LoRaWAN Stack are you using?
Does that stack use the LP Timer?
2024-08-29 03:49 PM
Hi
Any one found the solution. As we are also facing same problem with STM32WL55X. When we start lorawan its working perfectly, and LPTIM separately it also worked. but when we combine both in the same code, the lptim interrupt is not executing. we have verified the interrupt enable settings, but still we are facing the issue.
This is our LPTIM init function
void MX_LPTIM1_Init(void)
{
/* USER CODE BEGIN LPTIM1_Init 0 */
/* USER CODE END LPTIM1_Init 0 */
LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
/** Initializes the peripherals clocks
*/
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LPTIM1;
PeriphClkInitStruct.Lptim1ClockSelection = RCC_LPTIM1CLKSOURCE_PCLK1;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
Error_Handler();
}
/* Peripheral clock enable */
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_LPTIM1);
LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOB);
/**LPTIM1 GPIO Configuration
PB5 ------> LPTIM1_IN1
*/
GPIO_InitStruct.Pin = LL_GPIO_PIN_5;
GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_UP;
GPIO_InitStruct.Alternate = LL_GPIO_AF_1;
LL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* LPTIM1 interrupt Init */
NVIC_SetPriority(LPTIM1_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),1, 0));
NVIC_EnableIRQ(LPTIM1_IRQn);
/* USER CODE BEGIN LPTIM1_Init 1 */
/* USER CODE END LPTIM1_Init 1 */
LL_LPTIM_SetClockSource(LPTIM1, LL_LPTIM_CLK_SOURCE_INTERNAL);
LL_LPTIM_SetPrescaler(LPTIM1, LL_LPTIM_PRESCALER_DIV1);
LL_LPTIM_SetPolarity(LPTIM1, LL_LPTIM_OUTPUT_POLARITY_REGULAR);
LL_LPTIM_SetUpdateMode(LPTIM1, LL_LPTIM_UPDATE_MODE_IMMEDIATE);
LL_LPTIM_SetCounterMode(LPTIM1, LL_LPTIM_COUNTER_MODE_EXTERNAL);
LL_LPTIM_ConfigClock(LPTIM1, LL_LPTIM_CLK_FILTER_NONE, LL_LPTIM_CLK_POLARITY_FALLING);
LL_LPTIM_TrigSw(LPTIM1);
LL_LPTIM_SetInput1Src(LPTIM1, LL_LPTIM_INPUT1_SRC_GPIO);
LL_LPTIM_SetInput2Src(LPTIM1, LL_LPTIM_INPUT2_SRC_GPIO);
/* USER CODE BEGIN LPTIM1_Init 2 */
/* Enable the LPTIM1 counter */
//LL_LPTIM_Enable(LPTIM1);
LL_LPTIM_EnableIT_ARRM(LPTIM1);
/* Set the Autoreload value */
LL_LPTIM_SetAutoReload(LPTIM1, 5);
/* Start the LPTIM counter in continuous mode */
LL_LPTIM_StartCounter(LPTIM1, LL_LPTIM_OPERATING_MODE_CONTINUOUS);
/* USER CODE END LPTIM1_Init 2 */
}
Also we have written autoreload call back function. but still its not going in callback and interrupt.
Any idea, please help