diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h index ea70373..37cdd34 100644 --- a/Core/Inc/sys_conf.h +++ b/Core/Inc/sys_conf.h @@ -47,12 +47,12 @@ extern "C" { /** * @brief Verbose level for all trace logs */ -#define VERBOSE_LEVEL VLEVEL_L +#define VERBOSE_LEVEL VLEVEL_H /** * @brief Enable trace logs */ -#define APP_LOG_ENABLED 0 +#define APP_LOG_ENABLED 1 /** * @brief Activate monitoring (probes) of some internal RF signals for debug purpose @@ -75,13 +75,13 @@ extern "C" { * @brief Enable/Disable MCU Debugger pins (dbg serial wires) * @note by HW serial wires are ON by default, need to put them OFF to save power */ -#define DEBUGGER_ENABLED 0 +#define DEBUGGER_ENABLED 1 /** * @brief Disable Low Power mode * @note 0: LowPowerMode enabled. MCU enters stop2 mode, 1: LowPowerMode disabled. MCU enters sleep mode only */ -#define LOW_POWER_DISABLE 0 +#define LOW_POWER_DISABLE 1 /* USER CODE BEGIN EC */ diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index 0b0b134..b722c19 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -233,9 +233,9 @@ -#define MajorVer 23U -#define MinorVer 11U -#define SubMinorVer 18U +#define MajorVer 24U +#define MinorVer 02U +#define SubMinorVer 21U #define FirmwareVersion 3U #define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U #define YUNHORN_STS_AC_CODE_SIZE 20U diff --git a/Core/Src/dma.c b/Core/Src/dma.c index 366b255..c34a3c2 100644 --- a/Core/Src/dma.c +++ b/Core/Src/dma.c @@ -70,9 +70,11 @@ void MX_DMA_Init(void) // **** I2C2 // **** USART2 +#if 0 /* DMA1_Channel6_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn); +#endif /* DMA1_Channel7_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn); diff --git a/Core/Src/stm32wlxx_it.c b/Core/Src/stm32wlxx_it.c index e3545a0..3bb6950 100644 --- a/Core/Src/stm32wlxx_it.c +++ b/Core/Src/stm32wlxx_it.c @@ -76,8 +76,9 @@ extern DMA_HandleTypeDef hdma_i2c2_tx; //extern TIM_HandleTypeDef htim2; //extern TIM_HandleTypeDef htim16; extern DMA_HandleTypeDef hdma_usart2_tx; +#if 0 extern DMA_HandleTypeDef hdma_usart2_rx; - +#endif /* USER CODE BEGIN EV */ @@ -328,7 +329,9 @@ void DMA1_Channel6_IRQHandler(void) /* USER CODE BEGIN DMA1_Channel6_IRQn 0 */ /* USER CODE END DMA1_Channel6_IRQn 0 */ +#if 0 HAL_DMA_IRQHandler(&hdma_usart2_rx); +#endif /* USER CODE BEGIN DMA1_Channel6_IRQn 1 */ /* USER CODE END DMA1_Channel6_IRQn 1 */ diff --git a/Core/Src/sys_app.c b/Core/Src/sys_app.c index afd0327..2839e9d 100644 --- a/Core/Src/sys_app.c +++ b/Core/Src/sys_app.c @@ -122,7 +122,8 @@ void SystemApp_Init(void) /*Init low power manager*/ UTIL_LPM_Init(); /* Disable Stand-by mode */ - UTIL_LPM_SetOffMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_DISABLE); + //UTIL_LPM_SetOffMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_DISABLE); + UTIL_LPM_SetOffMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_ENABLE); #if defined (LOW_POWER_DISABLE) && (LOW_POWER_DISABLE == 1) /* Disable Stop Mode */ diff --git a/Core/Src/usart.c b/Core/Src/usart.c index e62df72..e997818 100644 --- a/Core/Src/usart.c +++ b/Core/Src/usart.c @@ -135,6 +135,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart2_tx); /* USART2_RX Init */ +#if 0 hdma_usart2_rx.Instance = DMA1_Channel6; hdma_usart2_rx.Init.Request = DMA_REQUEST_USART2_RX; hdma_usart2_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; @@ -155,7 +156,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) } #endif __HAL_LINKDMA(uartHandle,hdmarx,hdma_usart2_rx); - +#endif /* USART2 interrupt Init */ HAL_NVIC_SetPriority(USART2_IRQn, 2, 0); HAL_NVIC_EnableIRQ(USART2_IRQn); @@ -184,7 +185,9 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle) /* USART2 DMA DeInit */ HAL_DMA_DeInit(uartHandle->hdmatx); +#if 0 HAL_DMA_DeInit(uartHandle->hdmarx); +#endif /* USART2 interrupt Deinit */ HAL_NVIC_DisableIRQ(USART2_IRQn); /* USER CODE BEGIN USART2_MspDeInit 1 */ diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index de00b90..d88c692 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -400,7 +400,7 @@ static LmHandlerParams_t LmHandlerParams = /** * @brief Type of Event to generate application Tx */ -static TxEventType_t EventType = TX_ON_TIMER; +static TxEventType_t EventType = TX_ON_EVENT; /** * @brief Timer to handle the application Tx @@ -634,18 +634,18 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) switch (GPIO_Pin) { case BUT1_Pin: -#if (defined(STS_USE_STM32WL55)||defined(STS_USE_STM32WLE5)) + #ifdef YUNHORN_STS_O5_ENABLED uint8_t pinstate = (STS_Reed_Hall_State== 0)?1:0; - APP_LOG(TS_OFF, VLEVEL_L, "## BUTTON-1 DETECTED: %2d \r\n", pinstate); + APP_LOG(TS_OFF, VLEVEL_H, "## BUTTON-1 DETECTED: %2d \r\n", pinstate); - UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); - - //if (EventType == TX_ON_EVENT) - if (pinstate == 1) - { //UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); + + if (EventType == TX_ON_EVENT) + //if (pinstate == 1) + { + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); } else { #ifdef LED_ONBOARD @@ -656,7 +656,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) } #endif -#endif + break; case BUT2_Pin: #if defined(STS_USE_STM32WLE5) diff --git a/LoRaWAN/App/lora_app.h b/LoRaWAN/App/lora_app.h index fa9153a..a83ec96 100644 --- a/LoRaWAN/App/lora_app.h +++ b/LoRaWAN/App/lora_app.h @@ -71,7 +71,7 @@ extern "C" { /*! * LoRaWAN default class */ -#define LORAWAN_DEFAULT_CLASS CLASS_C +#define LORAWAN_DEFAULT_CLASS CLASS_A /*! * LoRaWAN default confirm state diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index 2f13bb8..59e0d81 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -26,7 +26,7 @@