diff --git a/Core/Inc/main.h b/Core/Inc/main.h
index 751a611..d3a0266 100644
--- a/Core/Inc/main.h
+++ b/Core/Inc/main.h
@@ -64,8 +64,7 @@ void Error_Handler(void);
 #define LED1_Pin GPIO_PIN_15
 #define LED1_GPIO_Port GPIOB
 #endif
-#define LED2_Pin GPIO_PIN_9
-#define LED2_GPIO_Port GPIOB
+
 #define BUT1_Pin GPIO_PIN_0
 #define BUT1_GPIO_Port GPIOA
 #define BUT1_EXTI_IRQn EXTI0_IRQn
@@ -100,6 +99,7 @@ void Error_Handler(void);
 #define BUT2_GPIO_Port GPIOA
 #define BUT2_EXTI_IRQn EXTI1_IRQn
 
+
 #ifdef	STS_O5
 // STS_O5 GPIO PORT PIN DEFINATION SINGLE BOARD
 /*  --------------------------------------------------*/
@@ -120,17 +120,44 @@ void Error_Handler(void);
 #define HALL2_STATE						HAL_GPIO_ReadPin(HALL2_GPIO_Port, HALL2_Pin)
 #endif
 
+// GREEN LED
 #define LED1_Pin 						GPIO_PIN_2
 #define LED1_GPIO_Port 					GPIOB
+
+// RED LED
+#define LED2_Pin 						GPIO_PIN_7
+#define LED2_GPIO_Port 					GPIOB
+
 #endif
 #define	BUT1_State		HAL_GPIO_ReadPin(BUT1_GPIO_Port, BUT1_Pin)
 #define	BUT2_State		HAL_GPIO_ReadPin(BUT2_GPIO_Port, BUT2_Pin)
 
+// GREEN LED
 #define LED1_ON			HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET )
 #define LED1_OFF		HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET)
+
+// RED LED
+#define LED2_ON			HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_SET )
+#define LED2_OFF		HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET)
+
+#define LED_GREEN_ON	LED1_ON
+#define LED_GREEN_OFF	LED1_OFF
+
+#define LED_RED_ON		LED2_ON
+#define LED_RED_OFF		LED2_OFF
+
 #define LED1_STATE		HAL_GPIO_ReadPin(LED1_GPIO_Port, LED1_Pin)
 #define LED1_TOGGLE		HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin)
 
+// for PIR sensor
+#ifdef	STS_T6
+#define PIR_Pin 					GPIO_PIN_6
+#define PIR_GPIO_Port 				GPIOB
+#define PIR_EXTI_IRQn 				EXTI9_5_IRQn
+#define	PIR_STATE					HAL_GPIO_ReadPin(PIR_GPIO_Port, PIR_Pin)
+
+#endif
+
 #ifndef L8
 #define MEMS_POWER_Pin							GPIO_PIN_4				// PMU_ENABLE
 #define MEMS_POWER_GPIO_Port 					GPIOB					// PMU_ENABLE
diff --git a/Core/Src/dma.c b/Core/Src/dma.c
index de0dc82..d04f763 100644
--- a/Core/Src/dma.c
+++ b/Core/Src/dma.c
@@ -51,7 +51,7 @@ void MX_DMA_Init(void)
   HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
 
   // I2C2
-#if 0
+#if 1
 #if	defined(VL53LX)||defined(VL53L0)
   /* DMA1_Channel3_IRQn interrupt configuration */
   /* I2C2 RX */
@@ -82,11 +82,11 @@ void MX_DMA_Init(void)
    HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 0, 0);
    HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn);
    /* DMA1_Channel7_IRQn interrupt configuration */
-   //HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0);
-   //HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn);
+   HAL_NVIC_SetPriority(DMA1_Channel7_IRQn, 0, 0);
+   HAL_NVIC_EnableIRQ(DMA1_Channel7_IRQn);
 
-  HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 2, 0);
-  HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);
+  // HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 2, 0);
+  // HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);
 
 
 }
diff --git a/Core/Src/gpio.c b/Core/Src/gpio.c
index 287b9b3..bbfa31d 100644
--- a/Core/Src/gpio.c
+++ b/Core/Src/gpio.c
@@ -56,6 +56,11 @@ void MX_GPIO_Init(void)
   HAL_GPIO_WritePin(VL53L8A1_PWR_EN_C_PORT, VL53L8A1_PWR_EN_C_PIN, GPIO_PIN_SET);
   HAL_GPIO_WritePin(VL53L8A1_LPn_C_PORT, VL53L8A1_LPn_C_PIN, GPIO_PIN_SET);
 #endif
+
+#if	defined(STS_T6)||defined(STS_P2)
+  HAL_GPIO_WritePin(TOF_C_XSHUT_GPIO_Port, TOF_C_XSHUT_Pin, GPIO_PIN_SET);
+#endif
+
   /*Configure GPIO pins : PBPin PBPin PBPin */
   GPIO_InitStruct.Pin = LED1_Pin|LED2_Pin|LED3_Pin;
   GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
@@ -82,6 +87,15 @@ void MX_GPIO_Init(void)
   HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
 #endif
 
+#ifdef STS_T6
+  GPIO_InitStruct.Pin = PIR_Pin;
+  GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; //GPIO_MODE_INPUT;
+  GPIO_InitStruct.Pull = GPIO_PULLUP;
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+  HAL_GPIO_Init(PIR_GPIO_Port, &GPIO_InitStruct);
+
+#endif
+
 #if defined(STM32WL55xx)
   /*Configure GPIO pins : PBPin PBPin */
   GPIO_InitStruct.Pin = PROB2_Pin|PROB1_Pin;
@@ -140,16 +154,14 @@ void MX_GPIO_Init(void)
   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
   HAL_GPIO_Init(TOF_C_XSHUT_GPIO_Port, &GPIO_InitStruct);
 
+#if 0
 	/*Configure GPIO pins : TOF_L_XSHUT_Pin */
   GPIO_InitStruct.Pin = TOF_L_XSHUT_Pin;
   GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
   GPIO_InitStruct.Pull = GPIO_PULLUP;
   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
   HAL_GPIO_Init(TOF_L_XSHUT_GPIO_Port, &GPIO_InitStruct);
-
-
-  HAL_NVIC_SetPriority(TOF_C_INT_EXTI_IRQn, 0, 0);
-  HAL_NVIC_EnableIRQ(TOF_C_INT_EXTI_IRQn);
+#endif
 
 #endif
 
@@ -196,15 +208,23 @@ void MX_GPIO_Init(void)
 /* ==============   SOAP LEVEL DETECTION ========================= */
 
   /* EXTI interrupt init*/
-  HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);
+  HAL_NVIC_SetPriority(EXTI0_IRQn, 2, 0);
   HAL_NVIC_EnableIRQ(EXTI0_IRQn);
 
-  HAL_NVIC_SetPriority(EXTI1_IRQn, 0, 0);
+  HAL_NVIC_SetPriority(EXTI1_IRQn, 2, 0);
   HAL_NVIC_EnableIRQ(EXTI1_IRQn);
 
+  HAL_NVIC_SetPriority(TOF_C_INT_EXTI_IRQn, 0, 0);
+  HAL_NVIC_EnableIRQ(TOF_C_INT_EXTI_IRQn);
+
+
   HAL_NVIC_SetPriority(EXTI15_10_IRQn, 0, 0);
   HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
 
+#ifdef	STS_T6
+  HAL_NVIC_SetPriority(PIR_EXTI_IRQn, 0, 0);
+  HAL_NVIC_EnableIRQ(PIR_EXTI_IRQn);
+#endif
 
 //  HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0);
 //  HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
diff --git a/Core/Src/i2c.c b/Core/Src/i2c.c
index 2713947..d30aea8 100644
--- a/Core/Src/i2c.c
+++ b/Core/Src/i2c.c
@@ -46,7 +46,7 @@ void MX_I2C2_Init(void)
 #ifdef L8
   hi2c2.Init.Timing = I2C2_FAST_PLUS_1M;
 #else
-  hi2c2.Init.Timing = I2C2_STANDARD_100K;
+  hi2c2.Init.Timing = I2C2_FAST_400K;
 #endif
   hi2c2.Init.OwnAddress1 = 0;
   hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
diff --git a/Core/Src/main.c b/Core/Src/main.c
index ed857e0..8f32d48 100644
--- a/Core/Src/main.c
+++ b/Core/Src/main.c
@@ -32,6 +32,7 @@
 #include "app_tof.h"
 #include "app_tof_peoplecount.h"
 #elif defined(STS_T6)
+#include "app_tof_peoplecount.h"
 #include "app_tof.h"
 #elif defined(L8)
 #include "app_tof.h"
@@ -118,10 +119,14 @@ int main(void)
 #endif
       MX_LoRaWAN_Init();
   }
-//PME_ON;
-//WATER_LEAKAGE_ENABLE;
+
   /* USER CODE BEGIN 2 */
+
   //MX_USART2_UART_Init();
+
+  STS_TOF_VL53LX_PresenceDetection_Process_Init();
+
+
   /* USER CODE END 2 */
 
   /* Infinite loop */
diff --git a/Core/Src/stm32wlxx_it.c b/Core/Src/stm32wlxx_it.c
index 110506c..ece34a8 100644
--- a/Core/Src/stm32wlxx_it.c
+++ b/Core/Src/stm32wlxx_it.c
@@ -407,7 +407,9 @@ void EXTI9_5_IRQHandler(void)
 #elif defined(RM2)&&(defined(VL53L0)||defined(VL53LX))
   HAL_GPIO_EXTI_IRQHandler(TOF_INT_EXTI_PIN);
 #endif
-
+#ifdef	STS_T6
+  HAL_GPIO_EXTI_IRQHandler(PIR_Pin);
+#endif
   /* USER CODE BEGIN EXTI9_5_IRQn 1 */
 
   /* USER CODE END EXTI9_5_IRQn 1 */
diff --git a/Core/Src/sts_lamp_bar.c b/Core/Src/sts_lamp_bar.c
index 01fb69b..678b6fe 100644
--- a/Core/Src/sts_lamp_bar.c
+++ b/Core/Src/sts_lamp_bar.c
@@ -57,6 +57,7 @@ extern volatile uint8_t sts_work_mode;
 volatile uint8_t sts_reed_hall_ext_int = 0;
 volatile uint8_t sts_status_color = STS_GREEN;
 volatile uint8_t sts_lamp_bar_color = STS_GREEN;		//puColor
+volatile uint8_t sts_color_occupy_vacant = (STS_GREEN<<4)|(STS_RED&0x0f);
 volatile uint8_t sts_lamp_bar_flashing_color = STS_RED_DARK; //0x23; RED_BLUE;
 volatile uint8_t sts_cloud_netcolor = STS_GREEN;		//netColor
 extern volatile uint8_t sts_occupancy_status;
diff --git a/Core/Src/sys_app.c b/Core/Src/sys_app.c
index 64cf9ae..1c4673c 100644
--- a/Core/Src/sys_app.c
+++ b/Core/Src/sys_app.c
@@ -133,9 +133,22 @@ void SystemApp_Init(void)
   STS_TOF_VL53LX_PeopleCounting_Process_Init();
 #endif
 #if defined(STS_T6)
-  STS_TOF_VL53LX_PresenceDetection_Process_Init();
+  //STS_TOF_VL53LX_PresenceDetection_Process_Init();
   //STS_Lamp_Bar_Self_Test_Simple();
-  STS_Lamp_Bar_Self_Test();
+  //STS_Lamp_Bar_Self_Test();
+  LED_GREEN_ON;HAL_Delay(50);
+  LED_RED_ON;HAL_Delay(50);
+  LED_GREEN_OFF;HAL_Delay(50);
+  LED_RED_OFF;HAL_Delay(50);
+  LED_GREEN_ON;HAL_Delay(150);
+  LED_RED_ON;HAL_Delay(150);
+  LED_GREEN_OFF;HAL_Delay(150);
+  LED_RED_OFF;HAL_Delay(150);
+  LED_GREEN_ON;HAL_Delay(50);
+  LED_RED_ON;HAL_Delay(50);
+  LED_GREEN_OFF;HAL_Delay(50);
+  LED_RED_OFF;HAL_Delay(50);
+
 #endif
 
   /*Init low power manager*/
diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c
index ca02418..aa2b2f2 100644
--- a/LoRaWAN/App/lora_app.c
+++ b/LoRaWAN/App/lora_app.c
@@ -54,6 +54,7 @@ volatile static bool r_b=true;
 extern volatile sts_cfg_nvm_t sts_cfg_nvm;
 extern volatile uint32_t rfac_timer;
 extern volatile uint32_t STS_TOFScanPeriod_msec, STS_TxPeriod_sec, STS_HeartBeatTimerPeriod_sec;
+extern volatile uint8_t sts_pir_state;
 volatile uint8_t sts_data_buf[LORAWAN_APP_DATA_BUFFER_MAX_SIZE]={0x0};
 //volatile LmHandlerAppData_t sts_app_data={ 0, 0, sts_data_buf };
 #ifdef 	STS_M1
@@ -473,7 +474,7 @@ void LoRaWAN_Init(void)
   UTIL_TIMER_Create(&RxLedTimer, LED_PERIOD_TIME, UTIL_TIMER_ONESHOT, OnRxTimerLedEvent, NULL);
   UTIL_TIMER_Create(&JoinLedTimer, LED_PERIOD_TIME, UTIL_TIMER_PERIODIC, OnJoinTimerLedEvent, NULL);
   UTIL_TIMER_Create(&STSLampBarColorTimer, LED_PERIOD_TIME, UTIL_TIMER_ONESHOT, OnYunhornSTSLampBarColorTimerEvent, NULL);
-  UTIL_TIMER_Create(&STSDurationCheckTimer, 20*LED_PERIOD_TIME, UTIL_TIMER_PERIODIC, OnYunhornSTSDurationCheckTimerEvent, NULL);
+  UTIL_TIMER_Create(&STSDurationCheckTimer, 20*LED_PERIOD_TIME, UTIL_TIMER_ONESHOT, OnYunhornSTSDurationCheckTimerEvent, NULL);
 
   if (FLASH_IF_Init(NULL) != FLASH_IF_OK)
   {
@@ -554,6 +555,7 @@ void LoRaWAN_Init(void)
 
 #if	defined(STS_T6)||defined(L8)
   UTIL_TIMER_Create(&YunhornSTSWakeUpScanTimer, STS_TOFScanPeriod_msec, UTIL_TIMER_PERIODIC, (void*)OnYunhornSTSWakeUpScanTimerEvent, NULL);
+  //UTIL_TIMER_Create(&YunhornSTSWakeUpScanTimer, STS_TOFScanPeriod_msec, UTIL_TIMER_PERIODIC, (void*)STS_TOF_VL53LX_PresenceDetection_Process_Start, NULL);
   UTIL_TIMER_Start(&YunhornSTSWakeUpScanTimer);
 
   UTIL_TIMER_Start(&STSLampBarColorTimer);
@@ -651,6 +653,16 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
       UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaStoreContextEvent), CFG_SEQ_Prio_0);
       break;
 #endif
+#ifdef STS_T6
+    case  PIR_Pin:
+    	sts_pir_state= PIR_STATE;
+    	  HAL_Delay(100);
+    	  __HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
+    	  APP_LOG(TS_OFF, VLEVEL_M, "\r\nMotion Detection result=%d \r\n", sts_pir_state);
+    	// UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
+
+      break;
+#endif
 #if	(defined(VL53L0)||defined(VL53LX)||defined(L8))
     case TOF_INT_EXTI_PIN:
     	 ToF_EventDetected = 1;
@@ -1051,8 +1063,11 @@ static void SendTxData(void)
 #endif	//STS_P2
 
 #if	defined(STS_T6)
-     AppData.Buffer[i++] = 1;
+     AppData.Buffer[i++] = 4;
      AppData.Buffer[i++] = (uint8_t)((sts_t6_sensor_data.tof_range_presence_state & 0xFF));
+     AppData.Buffer[i++] = (uint8_t)((sts_t6_sensor_data.pir_motion_sensor_state  & 0xFF));
+     AppData.Buffer[i++] = (uint8_t)((sts_t6_sensor_data.lamp_bar_color  & 0xFF));
+     AppData.Buffer[i++] = (uint8_t)((sts_t6_sensor_data.tof_presence_distance_dm & 0xFF));
 
 #endif	//STS_T6
 
@@ -1116,6 +1131,7 @@ static void OnTxTimerEvent(void *context)
   /* USER CODE BEGIN OnTxTimerEvent_1 */
 
   /* USER CODE END OnTxTimerEvent_1 */
+	UTIL_TIMER_Stop(&TxTimer);
 
 #ifdef STS_R4
   UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP6), CFG_SEQ_Prio_0);
@@ -1124,7 +1140,7 @@ static void OnTxTimerEvent(void *context)
 #elif (defined(STS_R1D)||defined(STS_R5)||defined(STS_R1))
   APP_LOG(TS_OFF, VLEVEL_H, "\nSET TASK  P4\r\n");
   UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), CFG_SEQ_Prio_0);
-#elif (defined(STS_P2))
+#elif (defined(STS_P2)||defined(STS_T6))
 
 	UTIL_TIMER_Stop(&YunhornSTSWakeUpScanTimer);
 
@@ -1134,7 +1150,7 @@ static void OnTxTimerEvent(void *context)
 	UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
 
 
-#if (defined(STS_P2))
+#if (defined(STS_P2)||defined(STS_T6))
 	UTIL_TIMER_Start(&YunhornSTSWakeUpScanTimer);
 #endif
 
@@ -1612,9 +1628,10 @@ void OnYunhornSTSHeartBeatPeriodicityChanged(uint32_t periodicity)
 static void OnYunhornSTSWakeUpScanTimerEvent(void *context)
 {
 #if	defined(STS_P2)||defined(STS_T6)||defined(L8)
+	// UTIL_TIMER_Stop(&YunhornSTSWakeUpScanTimer);
   UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP5), CFG_SEQ_Prio_0);
 
-  //UTIL_TIMER_Start(&YunhornSTSWakeUpScanTimer);
+  // UTIL_TIMER_Start(&YunhornSTSWakeUpScanTimer);
 #endif
 
 }
diff --git a/STM32CubeIDE/.cproject b/STM32CubeIDE/.cproject
index 8648789..fffa6ba 100644
--- a/STM32CubeIDE/.cproject
+++ b/STM32CubeIDE/.cproject
@@ -99,7 +99,7 @@
 						</toolChain>
 					</folderInfo>
 					<sourceEntries>
-						<entry excluding="Application/User/STS/TOF/vl53l0x" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+						<entry excluding="Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.c|Application/User/STS/TOF/App/app_tof_vl53l0x_range.c|Application/User/Core/stm32wlxx_nucleo_bus.c|Application/User/STS/TOF/vl53l0x" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
 					</sourceEntries>
 				</configuration>
 			</storageModule>
@@ -213,7 +213,7 @@
 						</toolChain>
 					</folderInfo>
 					<sourceEntries>
-						<entry excluding="Application/User/STS/TOF/vl53l0x" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+						<entry excluding="Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.c|Application/User/STS/TOF/App/app_tof_vl53l0x_range.c|Application/User/Core/stm32wlxx_nucleo_bus.c|Application/User/STS/TOF/vl53l0x" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
 					</sourceEntries>
 				</configuration>
 			</storageModule>
diff --git a/STM32CubeIDE/.project b/STM32CubeIDE/.project
index 7c66716..f011a7c 100644
--- a/STM32CubeIDE/.project
+++ b/STM32CubeIDE/.project
@@ -442,11 +442,6 @@
 			<type>1</type>
 			<locationURI>copy_PARENT/Core/Src/stm32wlxx_it.c</locationURI>
 		</link>
-		<link>
-			<name>Application/User/Core/stm32wlxx_nucleo_bus.c</name>
-			<type>1</type>
-			<locationURI>PARENT-1-PROJECT_LOC/Core/Src/stm32wlxx_nucleo_bus.c</locationURI>
-		</link>
 		<link>
 			<name>Application/User/Core/sts_lamp_bar.c</name>
 			<type>1</type>
@@ -590,7 +585,7 @@
 		<link>
 			<name>Application/User/STS/TOF/App/app_tof.c</name>
 			<type>1</type>
-			<location>D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof.c</location>
+			<locationURI>copy_PARENT/STS/TOF/App/app_tof.c</locationURI>
 		</link>
 		<link>
 			<name>Application/User/STS/TOF/App/app_tof.h</name>
@@ -717,66 +712,21 @@
 			<type>1</type>
 			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/VL53L1X_api.c</locationURI>
 		</link>
-		<link>
-			<name>Application/User/STS/TOF/vl53l1x_uld/VL53L1X_api.h</name>
-			<type>1</type>
-			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/VL53L1X_api.h</locationURI>
-		</link>
 		<link>
 			<name>Application/User/STS/TOF/vl53l1x_uld/VL53L1X_calibration.c</name>
 			<type>1</type>
 			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/VL53L1X_calibration.c</locationURI>
 		</link>
-		<link>
-			<name>Application/User/STS/TOF/vl53l1x_uld/VL53L1X_calibration.h</name>
-			<type>1</type>
-			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/VL53L1X_calibration.h</locationURI>
-		</link>
 		<link>
 			<name>Application/User/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.c</name>
 			<type>1</type>
 			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.c</locationURI>
 		</link>
-		<link>
-			<name>Application/User/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.h</name>
-			<type>1</type>
-			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.h</locationURI>
-		</link>
-		<link>
-			<name>Application/User/STS/TOF/vl53l1x_uld/vl53l1_error_codes.h</name>
-			<type>1</type>
-			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/vl53l1_error_codes.h</locationURI>
-		</link>
 		<link>
 			<name>Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform.c</name>
 			<type>1</type>
 			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/vl53l1_platform.c</locationURI>
 		</link>
-		<link>
-			<name>Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform.h</name>
-			<type>1</type>
-			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/vl53l1_platform.h</locationURI>
-		</link>
-		<link>
-			<name>Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform_log.h</name>
-			<type>1</type>
-			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/vl53l1_platform_log.h</locationURI>
-		</link>
-		<link>
-			<name>Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform_user_config.h</name>
-			<type>1</type>
-			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/vl53l1_platform_user_config.h</locationURI>
-		</link>
-		<link>
-			<name>Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform_user_defines.h</name>
-			<type>1</type>
-			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/vl53l1_platform_user_defines.h</locationURI>
-		</link>
-		<link>
-			<name>Application/User/STS/TOF/vl53l1x_uld/vl53l1_types.h</name>
-			<type>1</type>
-			<locationURI>copy_PARENT/STS/TOF/vl53l1x_uld/vl53l1_types.h</locationURI>
-		</link>
 	</linkedResources>
 	<variableList>
 		<variable>
diff --git a/STM32CubeIDE/.settings/language.settings.xml b/STM32CubeIDE/.settings/language.settings.xml
index 4b0e6ff..f1b15d8 100644
--- a/STM32CubeIDE/.settings/language.settings.xml
+++ b/STM32CubeIDE/.settings/language.settings.xml
@@ -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="962004915065611908" 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="-1581009204476899933" 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="962004915065611908" 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="-1581009204476899933" 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>
diff --git a/STM32CubeIDE/Release/Application/User/Core/subdir.mk b/STM32CubeIDE/Release/Application/User/Core/subdir.mk
index 05ebf4f..a62f204 100644
--- a/STM32CubeIDE/Release/Application/User/Core/subdir.mk
+++ b/STM32CubeIDE/Release/Application/User/Core/subdir.mk
@@ -16,7 +16,6 @@ D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_S
 D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/stm32_lpm_if.c \
 D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/stm32wlxx_hal_msp.c \
 D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/stm32wlxx_it.c \
-D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/stm32wlxx_nucleo_bus.c \
 D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/sts_lamp_bar.c \
 D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/subghz.c \
 D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/sys_app.c \
@@ -41,7 +40,6 @@ OBJS += \
 ./Application/User/Core/stm32_lpm_if.o \
 ./Application/User/Core/stm32wlxx_hal_msp.o \
 ./Application/User/Core/stm32wlxx_it.o \
-./Application/User/Core/stm32wlxx_nucleo_bus.o \
 ./Application/User/Core/sts_lamp_bar.o \
 ./Application/User/Core/subghz.o \
 ./Application/User/Core/sys_app.o \
@@ -66,7 +64,6 @@ C_DEPS += \
 ./Application/User/Core/stm32_lpm_if.d \
 ./Application/User/Core/stm32wlxx_hal_msp.d \
 ./Application/User/Core/stm32wlxx_it.d \
-./Application/User/Core/stm32wlxx_nucleo_bus.d \
 ./Application/User/Core/sts_lamp_bar.d \
 ./Application/User/Core/subghz.d \
 ./Application/User/Core/sys_app.d \
@@ -103,8 +100,6 @@ Application/User/Core/stm32wlxx_hal_msp.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLE
 	arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_T6 -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/stm32wlxx_it.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/stm32wlxx_it.c Application/User/Core/subdir.mk
 	arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_T6 -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/stm32wlxx_nucleo_bus.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/stm32wlxx_nucleo_bus.c Application/User/Core/subdir.mk
-	arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_T6 -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/sts_lamp_bar.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/sts_lamp_bar.c Application/User/Core/subdir.mk
 	arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_T6 -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/subghz.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/Core/Src/subghz.c Application/User/Core/subdir.mk
@@ -129,7 +124,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/i2c.cyclo ./Application/User/Core/i2c.d ./Application/User/Core/i2c.o ./Application/User/Core/i2c.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/i2c.cyclo ./Application/User/Core/i2c.d ./Application/User/Core/i2c.o ./Application/User/Core/i2c.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/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
 
diff --git a/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk b/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk
index dbdb021..86645ab 100644
--- a/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk
+++ b/STM32CubeIDE/Release/Application/User/STS/TOF/App/subdir.mk
@@ -5,38 +5,28 @@
 
 # Add inputs and outputs from these tool invocations to the build variables 
 C_SRCS += \
-D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/X-WL55_WLE5_53L0X.c \
 D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof.c \
-D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof_peoplecount.c \
-D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof_vl53l0x_range.c 
+D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof_peoplecount.c 
 
 OBJS += \
-./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.o \
 ./Application/User/STS/TOF/App/app_tof.o \
-./Application/User/STS/TOF/App/app_tof_peoplecount.o \
-./Application/User/STS/TOF/App/app_tof_vl53l0x_range.o 
+./Application/User/STS/TOF/App/app_tof_peoplecount.o 
 
 C_DEPS += \
-./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.d \
 ./Application/User/STS/TOF/App/app_tof.d \
-./Application/User/STS/TOF/App/app_tof_peoplecount.d \
-./Application/User/STS/TOF/App/app_tof_vl53l0x_range.d 
+./Application/User/STS/TOF/App/app_tof_peoplecount.d 
 
 
 # Each subdirectory must supply rules for building sources it contributes
-Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/X-WL55_WLE5_53L0X.c Application/User/STS/TOF/App/subdir.mk
-	arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_T6 -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/STS/TOF/App/app_tof.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof.c Application/User/STS/TOF/App/subdir.mk
 	arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_T6 -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/STS/TOF/App/app_tof_peoplecount.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof_peoplecount.c Application/User/STS/TOF/App/subdir.mk
 	arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_T6 -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/STS/TOF/App/app_tof_vl53l0x_range.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/App/app_tof_vl53l0x_range.c Application/User/STS/TOF/App/subdir.mk
-	arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_T6 -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 "$@"
 
 clean: clean-Application-2f-User-2f-STS-2f-TOF-2f-App
 
 clean-Application-2f-User-2f-STS-2f-TOF-2f-App:
-	-$(RM) ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.cyclo ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.d ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.o ./Application/User/STS/TOF/App/X-WL55_WLE5_53L0X.su ./Application/User/STS/TOF/App/app_tof.cyclo ./Application/User/STS/TOF/App/app_tof.d ./Application/User/STS/TOF/App/app_tof.o ./Application/User/STS/TOF/App/app_tof.su ./Application/User/STS/TOF/App/app_tof_peoplecount.cyclo ./Application/User/STS/TOF/App/app_tof_peoplecount.d ./Application/User/STS/TOF/App/app_tof_peoplecount.o ./Application/User/STS/TOF/App/app_tof_peoplecount.su ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.cyclo ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.d ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.o ./Application/User/STS/TOF/App/app_tof_vl53l0x_range.su
+	-$(RM) ./Application/User/STS/TOF/App/app_tof.cyclo ./Application/User/STS/TOF/App/app_tof.d ./Application/User/STS/TOF/App/app_tof.o ./Application/User/STS/TOF/App/app_tof.su ./Application/User/STS/TOF/App/app_tof_peoplecount.cyclo ./Application/User/STS/TOF/App/app_tof_peoplecount.d ./Application/User/STS/TOF/App/app_tof_peoplecount.o ./Application/User/STS/TOF/App/app_tof_peoplecount.su
 
 .PHONY: clean-Application-2f-User-2f-STS-2f-TOF-2f-App
 
diff --git a/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf b/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf
deleted file mode 100644
index 32d6d21..0000000
Binary files a/STM32CubeIDE/Release/WLE5CC_NODE_STS.elf and /dev/null differ
diff --git a/STM32CubeIDE/Release/WLE5CC_NODE_STS_T6_debug_2024DEC18r0.elf b/STM32CubeIDE/Release/WLE5CC_NODE_STS_T6_debug_2024DEC18r0.elf
new file mode 100644
index 0000000..4e22e76
Binary files /dev/null and b/STM32CubeIDE/Release/WLE5CC_NODE_STS_T6_debug_2024DEC18r0.elf differ
diff --git a/STM32CubeIDE/Release/makefile b/STM32CubeIDE/Release/makefile
deleted file mode 100644
index db9d122..0000000
--- a/STM32CubeIDE/Release/makefile
+++ /dev/null
@@ -1,104 +0,0 @@
-################################################################################
-# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
-################################################################################
-
--include ../makefile.init
-
-RM := rm -rf
-
-# All of the sources participating in the build are defined here
--include sources.mk
--include Utilities/subdir.mk
--include Middlewares/SubGHz_Phy/subdir.mk
--include Middlewares/LoRaWAN/subdir.mk
--include Drivers/STM32WLxx_HAL_Driver/subdir.mk
--include Drivers/CMSIS/subdir.mk
--include Application/User/Startup/subdir.mk
--include Application/User/STS/TOF/vl53l1x_uld/subdir.mk
--include Application/User/STS/TOF/Target/subdir.mk
--include Application/User/STS/TOF/App/subdir.mk
--include Application/User/STS/Core/Src/subdir.mk
--include Application/User/LoRaWAN/Target/subdir.mk
--include Application/User/LoRaWAN/App/subdir.mk
--include Application/User/Core/subdir.mk
--include objects.mk
-
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(strip $(S_DEPS)),)
--include $(S_DEPS)
-endif
-ifneq ($(strip $(S_UPPER_DEPS)),)
--include $(S_UPPER_DEPS)
-endif
-ifneq ($(strip $(C_DEPS)),)
--include $(C_DEPS)
-endif
-endif
-
--include ../makefile.defs
-
-OPTIONAL_TOOL_DEPS := \
-$(wildcard ../makefile.defs) \
-$(wildcard ../makefile.init) \
-$(wildcard ../makefile.targets) \
-
-
-BUILD_ARTIFACT_NAME := WLE5CC_NODE_STS
-BUILD_ARTIFACT_EXTENSION := elf
-BUILD_ARTIFACT_PREFIX :=
-BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),)
-
-# Add inputs and outputs from these tool invocations to the build variables 
-EXECUTABLES += \
-WLE5CC_NODE_STS.elf \
-
-MAP_FILES += \
-WLE5CC_NODE_STS.map \
-
-SIZE_OUTPUT += \
-default.size.stdout \
-
-OBJDUMP_LIST += \
-WLE5CC_NODE_STS.list \
-
-
-# All Target
-all: main-build
-
-# Main-build Target
-main-build: WLE5CC_NODE_STS.elf secondary-outputs
-
-# Tool invocations
-WLE5CC_NODE_STS.elf WLE5CC_NODE_STS.map: $(OBJS) $(USER_OBJS) D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\WLE5CC_NODE_STS\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
-	arm-none-eabi-gcc -o "WLE5CC_NODE_STS.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"D:\ONEDRIVE\STM32WLV13\Projects\NUCLEO-WL55JC\Applications\LoRaWAN\WLE5CC_NODE_STS\STM32CubeIDE\STM32WLE5CCUX_FLASH.ld" --specs=nosys.specs -Wl,-Map="WLE5CC_NODE_STS.map" -Wl,--gc-sections -static -L../../../../../../../Middlewares/ST/STM32_Cryptographic/lib -z noexecstack -Wunused-but-set-variable -Wunused-variable -fshort-enums --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
-	@echo 'Finished building target: $@'
-	@echo ' '
-
-default.size.stdout: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
-	arm-none-eabi-size  $(EXECUTABLES)
-	@echo 'Finished building: $@'
-	@echo ' '
-
-WLE5CC_NODE_STS.list: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
-	arm-none-eabi-objdump -h -S $(EXECUTABLES) > "WLE5CC_NODE_STS.list"
-	@echo 'Finished building: $@'
-	@echo ' '
-
-# Other Targets
-clean:
-	-$(RM) WLE5CC_NODE_STS.elf WLE5CC_NODE_STS.list WLE5CC_NODE_STS.map default.size.stdout
-	-@echo ' '
-
-secondary-outputs: $(SIZE_OUTPUT) $(OBJDUMP_LIST)
-
-fail-specified-linker-script-missing:
-	@echo 'Error: Cannot find the specified linker script. Check the linker settings in the build configuration.'
-	@exit 2
-
-warn-no-linker-script-specified:
-	@echo 'Warning: No linker script specified. Check the linker settings in the build configuration.'
-
-.PHONY: all clean dependents main-build fail-specified-linker-script-missing warn-no-linker-script-specified
-
--include ../makefile.targets
diff --git a/STM32CubeIDE/Release/sources.mk b/STM32CubeIDE/Release/sources.mk
deleted file mode 100644
index 709eaad..0000000
--- a/STM32CubeIDE/Release/sources.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-################################################################################
-# Automatically-generated file. Do not edit!
-# Toolchain: GNU Tools for STM32 (12.3.rel1)
-################################################################################
-
-ELF_SRCS := 
-OBJ_SRCS := 
-S_SRCS := 
-C_SRCS := 
-S_UPPER_SRCS := 
-O_SRCS := 
-CYCLO_FILES := 
-SIZE_OUTPUT := 
-OBJDUMP_LIST := 
-SU_FILES := 
-EXECUTABLES := 
-OBJS := 
-MAP_FILES := 
-S_DEPS := 
-S_UPPER_DEPS := 
-C_DEPS := 
-
-# Every subdirectory with source files must be described here
-SUBDIRS := \
-Application/User/Core \
-Application/User/LoRaWAN/App \
-Application/User/LoRaWAN/Target \
-Application/User/STS/Core/Src \
-Application/User/STS/TOF/App \
-Application/User/STS/TOF/Target \
-Application/User/STS/TOF/vl53l1x_uld \
-Application/User/Startup \
-Drivers/CMSIS \
-Drivers/STM32WLxx_HAL_Driver \
-Middlewares/LoRaWAN \
-Middlewares/SubGHz_Phy \
-Utilities \
-
diff --git a/STS/Core/Inc/yunhorn_sts_prd_conf.h b/STS/Core/Inc/yunhorn_sts_prd_conf.h
index 9dfc9d2..db1261b 100644
--- a/STS/Core/Inc/yunhorn_sts_prd_conf.h
+++ b/STS/Core/Inc/yunhorn_sts_prd_conf.h
@@ -229,8 +229,8 @@
 
  /*		General Settings							*/
 #define MajorVer									24U
-#define MinorVer									11U
-#define SubMinorVer 								1U
+#define MinorVer									12U
+#define SubMinorVer 								18U
 #define FirmwareVersion								3U
 #define	YUNHORN_STS_MAX_NVM_CFG_SIZE				64U
 #define YUNHORN_STS_AC_CODE_SIZE					20U
diff --git a/STS/Core/Src/yunhorn_sts_process.c b/STS/Core/Src/yunhorn_sts_process.c
index f55988b..85c024b 100644
--- a/STS/Core/Src/yunhorn_sts_process.c
+++ b/STS/Core/Src/yunhorn_sts_process.c
@@ -50,13 +50,13 @@
 #include "sts_lamp_bar.h"
 extern volatile sts_people_count_sensor_data_t *sts_people_count_sensor_data;
 extern volatile uint8_t sts_door_jam_profile;
-extern volatile uint8_t sts_tof_presence_state_changed;
+extern volatile uint8_t sts_tof_presence_state, sts_tof_presence_state_changed, sts_tof_presence_distance_dm, sts_pir_state;
 extern volatile sts_ppc_cfg_type_t ppc_cfg[];
 #elif defined(L8)
 #include "app_tof.h"
 #endif
 #if	defined(STS_O6)||defined(STS_T6)||defined(STS_O7)
-extern volatile uint8_t sts_status_color, sts_lamp_bar_color;//puColor
+extern volatile uint8_t sts_status_color, sts_lamp_bar_color, sts_color_occupy_vacant;//puColor
 extern uint8_t luminance_level;
 #endif
 volatile sts_cfg_nvm_t sts_cfg_nvm = {
@@ -150,7 +150,7 @@ extern volatile int sts_tof_distance_data[MAX_TOF_COUNT];
 volatile sts_tof_range_data_t sts_range_sensor_data={0x0,0x0,0x0};
 #endif
 #if	defined(STS_P2)||defined(STS_T6)
-volatile uint8_t sts_door_jam_profile = DOOR_JAM_2400;
+volatile uint8_t sts_door_jam_profile = DOOR_JAM_3000;
 #endif
 #ifdef STS_R4
 volatile uint8_t sts_soap_level_state=0;
@@ -463,7 +463,8 @@ void STS_YunhornSTSEventP5_Process(void)
 	STS_TOF_VL53LX_PeopleCounting_Process_Start();
 #elif	defined(STS_T6)
 	STS_TOF_VL53LX_PresenceDetection_Process_Start();
-	if (sts_tof_presence_state_changed)
+	//APP_LOG(TS_OFF, VLEVEL_M, "\r\nState changed state=%d, Detection result=%d \r\n", sts_tof_presence_state_changed, sts_tof_presence_state);
+	if (sts_tof_presence_state_changed == 1)
 	{
 		sts_tof_presence_state_changed = 0;
 		UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
@@ -1750,6 +1751,7 @@ void OnRestoreSTSCFGContextProcess(void)
 
 	sts_work_mode	= sts_cfg_nvm.work_mode;
 	sts_service_mask = sts_cfg_nvm.sts_service_mask;
+	sts_color_occupy_vacant = sts_cfg_nvm.color_occupy_vacant;
 
 #ifdef YUNHORN_STS_O6_ENABLED
 	sts_lamp_bar_color = STS_GREEN;
@@ -1838,7 +1840,7 @@ void STS_SENSOR_Function_Test_Process(void)
 	tstbuf[i++] = (uint8_t) (99*GetBatteryLevel()/254)&0xff;
 
 #if	(defined(STS_P2)||defined(STS_T6))
-	//STS_SENSOR_MEMS_Get_ID(&sensor_id);
+	STS_SENSOR_MEMS_Get_ID(&sensor_id);
 
 	APP_LOG(TS_OFF, VLEVEL_M, "\r\nSensor_id=%04x\r\n", sensor_id);
 
@@ -1853,7 +1855,9 @@ void STS_SENSOR_Function_Test_Process(void)
 		status = sts_tof_vl53lx_range_distance(&range_distance);
 		sts_sensor_install_height = range_distance;
 		APP_LOG(TS_OFF, VLEVEL_M, "\nSensor Install Height =%4d mm\n", sts_sensor_install_height);
-		tstbuf[i++] = (uint8_t) (2)&0xff;								//length of following data
+		tstbuf[i++] = (uint8_t) (4)&0xff;								//length of following data
+		tstbuf[i++] = (uint8_t) (sensor_id>>8)&0xff;
+		tstbuf[i++] = (uint8_t) (sensor_id)&0xff;
 		tstbuf[i++] = (uint8_t) (sts_sensor_install_height>>8)&0xff;	// MSB of sensor height
 		tstbuf[i++] = (uint8_t) (sts_sensor_install_height)&0xff;		// LSB of sensor height
 	}
diff --git a/STS/TOF/App/app_tof_peoplecount.c b/STS/TOF/App/app_tof_peoplecount.c
index ba9fe55..6ff175b 100644
--- a/STS/TOF/App/app_tof_peoplecount.c
+++ b/STS/TOF/App/app_tof_peoplecount.c
@@ -23,7 +23,7 @@ volatile sts_people_count_sensor_data_t sts_people_count_sensor_data={0,0,0,2,'M
 extern volatile uint32_t STS_TOFScanPeriod_sec, STS_TxPeriod_sec, STS_HeartBeatTimerPeriod_sec;
 extern volatile sts_cfg_nvm_t sts_cfg_nvm;
 extern volatile uint8_t nvm_store_value[];
-volatile uint8_t sts_tof_presence_state=0, sts_tof_presence_state_changed=0, sts_tof_presence_distance_dm=0;
+volatile uint8_t sts_tof_presence_state=0, sts_tof_presence_state_changed=0, sts_tof_presence_distance_dm=0, sts_pir_state=0;
 extern volatile uint8_t sts_lamp_bar_color;
 /* TIMING_BUDGET, in ms possible values [15, 20, 50, 100, 200, 500] */
 /* DISTANCE_THRESHOLD = MAX - ASSUME_CHILD_HEIGHT(800mm)            */
@@ -31,10 +31,10 @@ extern volatile uint8_t sts_lamp_bar_color;
 volatile sts_ppc_cfg_type_t ppc_cfg[6] = {
 		{DOOR_SIDE_1300,10, 1300,0, 1200,8,33, DISTANCE_MODE_SHORT,175,231},
 		{DOOR_JAM_1600, 10, 1600,0, 1300,8,33, DISTANCE_MODE_SHORT,175,231},
-		{DOOR_JAM_2400, 10, 2400,0, 1600,8,33, DISTANCE_MODE_LONG,175,231},
-		{DOOR_JAM_3000, 10, 3000,0, 2200,8,100,DISTANCE_MODE_LONG,175,231},
-		{DOOR_JAM_3500, 10, 3500,0, 2700,8,100,DISTANCE_MODE_LONG,175,231},
-		{DOOR_JAM_4000, 10, 4000,0, 3200,8,200,DISTANCE_MODE_LONG,175,231},
+		{DOOR_JAM_2400, 10, 2400,400, 1900,8,50, DISTANCE_MODE_LONG,175,231},
+		{DOOR_JAM_3000, 10, 3000,1200, 2500,8,100,DISTANCE_MODE_LONG,175,231},
+		{DOOR_JAM_3500, 10, 3500,1700, 3000,8,100,DISTANCE_MODE_LONG,175,231},
+		{DOOR_JAM_4000, 10, 4000,2200, 3500,8,200,DISTANCE_MODE_LONG,175,231},
 };
 volatile sts_zone_center_by_rows_of_spads_t zone_center[4]={
 		{4, 151, 247},
@@ -431,6 +431,8 @@ void STS_tof_presence_detection_sensor_Read(sts_tof_presence_detection_sensor_da
 {
 	sts_t6_sensor_data->tof_range_presence_state = sts_tof_presence_state;
 	sts_t6_sensor_data->tof_presence_distance_dm = sts_tof_presence_distance_dm;
+	sts_t6_sensor_data->pir_motion_sensor_state	 = sts_pir_state;
+	sts_t6_sensor_data->lamp_bar_color			 = sts_lamp_bar_color;
 }
 
 #if	(defined(STS_P2))
@@ -659,9 +661,15 @@ void STS_TOF_VL53LX_PresenceDetection_Process_Start(void)
 		status = sts_tof_vl53lx_presence_detection_start();
 		if (sts_tof_presence_state ==1)
 		{
-			sts_lamp_bar_color = (sts_cfg_nvm.color_occupy_vacant>>4)&0x0f; //STS_RED;
-		} else if (sts_tof_presence_state ==0) {
-			sts_lamp_bar_color = (sts_cfg_nvm.color_occupy_vacant)&0x0f; //STS_GREEN;
+			LED_GREEN_OFF;
+			LED_RED_ON;
+			sts_lamp_bar_color = STS_RED; //(sts_cfg_nvm.color_occupy_vacant>>4)&0x0f; //STS_RED;
+		} else if (sts_tof_presence_state  ==0)
+		{
+
+			LED_RED_OFF;
+			LED_GREEN_ON;
+			sts_lamp_bar_color = STS_GREEN; //(sts_cfg_nvm.color_occupy_vacant)&0x0f; //STS_GREEN;
 		}
 		sts_people_count_sensor_data.Count_Valid = (status ==0)? 1:0;
 		//APP_LOG(TS_OFF, VLEVEL_M,"############### SUB-PROCESS running .... \r\n");
@@ -670,11 +678,10 @@ void STS_TOF_VL53LX_PresenceDetection_Process_Start(void)
 }
 void STS_TOF_VL53LX_PresenceDetection_Process_Init(void)
 {
-	APP_LOG(TS_OFF, VLEVEL_M,"###############   TOF  VL53LX_ PRESENCE DETECTION --- INIT \r\n");
+	APP_LOG(TS_OFF, VLEVEL_M,"\r\n###############   %s Init   ############### \r\n", YUNHORN_STS_PRD_STRING);
 	{
-		status = sts_tof_vl53lx_presence_detection_init();
+		uint8_t status = sts_tof_vl53lx_presence_detection_init();
 		sts_people_count_sensor_data.Count_Valid = (status ==0)? 1:0;
-		//APP_LOG(TS_OFF, VLEVEL_M,"############### SUB-PROCESS running .... \r\n");
 	}
 
 }
@@ -710,11 +717,11 @@ int sts_tof_vl53lx_presence_detection_init(void)
 
   // Those basic I2C read functions can be used to check your own I2C functions */
   status = VL53L1_RdByte(dev, 0x010F, &byteData);
-  APP_LOG(TS_OFF, VLEVEL_H,"VL53L1X Model_ID: %X\n", byteData);
+  APP_LOG(TS_OFF, VLEVEL_L,"VL53L1X Model_ID: %X\n", byteData);
   status = VL53L1_RdByte(dev, 0x0110, &byteData);
-  APP_LOG(TS_OFF, VLEVEL_H,"VL53L1X Module_Type: %X\n", byteData);
+  APP_LOG(TS_OFF, VLEVEL_L,"VL53L1X Module_Type: %X\n", byteData);
   status = VL53L1_RdWord(dev, 0x010F, &wordData);
-  APP_LOG(TS_OFF, VLEVEL_H,"VL53L1X: %X\n", wordData);
+  APP_LOG(TS_OFF, VLEVEL_L,"VL53L1X: %X\n", wordData);
   sensor_id = wordData;
   wordData = 0;
   while (sensorState == 0) {
@@ -722,17 +729,17 @@ int sts_tof_vl53lx_presence_detection_init(void)
     HAL_Delay(2);
     wordData ++;
     if (wordData > 8000) {
-    	APP_LOG(TS_OFF, VLEVEL_M,"\n\n ***Failed to boot Chip***\n\n\n");
-    	return status;
+    	APP_LOG(TS_OFF, VLEVEL_L,"\n\n ***Failed to boot Chip***\n\n\n");
+    	//return status;
     }
   }
-  APP_LOG(TS_OFF, VLEVEL_H,"\nChip booted\n\n");
+  APP_LOG(TS_OFF, VLEVEL_M,"\nChip booted\n\n");
 
   /* Initialize and configure the device according to people counting need */
   status = VL53L1X_SensorInit(dev);
 
   sts_distance_mode = (sts_door_jam_profile ==0)?DISTANCE_MODE_SHORT:DISTANCE_MODE_LONG;
-  APP_LOG(TS_OFF, VLEVEL_H, "\r\n MaxDistance=%d, \nMinDistance=%d \ndist_threshold=%d  \n timing_budget=%d \n distance_mode=%d \r\n",
+  APP_LOG(TS_OFF, VLEVEL_M, "\r\nDistance[ Max=%d, Min=%d Threshold=%d ]  [Timing=%d ] [ Mode=%d ]\r\n",
 		  ppc_cfg[sts_door_jam_profile].max_distance,
 		  ppc_cfg[sts_door_jam_profile].min_distance,
 		  ppc_cfg[sts_door_jam_profile].dist_threshold,
@@ -742,17 +749,21 @@ int sts_tof_vl53lx_presence_detection_init(void)
   status += VL53L1X_SetTimingBudgetInMs(dev, ppc_cfg[sts_door_jam_profile].timing_budget);  /* TIMING_BUDGET, in ms possible values [15, 20, 50, 100, 200, 500] */
   status += VL53L1X_SetInterMeasurementInMs(dev, ppc_cfg[sts_door_jam_profile].timing_budget);
   status += VL53L1X_SetROI(dev, ppc_cfg[sts_door_jam_profile].rows_of_SPADS, 16); /* minimum ROI 4,4 */
+
+  status += VL53L1X_SetDistanceThreshold(dev,ppc_cfg[sts_door_jam_profile].min_distance,ppc_cfg[sts_door_jam_profile].max_distance, 3, 1); // 3= in window, 1= int on target
+
   center[0]=ppc_cfg[sts_door_jam_profile].front_zone_center;
   center[1]=ppc_cfg[sts_door_jam_profile].back_zone_center;
   if (status != 0) {
-	  APP_LOG(TS_OFF, VLEVEL_H,"Initialization or configuration of the device\n");
+	  APP_LOG(TS_OFF, VLEVEL_M,"Initialization or configuration of the device\n");
     return (-1);
   }
-  APP_LOG(TS_OFF, VLEVEL_H,"\n\nInit finished...\r\nStart counting people with profile : %d \r\n\n\n\n", sts_door_jam_profile);
+  APP_LOG(TS_OFF, VLEVEL_M,"\n\nStart detection with profile : %d \r\n\n\n\n", sts_door_jam_profile);
+
   status = VL53L1X_StartRanging(dev);   /* This function has to be called to enable the ranging */
 
   if (status != 0) {
-  	APP_LOG(TS_OFF, VLEVEL_H,"Error in start ranging\n");
+  	APP_LOG(TS_OFF, VLEVEL_M,"Error in start ranging\n");
     return (-1);
   }
   return 0;
@@ -775,16 +786,19 @@ int sts_tof_vl53lx_presence_detection_start(void)
     wordData++;
     if (wordData > 30) return -1;  // 50 ms timer, so make this 60% to fail back
   }
+
+  status = 0;
   dataReady = 0;
   status += VL53L1X_GetRangeStatus(dev, &RangeStatus);
   status += VL53L1X_GetDistance(dev, &Distance);
   status += VL53L1X_GetSignalPerSpad(dev, &Signal);
   status += VL53L1X_ClearInterrupt(dev); /* clear interrupt has to be called to enable next interrupt*/
   if (status != 0) {
-  	APP_LOG(TS_OFF, VLEVEL_L,"Error in operating the device\n");
+  	APP_LOG(TS_OFF, VLEVEL_L,"Error in operating the device, status =%X \n", status);
     return (-1);
   }
-  //HAL_Delay(WAIT_BEFORE_PROGRAMMING_OTHER_ZONE_CENTER);  // 10, 8, 7, 6 tested OK
+
+  // HAL_Delay(WAIT_BEFORE_PROGRAMMING_OTHER_ZONE_CENTER);  // 10, 8, 7, 6 tested OK
 
   status = VL53L1X_SetROICenter(dev, center[Zone]);
   if (status != 0) {
@@ -801,6 +815,7 @@ int sts_tof_vl53lx_presence_detection_start(void)
   // 7 VL53L1_RANGESTATUS_WRAP_TARGET_ FAIL Wrapped target, not matching phases
   // 8 VL53L1_RANGESTATUS_PROCESSING_ FAIL Internal algorithm underflow or overflow
   // 14 VL53L1_RANGESTATUS_RANGE_INVALID The reported range is invalid
+#if 0
   if ((RangeStatus == 0) || (RangeStatus == 4) || (RangeStatus == 7)) {
     if (Distance <= ppc_cfg[sts_door_jam_profile].min_distance) //MIN_DISTANCE) // wraparound case see the explanation at the constants definition place
       Distance = ppc_cfg[sts_door_jam_profile].max_distance + ppc_cfg[sts_door_jam_profile].min_distance; //MAX_DISTANCE + MIN_DISTANCE;
@@ -808,16 +823,15 @@ int sts_tof_vl53lx_presence_detection_start(void)
   else // severe error cases
     Distance = ppc_cfg[sts_door_jam_profile].max_distance;  //MAX_DISTANCE;
   // inject the new ranged distance in the people counting algorithm
+#endif
 
-
-  if (Distance < ppc_cfg[sts_door_jam_profile].dist_threshold)
+  //if (Distance < ppc_cfg[sts_door_jam_profile].dist_threshold)
+  if ((Distance < ppc_cfg[sts_door_jam_profile].dist_threshold) && ((Distance > ppc_cfg[sts_door_jam_profile].min_distance)))
   {
 	  PresenceState = 1;
-	  LED1_ON;
 
   } else {
 	  PresenceState = 0;
-	  LED1_OFF;
   }
   //PresenceState = ProcessPresenceDetectionData(Distance, Zone, RangeStatus);
   //printf("\nPresenceState =%d \n\r", PresenceState);
@@ -837,7 +851,7 @@ int sts_tof_vl53lx_presence_detection_start(void)
   Zone++;
   Zone = Zone%2;
 
-  return 0;
+  return 1;
 
 }
 #endif
diff --git a/STS/TOF/App/app_tof_peoplecount.h b/STS/TOF/App/app_tof_peoplecount.h
index 194e933..bd7b63b 100644
--- a/STS/TOF/App/app_tof_peoplecount.h
+++ b/STS/TOF/App/app_tof_peoplecount.h
@@ -163,6 +163,8 @@
 	 uint8_t	measure_window_threshold_low_dm;		// dm= 100mm = 10 cm, low = 0 dm
 	 uint8_t 	measure_window_threshold_high_dm;		// dm= 100mm = 10 cm, high=40dm
 	 uint8_t 	measure_critiera;						// below, 0, in window 1, above 2
+	 uint8_t 	pir_motion_sensor_state;
+	 uint8_t	lamp_bar_color;
 	 uint8_t Count_Valid;
  } sts_tof_presence_detection_sensor_data_t;