From 2314a55a617fa9b806c412348293c27b3013e9ff Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Tue, 4 Mar 2025 22:32:41 +0800 Subject: [PATCH] new R5 workable --- Core/Inc/main.h | 5 ++ Core/Inc/sys_conf.h | 8 +-- Core/Src/main.c | 2 +- Core/Src/stm32_lpm_if.c | 3 + LoRaWAN/App/lora_app.c | 2 +- LoRaWAN/Target/lorawan_conf.h | 4 +- STM32CubeIDE/.cproject | 2 +- STM32CubeIDE/.settings/language.settings.xml | 4 +- .../Release/Application/User/Core/subdir.mk | 40 +++++------ .../Application/User/LoRaWAN/App/subdir.mk | 8 +-- .../Application/User/LoRaWAN/Target/subdir.mk | 2 +- .../Application/User/STS/Core/Src/subdir.mk | 6 +- .../Application/User/STS/TOF/App/subdir.mk | 6 +- .../Application/User/STS/TOF/Target/subdir.mk | 2 +- .../User/STS/TOF/vl53l0x/subdir.mk | 14 ++-- STM32CubeIDE/Release/Drivers/CMSIS/subdir.mk | 2 +- .../Drivers/STM32WLxx_HAL_Driver/subdir.mk | 48 ++++++------- .../Release/Middlewares/LoRaWAN/subdir.mk | 66 +++++++++--------- .../Release/Middlewares/SubGHz_Phy/subdir.mk | 6 +- STM32CubeIDE/Release/Utilities/subdir.mk | 16 ++--- STM32CubeIDE/Release/WLE5CC_NODE_STS.elf | Bin 163480 -> 183024 bytes STS/Core/Src/yunhorn_sts_process.c | 1 + STS/TOF/App/X-WL55_WLE5_53L0X.c | 4 +- STS/TOF/App/app_tof_vl53l0x_range.c | 8 ++- 24 files changed, 136 insertions(+), 123 deletions(-) diff --git a/Core/Inc/main.h b/Core/Inc/main.h index 7e551a7..1c8d2ae 100644 --- a/Core/Inc/main.h +++ b/Core/Inc/main.h @@ -188,6 +188,11 @@ void Error_Handler(void); #define TOF_C_XSHUT_Pin GPIO_PIN_3 #define TOF_C_XSHUT_GPIO_Port GPIOB + +#define TOF_R_XSHUT_Pin GPIO_PIN_3 +#define TOF_R_XSHUT_GPIO_Port GPIOB + + #define TOF_INT_EXTI_PIN TOF_C_INT_Pin #define TOF_INT_EXTI_PORT TOF_C_INT_GPIO_Port diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h index 4941614..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_OFF +#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/main.c b/Core/Src/main.c index d0d2d8e..1b0920b 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -116,7 +116,7 @@ int main(void) } /* USER CODE BEGIN 2 */ - //MX_USART2_UART_Init(); + MX_USART2_UART_Init(); /* USER CODE END 2 */ /* Infinite loop */ diff --git a/Core/Src/stm32_lpm_if.c b/Core/Src/stm32_lpm_if.c index c2f9951..a4186b6 100644 --- a/Core/Src/stm32_lpm_if.c +++ b/Core/Src/stm32_lpm_if.c @@ -92,6 +92,8 @@ void PWR_ExitOffMode(void) { /* USER CODE BEGIN ExitOffMode_1 */ HAL_ResumeTick(); + MX_GPIO_Init(); + PME_ON; return; /* USER CODE END ExitOffMode_1 */ } @@ -132,6 +134,7 @@ void PWR_ExitStopMode(void) /* Resume not retained USARTx and DMA */ MX_GPIO_Init(); + PME_ON; MX_I2C2_Init(); MX_DMA_Init(); vcom_Resume(); diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 59b12d5..1475f1d 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -1113,7 +1113,7 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams) AppData.BufferSize = 16; //UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer, (uint8_t *)"YUNHORN168", 10); UTIL_MEM_cpy_8((uint8_t*)AppData.Buffer, (uint8_t *)(uint8_t*)YUNHORN_STS_PRD_STRING, sizeof(YUNHORN_STS_PRD_STRING)); - AppData.BufferSize = sizeof(YUNHORN_STS_PRD_STRING); + AppData.BufferSize = sizeof(YUNHORN_STS_PRD_STRING)-1; LmHandlerParams.IsTxConfirmed = LORAMAC_HANDLER_CONFIRMED_MSG; LmHandlerErrorStatus_t status = LmHandlerSend(&AppData, LmHandlerParams.IsTxConfirmed, false); if (status ==LORAMAC_HANDLER_SUCCESS ) LmHandlerParams.IsTxConfirmed = LORAMAC_HANDLER_UNCONFIRMED_MSG; diff --git a/LoRaWAN/Target/lorawan_conf.h b/LoRaWAN/Target/lorawan_conf.h index 1706743..7d231b6 100644 --- a/LoRaWAN/Target/lorawan_conf.h +++ b/LoRaWAN/Target/lorawan_conf.h @@ -58,8 +58,8 @@ extern "C" { * - 0x01000400: Link Layer TS001-1.0.4 + Regional Parameters RP002-1.0.1 * - 0x01010100: soon available ... */ -#define LORAMAC_SPECIFICATION_VERSION 0x01000400 - +//#define LORAMAC_SPECIFICATION_VERSION 0x01000400 +#define LORAMAC_SPECIFICATION_VERSION 0x01010100 /*! * @brief Enable the additional LoRaWAN packages * @note LoRaWAN Packages available when enabled: diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index f4ad457..bb541aa 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -137,8 +137,8 @@