From bc58e98e364c43d582431ad49e55a7eefe561b68 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Wed, 21 Feb 2024 19:00:02 +0800 Subject: [PATCH] try debug --- Core/Inc/sys_conf.h | 8 +-- Core/Src/dma.c | 2 + Core/Src/gpio.c | 2 +- Core/Src/stm32wlxx_it.c | 2 + LoRaWAN/App/lora_app.c | 19 ++--- STM32CubeIDE/.cproject | 5 +- STM32CubeIDE/.settings/language.settings.xml | 4 +- .../Release/Application/User/Core/subdir.mk | 50 ++++++------- .../Application/User/LoRaWAN/App/subdir.mk | 14 ++-- .../Application/User/LoRaWAN/Target/subdir.mk | 8 +-- .../Application/User/Startup/subdir.mk | 6 +- .../Application/User/TOF/App/subdir.mk | 12 ++-- .../Application/User/TOF/Target/subdir.mk | 8 +-- .../Application/User/TOF/vl53l0x/subdir.mk | 20 +++--- .../Drivers/BSP/STM32WLxx_Nucleo/subdir.mk | 10 +-- STM32CubeIDE/Release/Drivers/CMSIS/subdir.mk | 8 +-- .../Drivers/STM32WLxx_HAL_Driver/subdir.mk | 54 +++++++------- .../Release/Middlewares/LoRaWAN/subdir.mk | 72 +++++++++---------- .../Release/Middlewares/SubGHz_Phy/subdir.mk | 12 ++-- STM32CubeIDE/Release/Utilities/subdir.mk | 22 +++--- STM32CubeIDE/Release/makefile | 25 +++---- STM32CubeIDE/Release/objects.mk | 2 +- STM32CubeIDE/Release/sources.mk | 5 +- 23 files changed, 189 insertions(+), 181 deletions(-) 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/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/gpio.c b/Core/Src/gpio.c index 3e14778..ce17b3d 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -89,7 +89,7 @@ void MX_GPIO_Init(void) /*Configure GPIO pin : PtPin */ GPIO_InitStruct.Pin = BUT1_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(BUT1_GPIO_Port, &GPIO_InitStruct); diff --git a/Core/Src/stm32wlxx_it.c b/Core/Src/stm32wlxx_it.c index e3545a0..f352fde 100644 --- a/Core/Src/stm32wlxx_it.c +++ b/Core/Src/stm32wlxx_it.c @@ -328,7 +328,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/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index de00b90..11d0941 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,19 @@ 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); + uint8_t pinstate = STS_Reed_Hall_State; - 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) + + { + APP_LOG(TS_OFF, VLEVEL_L, "## BUTTON-1 DETECTED: %2d \r\n", pinstate); + UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); } else { #ifdef LED_ONBOARD @@ -656,7 +657,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) } #endif -#endif + break; case BUT2_Pin: #if defined(STS_USE_STM32WLE5) diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index 2f13bb8..59e0d81 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -26,7 +26,7 @@