From 4a6ad9a2eca9dfb6f56ae7a1eaf18e7684fec78e Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Tue, 16 Apr 2024 12:23:39 +0800 Subject: [PATCH] try fix 3s issue --- Core/Inc/yunhorn_sts_prd_conf.h | 2 +- Core/Src/gpio.c | 6 ++++++ Core/Src/main.c | 2 +- Core/Src/stm32_lpm_if.c | 2 ++ Core/Src/sys_app.c | 1 + STM32CubeIDE/.cproject | 3 +++ STM32CubeIDE/Release/makefile | 2 +- 7 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index f0d2f6a..7988566 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -242,7 +242,7 @@ #define MajorVer 24U #define MinorVer 04U -#define SubMinorVer 8U +#define SubMinorVer 16U #define FirmwareVersion 3U #define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U #define YUNHORN_STS_AC_CODE_SIZE 20U diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c index f321bae..3da7956 100644 --- a/Core/Src/gpio.c +++ b/Core/Src/gpio.c @@ -161,6 +161,12 @@ void MX_GPIO_Init(void) HAL_GPIO_Init(LED1_GPIO_Port, &GPIO_InitStruct); #endif + GPIO_InitStruct.Pin = MEMS_POWER_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(MEMS_POWER_GPIO_Port, &GPIO_InitStruct); + #if defined(SOAP_LEVEL_SENSOR) /* ============== SOAP LEVEL DETECTION ========================= */ diff --git a/Core/Src/main.c b/Core/Src/main.c index ab5f232..8ebb480 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -115,7 +115,7 @@ int main(void) MX_LoRaWAN_Init(); /* USER CODE BEGIN 2 */ - + HAL_UART_DeInit(&huart2); /* USER CODE END 2 */ diff --git a/Core/Src/stm32_lpm_if.c b/Core/Src/stm32_lpm_if.c index 20e3377..4005903 100644 --- a/Core/Src/stm32_lpm_if.c +++ b/Core/Src/stm32_lpm_if.c @@ -97,6 +97,8 @@ void PWR_EnterStopMode(void) /* USER CODE BEGIN EnterStopMode_1 */ /* USER CODE END EnterStopMode_1 */ + HAL_UART_DeInit(&huart2); + vcom_DeInit(); HAL_GPIO_WritePin(GPIOA,GPIO_PIN_All, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOB,GPIO_PIN_All, GPIO_PIN_RESET); diff --git a/Core/Src/sys_app.c b/Core/Src/sys_app.c index fe35461..147f50c 100644 --- a/Core/Src/sys_app.c +++ b/Core/Src/sys_app.c @@ -124,6 +124,7 @@ void SystemApp_Init(void) /* 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_UART_TX_Id), UTIL_LPM_ENABLE); #if defined (LOW_POWER_DISABLE) && (LOW_POWER_DISABLE == 1) /* Disable Stop Mode */ diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject index 07e71e9..08b966f 100644 --- a/STM32CubeIDE/.cproject +++ b/STM32CubeIDE/.cproject @@ -186,6 +186,9 @@ + diff --git a/STM32CubeIDE/Release/makefile b/STM32CubeIDE/Release/makefile index 08d3e48..50b851a 100644 --- a/STM32CubeIDE/Release/makefile +++ b/STM32CubeIDE/Release/makefile @@ -77,7 +77,7 @@ main-build: STS_RR_R125.elf secondary-outputs # Tool invocations STS_RR_R125.elf STS_RR_R125.map: $(OBJS) $(USER_OBJS) D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\STS_RR_R125\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS) - arm-none-eabi-gcc -o "STS_RR_R125.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\STS_RR_R125\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld" --specs=nosys.specs -Wl,-Map="STS_RR_R125.map" -Wl,--gc-sections -static -L../../../../../../../Middlewares/ST/STM32_Cryptographic/lib --specs=nano.specs -mfloat-abi=soft -mthumb -u _printf_float -Wl,--start-group -lc -lm -Wl,--end-group + arm-none-eabi-gcc -o "STS_RR_R125.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\STS_RR_R125\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld" --specs=nosys.specs -Wl,-Map="STS_RR_R125.map" -Wl,--gc-sections -static -L../../../../../../../Middlewares/ST/STM32_Cryptographic/lib -z noexecstack --specs=nano.specs -mfloat-abi=soft -mthumb -u _printf_float -Wl,--start-group -lc -lm -Wl,--end-group @echo 'Finished building target: $@' @echo ' '