diff --git a/Core/Inc/sys_conf.h b/Core/Inc/sys_conf.h index c8e4d0f..f10502a 100644 --- a/Core/Inc/sys_conf.h +++ b/Core/Inc/sys_conf.h @@ -47,7 +47,7 @@ extern "C" { /** * @brief Verbose level for all trace logs */ -#define VERBOSE_LEVEL VLEVEL_L +#define VERBOSE_LEVEL VLEVEL_M /** * @brief Enable trace logs diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index 6b10a6a..27e9f79 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -83,7 +83,7 @@ uint32_t check_time=0; volatile bool motionDetected =false; uint32_t lastMotionTime =0; const uint32_t ledOnDuration = 10000; - +static uint32_t sts_warm_up_count = 0; /* USER CODE END EV */ @@ -541,8 +541,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) { @@ -728,7 +728,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) if (sts_pir_read != last_sts_pir_read) { last_sts_pir_read = sts_hall3_read; - UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); + //UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); } break; @@ -1312,7 +1312,8 @@ static void OnTxTimerEvent(void *context) /* USER CODE BEGIN OnTxTimerEvent_1 */ /* USER CODE END OnTxTimerEvent_1 */ - + if (sts_warm_up_count < 5) + { #ifdef STS_R4 UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP6), CFG_SEQ_Prio_0); #elif defined(STS_M1) @@ -1325,9 +1326,10 @@ static void OnTxTimerEvent(void *context) UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); /*Wait for next tx slot*/ + sts_warm_up_count++; UTIL_TIMER_Start(&TxTimer); /* USER CODE BEGIN OnTxTimerEvent_2 */ - + } /* USER CODE END OnTxTimerEvent_2 */ } diff --git a/STM32CubeIDE/.settings/language.settings.xml b/STM32CubeIDE/.settings/language.settings.xml index 9e6a728..6f79038 100644 --- a/STM32CubeIDE/.settings/language.settings.xml +++ b/STM32CubeIDE/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/STM32CubeIDE/Release/Application/User/Core/subdir.mk b/STM32CubeIDE/Release/Application/User/Core/subdir.mk index f85e725..df1f29e 100644 --- a/STM32CubeIDE/Release/Application/User/Core/subdir.mk +++ b/STM32CubeIDE/Release/Application/User/Core/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Application/User/LoRaWAN/App/subdir.mk b/STM32CubeIDE/Release/Application/User/LoRaWAN/App/subdir.mk index f7cc4b2..65c8e93 100644 --- a/STM32CubeIDE/Release/Application/User/LoRaWAN/App/subdir.mk +++ b/STM32CubeIDE/Release/Application/User/LoRaWAN/App/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Application/User/LoRaWAN/Target/subdir.mk b/STM32CubeIDE/Release/Application/User/LoRaWAN/Target/subdir.mk index d7ad605..a11353d 100644 --- a/STM32CubeIDE/Release/Application/User/LoRaWAN/Target/subdir.mk +++ b/STM32CubeIDE/Release/Application/User/LoRaWAN/Target/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Application/User/STS/Core/Src/subdir.mk b/STM32CubeIDE/Release/Application/User/STS/Core/Src/subdir.mk index b2e6241..63c75f4 100644 --- a/STM32CubeIDE/Release/Application/User/STS/Core/Src/subdir.mk +++ b/STM32CubeIDE/Release/Application/User/STS/Core/Src/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk b/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk index 72b511e..55b12d7 100644 --- a/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk +++ b/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Application/User/STS/TOF/Target/subdir.mk b/STM32CubeIDE/Release/Application/User/STS/TOF/Target/subdir.mk index e7a9bbd..e5922cd 100644 --- a/STM32CubeIDE/Release/Application/User/STS/TOF/Target/subdir.mk +++ b/STM32CubeIDE/Release/Application/User/STS/TOF/Target/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Application/User/Startup/subdir.mk b/STM32CubeIDE/Release/Application/User/Startup/subdir.mk index 140938e..cc5db04 100644 --- a/STM32CubeIDE/Release/Application/User/Startup/subdir.mk +++ b/STM32CubeIDE/Release/Application/User/Startup/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Drivers/BSP/53L8A1/subdir.mk b/STM32CubeIDE/Release/Drivers/BSP/53L8A1/subdir.mk index e703e10..e71993d 100644 --- a/STM32CubeIDE/Release/Drivers/BSP/53L8A1/subdir.mk +++ b/STM32CubeIDE/Release/Drivers/BSP/53L8A1/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Drivers/BSP/Components/subdir.mk b/STM32CubeIDE/Release/Drivers/BSP/Components/subdir.mk index 74cc73a..f0fdf6b 100644 --- a/STM32CubeIDE/Release/Drivers/BSP/Components/subdir.mk +++ b/STM32CubeIDE/Release/Drivers/BSP/Components/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Drivers/CMSIS/subdir.mk b/STM32CubeIDE/Release/Drivers/CMSIS/subdir.mk index f9a98ba..1cd765c 100644 --- a/STM32CubeIDE/Release/Drivers/CMSIS/subdir.mk +++ b/STM32CubeIDE/Release/Drivers/CMSIS/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Drivers/STM32WLxx_HAL_Driver/subdir.mk b/STM32CubeIDE/Release/Drivers/STM32WLxx_HAL_Driver/subdir.mk index 5e5aa98..0d5d681 100644 --- a/STM32CubeIDE/Release/Drivers/STM32WLxx_HAL_Driver/subdir.mk +++ b/STM32CubeIDE/Release/Drivers/STM32WLxx_HAL_Driver/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Middlewares/LoRaWAN/subdir.mk b/STM32CubeIDE/Release/Middlewares/LoRaWAN/subdir.mk index ba0a44b..eae0ba4 100644 --- a/STM32CubeIDE/Release/Middlewares/LoRaWAN/subdir.mk +++ b/STM32CubeIDE/Release/Middlewares/LoRaWAN/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Middlewares/SubGHz_Phy/subdir.mk b/STM32CubeIDE/Release/Middlewares/SubGHz_Phy/subdir.mk index b9ca60b..da9d856 100644 --- a/STM32CubeIDE/Release/Middlewares/SubGHz_Phy/subdir.mk +++ b/STM32CubeIDE/Release/Middlewares/SubGHz_Phy/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/Utilities/subdir.mk b/STM32CubeIDE/Release/Utilities/subdir.mk index de816b4..826d8ef 100644 --- a/STM32CubeIDE/Release/Utilities/subdir.mk +++ b/STM32CubeIDE/Release/Utilities/subdir.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ # Add inputs and outputs from these tool invocations to the build variables diff --git a/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin b/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin index d828b0c..98aac1c 100644 Binary files a/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin and b/STM32CubeIDE/Release/WLE5CC_NODE_STS.bin differ diff --git a/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf b/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf index 5f27c32..ce7a891 100644 Binary files a/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf and b/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf differ diff --git a/STM32CubeIDE/Release/makefile b/STM32CubeIDE/Release/makefile index 36e5c5c..20dc099 100644 --- a/STM32CubeIDE/Release/makefile +++ b/STM32CubeIDE/Release/makefile @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ -include ../makefile.init diff --git a/STM32CubeIDE/Release/objects.mk b/STM32CubeIDE/Release/objects.mk index a5103de..515d2a4 100644 --- a/STM32CubeIDE/Release/objects.mk +++ b/STM32CubeIDE/Release/objects.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ USER_OBJS := diff --git a/STM32CubeIDE/Release/sources.mk b/STM32CubeIDE/Release/sources.mk index 4110fdd..3380d01 100644 --- a/STM32CubeIDE/Release/sources.mk +++ b/STM32CubeIDE/Release/sources.mk @@ -1,6 +1,6 @@ ################################################################################ # Automatically-generated file. Do not edit! -# Toolchain: GNU Tools for STM32 (12.3.rel1) +# Toolchain: GNU Tools for STM32 (13.3.rel1) ################################################################################ ELF_SRCS := diff --git a/STS/Core/Src/yunhorn_sts_process.c b/STS/Core/Src/yunhorn_sts_process.c index 5005506..90025bb 100644 --- a/STS/Core/Src/yunhorn_sts_process.c +++ b/STS/Core/Src/yunhorn_sts_process.c @@ -1664,7 +1664,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; @@ -1722,10 +1722,11 @@ void OnStoreSTSCFGContextRequest(void) /* USER CODE END OnStoreContextRequest_1 */ /* store nvm in flash */ + UTIL_MEM_cpy_8((void*)&to_store__value[YUNHORN_STS_MAX_NVM_CFG_SIZE], (void*)to_store__value,YUNHORN_STS_MAX_NVM_CFG_SIZE); 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 */ @@ -1828,11 +1829,10 @@ 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 + //periodicity *= 1000; // to ms + //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') { @@ -1843,23 +1843,28 @@ void OnRestoreSTSCFGContextProcess(void) 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); + OnYunhornSTSHeartBeatPeriodicityChanged(STS_HeartBeatTimerPeriod_sec*1000); //TODO XXXX +#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); + OnYunhornSTSHeartBeatPeriodicityChanged(STS_HeartBeatTimerPeriod_sec*1000); //TODO XXXX +#endif 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 + //OnYunhornSTSHeartBeatPeriodicityChanged(APP_TX_DUTYCYCLE*5); //TODO XXXX + //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