wip good with warm start up and scan

This commit is contained in:
Yunhorn 2025-05-16 17:34:56 +08:00
parent 895969ce27
commit ef276c57f9
13 changed files with 215 additions and 35 deletions

58
Core/Inc/iwdg.h Normal file
View File

@ -0,0 +1,58 @@
/**
******************************************************************************
* File Name : IWDG.h
* Description : This file provides code for the configuration
* of the IWDG instances.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __iwdg_H
#define __iwdg_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_IWDG_Init(void);
void Refresh_IWDG(void);
/* USER CODE BEGIN Prototypes */
/* USER CODE END Prototypes */
#ifdef __cplusplus
}
#endif
#endif /*__ iwdg_H */
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -45,7 +45,7 @@
/*#define HAL_I2S_MODULE_ENABLED */
/*#define HAL_IPCC_MODULE_ENABLED */
/*#define HAL_IRDA_MODULE_ENABLED */
/*#define HAL_IWDG_MODULE_ENABLED */
#define HAL_IWDG_MODULE_ENABLED
/*#define HAL_LPTIM_MODULE_ENABLED */
/*#define HAL_PKA_MODULE_ENABLED */
/*#define HAL_RNG_MODULE_ENABLED */

51
Core/Src/iwdg.c Normal file
View File

@ -0,0 +1,51 @@
/**
******************************************************************************
* File Name : IWDG.c
* Description : This file provides code for the configuration
* of the IWDG instances.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "iwdg.h"
IWDG_HandleTypeDef hiwdg;
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/* IWDG init function */
void MX_IWDG_Init(void)
{
hiwdg.Instance = IWDG;
hiwdg.Init.Prescaler = IWDG_PRESCALER_256; // 32k -> 30 seconds
//hiwdg.Init.Window = 0x0FFF;
hiwdg.Init.Window = IWDG_WINDOW_DISABLE;
hiwdg.Init.Reload = 0x0FFF;
if (HAL_IWDG_Init(&hiwdg) != HAL_OK)
{
Error_Handler();
}
}
void Refresh_IWDG(void)
{
// IWDG->KR=0XAAAA;
HAL_IWDG_Refresh(&hiwdg);
}
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -119,7 +119,7 @@ int main(void)
BSP_I2C2_Init();
MX_DMA_Init();
MX_TIM1_Init();
MX_IWDG_Init();
MX_LoRaWAN_Init();
//STS_Lamp_Bar_Self_Test();
@ -141,6 +141,7 @@ int main(void)
MX_LoRaWAN_Process();
/* USER CODE BEGIN 3 */
Refresh_IWDG();
}
/* USER CODE END 3 */
}

View File

@ -61,6 +61,7 @@ extern volatile uint8_t sts_work_mode, sts_cloud_netcolor, sts_lamp_bar_color, s
volatile static bool r_b=true;
extern volatile uint8_t sts_pir_read;
extern volatile uint32_t rfac_timer;
extern volatile uint8_t sts_service_mask;
extern volatile uint32_t STS_TOFScanPeriod_msec, STS_TxPeriod_sec, STS_HeartBeatTimerPeriod_sec;
volatile uint8_t sts_data_buf[LORAWAN_APP_DATA_BUFFER_MAX_SIZE]={0x0};
@ -541,8 +542,8 @@ void LoRaWAN_Init(void)
LmHandlerJoin(ActivationType, ForceRejoin);
UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_ONESHOT, OnYunhornSTSHeartBeatTimerEvent, NULL);
UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
//UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_ONESHOT, OnYunhornSTSHeartBeatTimerEvent, NULL);
//UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
if (EventType == TX_ON_TIMER)
{
@ -653,10 +654,12 @@ void STS_Sensor_Init(void)
UTIL_TIMER_Start(&STSLampBarColorTimer);
UTIL_TIMER_Start(&STSDurationCheckTimer);
//UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_PERIODIC, OnYunhornSTSHeartBeatTimerEvent, NULL);
// UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_ONESHOT, OnYunhornSTSHeartBeatTimerEvent, NULL);
UTIL_TIMER_Create(&YunhornSTSHeartBeatTimer, 1000*STS_HeartBeatTimerPeriod_sec, UTIL_TIMER_ONESHOT, OnYunhornSTSHeartBeatTimerEvent, NULL);
// UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
/* VVVVVV migrated to yunhorn_sts_process.c */
STS_TOF_L8_Init();
//HAL_Delay(1000);
//STS_SENSOR_Function_Test_Process();
}
@ -1320,7 +1323,7 @@ static void SendTxData(void)
AppData.Buffer[i++] = (uint8_t)(sts_m1_sensor_data.on_off_event & 0xFF);
#endif //STS_M1
AppData.BufferSize = i;
AppData.BufferSize = (i&(~sts_service_mask))&0xff;
#ifdef CLOCK_SYNC
if( IsClockSynched == false )
@ -1379,14 +1382,16 @@ static void OnTxTimerEvent(void *context)
APP_LOG(TS_OFF, VLEVEL_M, "\nSET TASK P4\r\n");
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), CFG_SEQ_Prio_0);
#endif
if (sts_warm_up_message_counter ++ < 10)
if (sts_warm_up_message_counter < 5)
{
UTIL_TIMER_Stop(&TxTimer);
//UTIL_TIMER_Stop(&TxTimer);
sts_warm_up_message_counter ++;
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
UTIL_TIMER_Start(&TxTimer);
//UTIL_TIMER_Start(&TxTimer);
}
/*Wait for next tx slot*/
/* USER CODE BEGIN OnTxTimerEvent_2 */
@ -1478,6 +1483,9 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
}
UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
// UTIL_TIMER_Start(&TxTimer);
// UTIL_TIMER_Start(&YunhornSTSWakeUpScanTimer);
/* USER CODE END OnJoinRequest_1 */

View File

@ -147,6 +147,11 @@
<type>1</type>
<locationURI>copy_PARENT1/Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_i2c_ex.c</locationURI>
</link>
<link>
<name>Drivers/STM32WLxx_HAL_Driver/stm32wlxx_hal_iwdg.c</name>
<type>1</type>
<locationURI>PARENT-6-PROJECT_LOC/Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_iwdg.c</locationURI>
</link>
<link>
<name>Drivers/STM32WLxx_HAL_Driver/stm32wlxx_hal_pwr.c</name>
<type>1</type>
@ -422,6 +427,11 @@
<type>1</type>
<locationURI>copy_PARENT/Core/Src/i2c.c</locationURI>
</link>
<link>
<name>Application/User/Core/iwdg.c</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/Core/Src/iwdg.c</locationURI>
</link>
<link>
<name>Application/User/Core/main.c</name>
<type>1</type>

View File

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-859626784961551925" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1364498518074211444" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-859626784961551925" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1364498518074211444" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

View File

@ -10,6 +10,7 @@ D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_S
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/dma.c \
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/flash_if.c \
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/gpio.c \
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/iwdg.c \
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/main.c \
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/rtc.c \
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/stm32_lpm_if.c \
@ -34,6 +35,7 @@ OBJS += \
./Application/User/Core/dma.o \
./Application/User/Core/flash_if.o \
./Application/User/Core/gpio.o \
./Application/User/Core/iwdg.o \
./Application/User/Core/main.o \
./Application/User/Core/rtc.o \
./Application/User/Core/stm32_lpm_if.o \
@ -58,6 +60,7 @@ C_DEPS += \
./Application/User/Core/dma.d \
./Application/User/Core/flash_if.d \
./Application/User/Core/gpio.d \
./Application/User/Core/iwdg.d \
./Application/User/Core/main.d \
./Application/User/Core/rtc.d \
./Application/User/Core/stm32_lpm_if.d \
@ -88,6 +91,8 @@ Application/User/Core/flash_if.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DL8 -DSERCO_PWH -DPIR -DCLOCK_SYNC -DO1L -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
Application/User/Core/gpio.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/gpio.c Application/User/Core/subdir.mk
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DL8 -DSERCO_PWH -DPIR -DCLOCK_SYNC -DO1L -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
Application/User/Core/iwdg.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/iwdg.c Application/User/Core/subdir.mk
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DL8 -DSERCO_PWH -DPIR -DCLOCK_SYNC -DO1L -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
Application/User/Core/main.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/main.c Application/User/Core/subdir.mk
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DL8 -DSERCO_PWH -DPIR -DCLOCK_SYNC -DO1L -DCORE_CM4 -DUSE_HAL_DRIVER -DSTM32WLE5xx -c -I../../Core/Inc -I../../STS/Core/Inc -I../../STS/TOF/App -I../../STS/TOF/Target -I../../STS/TOF/vl53l1x_uld -I../../STS/TOF/vl53l0x -I../../LoRaWAN/App -I../../LoRaWAN/Target -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc -I../../../../../../../Drivers/STM32WLxx_HAL_Driver/Inc/Legacy -I../../../../../../../Utilities/trace/adv_trace -I../../../../../../../Utilities/misc -I../../../../../../../Utilities/sequencer -I../../../../../../../Utilities/timer -I../../../../../../../Utilities/lpm/tiny_lpm -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler/Packages -I../../../../../../../Drivers/CMSIS/Device/ST/STM32WLxx/Include -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Crypto -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac/Region -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Mac -I../../../../../../../Middlewares/Third_Party/LoRaWAN/LmHandler -I../../../../../../../Middlewares/Third_Party/LoRaWAN/Utilities -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy -I../../../../../../../Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver -I../../../../../../../Middlewares/ST/STM32_Cryptographic/include -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/BSP/STM32WLxx_Nucleo -I../../../../../../../Drivers/BSP/Components/vl53l8cx/porting -I../../../../../../../Drivers/BSP/Components/Common -I../../../../../../../Drivers/BSP/53L8A1 -I../../../../../../../Drivers/BSP/Components/vl53l8cx/modules -I../../../../../../../Drivers/BSP/Components/vl53l8cx -Os -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
Application/User/Core/rtc.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/rtc.c Application/User/Core/subdir.mk
@ -124,7 +129,7 @@ Application/User/Core/usart_if.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/
clean: clean-Application-2f-User-2f-Core
clean-Application-2f-User-2f-Core:
-$(RM) ./Application/User/Core/adc.cyclo ./Application/User/Core/adc.d ./Application/User/Core/adc.o ./Application/User/Core/adc.su ./Application/User/Core/adc_if.cyclo ./Application/User/Core/adc_if.d ./Application/User/Core/adc_if.o ./Application/User/Core/adc_if.su ./Application/User/Core/dma.cyclo ./Application/User/Core/dma.d ./Application/User/Core/dma.o ./Application/User/Core/dma.su ./Application/User/Core/flash_if.cyclo ./Application/User/Core/flash_if.d ./Application/User/Core/flash_if.o ./Application/User/Core/flash_if.su ./Application/User/Core/gpio.cyclo ./Application/User/Core/gpio.d ./Application/User/Core/gpio.o ./Application/User/Core/gpio.su ./Application/User/Core/main.cyclo ./Application/User/Core/main.d ./Application/User/Core/main.o ./Application/User/Core/main.su ./Application/User/Core/rtc.cyclo ./Application/User/Core/rtc.d ./Application/User/Core/rtc.o ./Application/User/Core/rtc.su ./Application/User/Core/stm32_lpm_if.cyclo ./Application/User/Core/stm32_lpm_if.d ./Application/User/Core/stm32_lpm_if.o ./Application/User/Core/stm32_lpm_if.su ./Application/User/Core/stm32wlxx_hal_msp.cyclo ./Application/User/Core/stm32wlxx_hal_msp.d ./Application/User/Core/stm32wlxx_hal_msp.o ./Application/User/Core/stm32wlxx_hal_msp.su ./Application/User/Core/stm32wlxx_it.cyclo ./Application/User/Core/stm32wlxx_it.d ./Application/User/Core/stm32wlxx_it.o ./Application/User/Core/stm32wlxx_it.su ./Application/User/Core/stm32wlxx_nucleo_bus.cyclo ./Application/User/Core/stm32wlxx_nucleo_bus.d ./Application/User/Core/stm32wlxx_nucleo_bus.o ./Application/User/Core/stm32wlxx_nucleo_bus.su ./Application/User/Core/sts_lamp_bar.cyclo ./Application/User/Core/sts_lamp_bar.d ./Application/User/Core/sts_lamp_bar.o ./Application/User/Core/sts_lamp_bar.su ./Application/User/Core/subghz.cyclo ./Application/User/Core/subghz.d ./Application/User/Core/subghz.o ./Application/User/Core/subghz.su ./Application/User/Core/sys_app.cyclo ./Application/User/Core/sys_app.d ./Application/User/Core/sys_app.o ./Application/User/Core/sys_app.su ./Application/User/Core/sys_debug.cyclo ./Application/User/Core/sys_debug.d ./Application/User/Core/sys_debug.o ./Application/User/Core/sys_debug.su ./Application/User/Core/sys_sensors.cyclo ./Application/User/Core/sys_sensors.d ./Application/User/Core/sys_sensors.o ./Application/User/Core/sys_sensors.su ./Application/User/Core/syscalls.cyclo ./Application/User/Core/syscalls.d ./Application/User/Core/syscalls.o ./Application/User/Core/syscalls.su ./Application/User/Core/sysmem.cyclo ./Application/User/Core/sysmem.d ./Application/User/Core/sysmem.o ./Application/User/Core/sysmem.su ./Application/User/Core/tim.cyclo ./Application/User/Core/tim.d ./Application/User/Core/tim.o ./Application/User/Core/tim.su ./Application/User/Core/timer_if.cyclo ./Application/User/Core/timer_if.d ./Application/User/Core/timer_if.o ./Application/User/Core/timer_if.su ./Application/User/Core/usart.cyclo ./Application/User/Core/usart.d ./Application/User/Core/usart.o ./Application/User/Core/usart.su ./Application/User/Core/usart_if.cyclo ./Application/User/Core/usart_if.d ./Application/User/Core/usart_if.o ./Application/User/Core/usart_if.su
-$(RM) ./Application/User/Core/adc.cyclo ./Application/User/Core/adc.d ./Application/User/Core/adc.o ./Application/User/Core/adc.su ./Application/User/Core/adc_if.cyclo ./Application/User/Core/adc_if.d ./Application/User/Core/adc_if.o ./Application/User/Core/adc_if.su ./Application/User/Core/dma.cyclo ./Application/User/Core/dma.d ./Application/User/Core/dma.o ./Application/User/Core/dma.su ./Application/User/Core/flash_if.cyclo ./Application/User/Core/flash_if.d ./Application/User/Core/flash_if.o ./Application/User/Core/flash_if.su ./Application/User/Core/gpio.cyclo ./Application/User/Core/gpio.d ./Application/User/Core/gpio.o ./Application/User/Core/gpio.su ./Application/User/Core/iwdg.cyclo ./Application/User/Core/iwdg.d ./Application/User/Core/iwdg.o ./Application/User/Core/iwdg.su ./Application/User/Core/main.cyclo ./Application/User/Core/main.d ./Application/User/Core/main.o ./Application/User/Core/main.su ./Application/User/Core/rtc.cyclo ./Application/User/Core/rtc.d ./Application/User/Core/rtc.o ./Application/User/Core/rtc.su ./Application/User/Core/stm32_lpm_if.cyclo ./Application/User/Core/stm32_lpm_if.d ./Application/User/Core/stm32_lpm_if.o ./Application/User/Core/stm32_lpm_if.su ./Application/User/Core/stm32wlxx_hal_msp.cyclo ./Application/User/Core/stm32wlxx_hal_msp.d ./Application/User/Core/stm32wlxx_hal_msp.o ./Application/User/Core/stm32wlxx_hal_msp.su ./Application/User/Core/stm32wlxx_it.cyclo ./Application/User/Core/stm32wlxx_it.d ./Application/User/Core/stm32wlxx_it.o ./Application/User/Core/stm32wlxx_it.su ./Application/User/Core/stm32wlxx_nucleo_bus.cyclo ./Application/User/Core/stm32wlxx_nucleo_bus.d ./Application/User/Core/stm32wlxx_nucleo_bus.o ./Application/User/Core/stm32wlxx_nucleo_bus.su ./Application/User/Core/sts_lamp_bar.cyclo ./Application/User/Core/sts_lamp_bar.d ./Application/User/Core/sts_lamp_bar.o ./Application/User/Core/sts_lamp_bar.su ./Application/User/Core/subghz.cyclo ./Application/User/Core/subghz.d ./Application/User/Core/subghz.o ./Application/User/Core/subghz.su ./Application/User/Core/sys_app.cyclo ./Application/User/Core/sys_app.d ./Application/User/Core/sys_app.o ./Application/User/Core/sys_app.su ./Application/User/Core/sys_debug.cyclo ./Application/User/Core/sys_debug.d ./Application/User/Core/sys_debug.o ./Application/User/Core/sys_debug.su ./Application/User/Core/sys_sensors.cyclo ./Application/User/Core/sys_sensors.d ./Application/User/Core/sys_sensors.o ./Application/User/Core/sys_sensors.su ./Application/User/Core/syscalls.cyclo ./Application/User/Core/syscalls.d ./Application/User/Core/syscalls.o ./Application/User/Core/syscalls.su ./Application/User/Core/sysmem.cyclo ./Application/User/Core/sysmem.d ./Application/User/Core/sysmem.o ./Application/User/Core/sysmem.su ./Application/User/Core/tim.cyclo ./Application/User/Core/tim.d ./Application/User/Core/tim.o ./Application/User/Core/tim.su ./Application/User/Core/timer_if.cyclo ./Application/User/Core/timer_if.d ./Application/User/Core/timer_if.o ./Application/User/Core/timer_if.su ./Application/User/Core/usart.cyclo ./Application/User/Core/usart.d ./Application/User/Core/usart.o ./Application/User/Core/usart.su ./Application/User/Core/usart_if.cyclo ./Application/User/Core/usart_if.d ./Application/User/Core/usart_if.o ./Application/User/Core/usart_if.su
.PHONY: clean-Application-2f-User-2f-Core

File diff suppressed because one or more lines are too long

View File

@ -87,7 +87,7 @@ volatile sts_cfg_nvm_t sts_cfg_nvm = {
sts_hardware_ver,
#if defined(STS_L8)
0x0A, //Regular TxPeriodicity interval
'S', //Uplink data interval unit, for heart-beat uplink
'M', //Uplink data interval unit, for heart-beat uplink
#else
0x05, //Regular TxPeriodicity interval
'M', //Uplink data interval unit, for heart-beat uplink
@ -1260,6 +1260,32 @@ void USER_APP_AUTO_RESPONDER_Parse(uint8_t *parse_buffer, uint8_t parse_buffer_s
#endif
STS_SENSOR_Upload_Message(YUNHORN_STS_USER_APP_CTRL_REPLY_PORT, i, (uint8_t *)outbuf);
break;
case 'G': /* "YZG": Ambient Height scan process */
STS_LMZ_Ambient_Height_Scan_Process();
i = 0;
outbuf[i++] = (uint8_t)'G';
outbuf[i++] = (uint8_t)sts_mtmcode1;
outbuf[i++] = (uint8_t)sts_mtmcode2;
outbuf[i++] = (uint8_t)sts_version;
outbuf[i++] = (uint8_t)sts_hardware_ver;
outbuf[i++] = (uint8_t)(99*((GetBatteryLevel()/254)&0xff));
outbuf[i++] = (uint8_t) (12)&0xff; //length of following data
outbuf[i++] = (uint8_t) (sensor_id >>8)&0xFF;
outbuf[i++] = (uint8_t) (sensor_id) & 0xFF;
outbuf[i++] = (uint8_t) (sts_sensor_install_height>>8)&0xff; // MSB of sensor height
outbuf[i++] = (uint8_t) (sts_sensor_install_height)&0xff; // LSB of sensor height
// MASK OFF BITMAP
outbuf[i++] = (uint8_t) (sts_mask_bitmap[0]);
outbuf[i++] = (uint8_t) (sts_mask_bitmap[1]);
outbuf[i++] = (uint8_t) (sts_mask_bitmap[2]);
outbuf[i++] = (uint8_t) (sts_mask_bitmap[3]);
outbuf[i++] = (uint8_t) (sts_mask_bitmap[4]);
outbuf[i++] = (uint8_t) (sts_mask_bitmap[5]);
outbuf[i++] = (uint8_t) (sts_mask_bitmap[6]);
outbuf[i++] = (uint8_t) (sts_mask_bitmap[7]);
STS_SENSOR_Upload_Message(YUNHORN_STS_USER_APP_CTRL_REPLY_PORT, i, (uint8_t *)outbuf);
break;
case 'M': /* "YZM": Mask level */
i = 0;
@ -1671,7 +1697,7 @@ void OnStoreSTSCFGContextRequest(void)
{
/* USER CODE BEGIN OnStoreContextRequest_1 */
uint8_t i=0,j=0;
uint8_t to_store__value[YUNHORN_STS_MAX_NVM_CFG_SIZE]={0x0}; /* KEEP THIS LOCAL */
uint8_t to_store__value[2*YUNHORN_STS_MAX_NVM_CFG_SIZE]={0x0}; /* KEEP THIS LOCAL */
sts_cfg_nvm.length = STS_NVM_CFG_SIZE;
to_store__value[i++] = sts_cfg_nvm.mtmcode1;
to_store__value[i++] = sts_cfg_nvm.mtmcode2;
@ -1732,7 +1758,7 @@ void OnStoreSTSCFGContextRequest(void)
if (FLASH_IF_Erase(STS_CONFIG_NVM_BASE_ADDRESS, FLASH_PAGE_SIZE) == FLASH_IF_OK)
{
FLASH_IF_Write(STS_CONFIG_NVM_BASE_ADDRESS, (const void *)to_store__value, YUNHORN_STS_MAX_NVM_CFG_SIZE);
FLASH_IF_Write(STS_CONFIG_NVM_BASE_ADDRESS, (const void *)to_store__value, 2*YUNHORN_STS_MAX_NVM_CFG_SIZE);
}
/* USER CODE BEGIN OnStoreContextRequest_Last */
@ -1835,11 +1861,9 @@ void OnRestoreSTSCFGContextProcess(void)
} else if ((char) sts_cfg_nvm.unit =='S') {
periodicity *= 1;
}
periodicity = (periodicity > 10)? periodicity : 10; // in seconds unit
APP_LOG(TS_OFF, VLEVEL_M, "\n\n Tx periodicity in NVM =%u sec\n",periodicity);
TxPeriodicity= periodicity*1000; // to ms
//periodicity = (periodicity > 10)? periodicity : 10; // in seconds unit
//APP_LOG(TS_OFF, VLEVEL_M, "\n\n Tx periodicity in NVM =%u sec\n",periodicity);
//TxPeriodicity= periodicity*1000; // to ms
uint32_t sampling_heartbeat_periodicity = (sts_cfg_nvm.sampling); //Heart-beat or Sampling interval
if ((char)sts_cfg_nvm.s_unit =='M') {
@ -1849,24 +1873,27 @@ void OnRestoreSTSCFGContextProcess(void)
} else if ((char) sts_cfg_nvm.s_unit =='S') {
sampling_heartbeat_periodicity *= 1;
}
#if defined(STS_L8)
STS_HeartBeatTimerPeriod_sec = periodicity;
APP_LOG(TS_OFF, VLEVEL_M, "\n\n Heartbeat periodicity in NVM =%u sec\n",STS_HeartBeatTimerPeriod_sec);
#else
STS_HeartBeatTimerPeriod_sec = sampling_heartbeat_periodicity;
APP_LOG(TS_OFF, VLEVEL_H, "\n\n sampling or heartbeat periodicity in NVM =%u sec\n",sampling_heartbeat_periodicity);
APP_LOG(TS_OFF, VLEVEL_M, "\n\n sampling or heartbeat periodicity in NVM =%u sec\n",sampling_heartbeat_periodicity);
#endif
OnYunhornSTSHeartBeatPeriodicityChanged(STS_HeartBeatTimerPeriod_sec*1000); //TODO XXXX
if ((sts_cfg_nvm.ac[0] ==0x0 )&& (sts_cfg_nvm.ac[19]==0x0))
{ // ensure it's not in production yet
OnYunhornSTSTxPeriodicityChanged(APP_TX_DUTYCYCLE); // in msec unit
OnYunhornSTSHeartBeatPeriodicityChanged(APP_TX_DUTYCYCLE*5); //TODO XXXX
//OnYunhornSTSHeartBeatPeriodicityChanged(STS_HeartBeatTimerPeriod_sec*1000); //TODO XXXX
//OnTxPeriodicityChanged(10000); // APP_TX_DUTYCYCLE in msec unit
TxPeriodicity = APP_TX_DUTYCYCLE;
} else
{
OnYunhornSTSTxPeriodicityChanged(TxPeriodicity); // in msec unit
//OnYunhornSTSTxPeriodicityChanged(TxPeriodicity); // in msec unit
//OnTxPeriodicityChanged(TxPeriodicity);
//Heart-beat or Sampling interval
//sampling_heartbeat_periodicity = (sampling_heartbeat_periodicity > 0)? sampling_heartbeat_periodicity : 1; // in seconds unit
@ -2039,6 +2066,9 @@ static void STS_Show_STS_CFG_NVM(uint8_t * store_value)
}
void STS_SENSOR_Distance_Test_Process(void)
{
uint8_t prev_sts_lamp_bar_color = sts_lamp_bar_color;
sts_lamp_bar_color = STS_PINK;
#ifdef YUNHORN_STS_O6_ENABLED
sts_distance_rss_distance =0;
do {
@ -2070,8 +2100,11 @@ void STS_SENSOR_Distance_Test_Process(void)
sts_sensor_install_height = range_sum/rpt;
APP_LOG(TS_OFF, VLEVEL_L, "\n STS SENSOR INSTALLATION HEIGHT =%d mm\n\r", (uint16_t)sts_sensor_install_height);
sts_lamp_bar_color = STS_CYAN;
// STS_LMZ_Ambient_Height_Scan_Process();
STS_LMZ_Ambient_Height_Scan_Process();
sts_lamp_bar_color = prev_sts_lamp_bar_color;
STSWakeupScanTimerStart();
#endif
@ -2117,6 +2150,7 @@ void STS_SENSOR_Function_Test_Process(void)
#endif
else
{
STS_SENSOR_Distance_Test_Process();
APP_LOG(TS_OFF, VLEVEL_M, "\nSensor Install Height =%4d mm\n", sts_sensor_install_height);
tstbuf[i++] = (uint8_t) (12)&0xff; //length of following data
@ -3047,13 +3081,15 @@ void OnSensorL8AStateChanged(void)
sts_fhmos_state_changed = 1;
} else if ((sts_head_level_low == 0) && (last_head_level_low_state ==1)&&(STS_Status_Door_Close==sts_hall1_read))
} else if ((sts_head_level_low == 0) && (last_head_level_low_state ==1))
{
fhmos_data.head_low_level_stop_time = sensor_event_time.Seconds;
fhmos_data.state_fall = STS_FHMOS_FALL_STATE_NORMAL;
APP_LOG(TS_OFF, VLEVEL_L, "\r\n Head Level Rise up or Out of Focus Area ++++++++++ \r\n");
sts_fhmos_state_changed = 1;
fhmos_data.state_fall_released = 1;
} else {
sts_fhmos_state_changed = 0;
}
}

View File

@ -187,7 +187,10 @@ void STS_LMZ_Ambient_Height_Scan_Process(void)
uint8_t j=0;
uint16_t bg_distance[64]={0};
uint8_t idx[64]={0};
uint8_t IDX_LEN=20;
uint8_t IDX_LEN=10;
uint8_t prev_sts_lamp_bar_color = sts_lamp_bar_color;
sts_lamp_bar_color = STS_BLUE;
for (i=0; i<64; i++)
{
@ -246,7 +249,7 @@ void STS_LMZ_Ambient_Height_Scan_Process(void)
//}
}
HAL_Delay(150);
HAL_Delay(10);
}
APP_LOG(TS_OFF, VLEVEL_H, "\r\n\n\nAverage Distance==\r\n");
@ -337,6 +340,9 @@ void STS_LMZ_Ambient_Height_Scan_Process(void)
#endif
sts_lamp_bar_color = prev_sts_lamp_bar_color;
}
void sts_generate_fall_gesture_map(void)
@ -499,7 +505,7 @@ void STS_TOF_L8_Process(void)
{
ToF_EventDetected = 0;
#if 1
if (STS_Status_Door_Close == sts_hall1_read)
// if (STS_Status_Door_Close == sts_hall1_read)
{
status = VL53L8A1_RANGING_SENSOR_GetDistance(VL53L8A1_DEV_CENTER, &Result);
if (status == BSP_ERROR_NONE)