2024-08-03 08:32 AM
Hello everyone , I am try to learn lorawan on a STM32WLE5 module, I am using this repository(https://github.com/Seeed-Studio/LoRaWan-E5-Node/tree/main/Projects/Applications/LoRaWAN/LoRaWAN_End_Node) for developing lorawan application. It works well but I need put device into shutdown mode after a lorawan communication. But when I use
HAL_SuspendTick();
HAL_PWREx_EnterSHUTDOWNMode();
commands it always restarts immediately.
Best Regards
My code
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_DMA_Init();
MX_USART1_UART_Init();
MX_LoRaWAN_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
MX_LoRaWAN_Process();
HAL_SuspendTick();
HAL_PWREx_EnterSHUTDOWNMode();
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}