Compare commits

...

2 Commits

7 changed files with 66 additions and 20 deletions

View File

@ -41,7 +41,7 @@ void MX_USART2_UART_Init(void)
/* USER CODE END USART2_Init 1 */
huart2.Instance = USART2;
#ifdef L8
#if defined(L8)||defined(STS_P2)
huart2.Init.BaudRate = 460800;
#else
huart2.Init.BaudRate = 115200;

View File

@ -493,8 +493,13 @@ void LoRaWAN_Init(void)
LmHandlerJoin(ActivationType, ForceRejoin);
<<<<<<< HEAD
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_PERIODIC, OnYunhornSTSHeartBeatTimerEvent, NULL);
UTIL_TIMER_Start(&YunhornSTSHeartBeatTimer);
>>>>>>> f8f6e7269c1966577403a035f83fec62bab884d9
if (EventType == TX_ON_TIMER)
{
@ -538,8 +543,8 @@ void LoRaWAN_Init(void)
#endif
#if defined(STS_P2)||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_PeopleCounting_Process_Start, NULL);
//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_PeopleCounting_Process_Start, NULL);
UTIL_TIMER_Start(&YunhornSTSWakeUpScanTimer);
#endif

View File

@ -4,6 +4,44 @@
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
<<<<<<< HEAD
C_SRCS += \
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/vl53l1x_uld/VL53L1X_api.c \
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/vl53l1x_uld/VL53L1X_calibration.c \
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.c \
D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/vl53l1x_uld/vl53l1_platform.c
OBJS += \
./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_api.o \
./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_calibration.o \
./Application/User/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.o \
./Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform.o
C_DEPS += \
./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_api.d \
./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_calibration.d \
./Application/User/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.d \
./Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform.d
# Each subdirectory must supply rules for building sources it contributes
Application/User/STS/TOF/vl53l1x_uld/VL53L1X_api.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/vl53l1x_uld/VL53L1X_api.c Application/User/STS/TOF/vl53l1x_uld/subdir.mk
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_P2 -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/vl53l1x_uld/VL53L1X_calibration.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/vl53l1x_uld/VL53L1X_calibration.c Application/User/STS/TOF/vl53l1x_uld/subdir.mk
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_P2 -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/vl53l1x_uld/X-NUCLEO-53L1A1.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.c Application/User/STS/TOF/vl53l1x_uld/subdir.mk
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_P2 -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/vl53l1x_uld/vl53l1_platform.o: D:/ONEDRIVE/STM32WLV13/Projects/NUCLEO-WL55JC/Applications/LoRaWAN/WLE5CC_NODE_STS/STS/TOF/vl53l1x_uld/vl53l1_platform.c Application/User/STS/TOF/vl53l1x_uld/subdir.mk
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -DSTS_P2 -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-vl53l1x_uld
clean-Application-2f-User-2f-STS-2f-TOF-2f-vl53l1x_uld:
-$(RM) ./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_api.cyclo ./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_api.d ./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_api.o ./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_api.su ./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_calibration.cyclo ./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_calibration.d ./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_calibration.o ./Application/User/STS/TOF/vl53l1x_uld/VL53L1X_calibration.su ./Application/User/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.cyclo ./Application/User/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.d ./Application/User/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.o ./Application/User/STS/TOF/vl53l1x_uld/X-NUCLEO-53L1A1.su ./Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform.cyclo ./Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform.d ./Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform.o ./Application/User/STS/TOF/vl53l1x_uld/vl53l1_platform.su
.PHONY: clean-Application-2f-User-2f-STS-2f-TOF-2f-vl53l1x_uld
=======
# Each subdirectory must supply rules for building sources it contributes
>>>>>>> f8f6e7269c1966577403a035f83fec62bab884d9

View File

@ -1614,7 +1614,7 @@ void STS_REBOOT_CONFIG_Init(void)
}
}
//STS_Show_STS_CFG_NVM((uint8_t*)nvm_store_value);
STS_Show_STS_CFG_NVM((uint8_t*)nvm_store_value);
OnRestoreSTSCFGContextProcess();
/* USER CODE END OnRestoreContextRequest_Last */
@ -1706,16 +1706,16 @@ void OnRestoreSTSCFGContextProcess(void)
static void STS_Show_STS_CFG_NVM(uint8_t * store_value)
{
APP_LOG(TS_OFF, VLEVEL_M, "\n-----------------------------------------------\n");
APP_LOG(TS_OFF, VLEVEL_M, "\n00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n");
APP_LOG(TS_OFF, VLEVEL_H, "\n-----------------------------------------------\n");
APP_LOG(TS_OFF, VLEVEL_H, "\n00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15\n");
for (uint8_t i=0; i<YUNHORN_STS_MAX_NVM_CFG_SIZE; i++)
{
if (i%16==0) APP_LOG(TS_OFF, VLEVEL_M, "\n");
APP_LOG(TS_OFF, VLEVEL_M, "%02X ", store_value[i]);
if (i%16==0) APP_LOG(TS_OFF, VLEVEL_H, "\n");
APP_LOG(TS_OFF, VLEVEL_H, "%02X ", store_value[i]);
}
APP_LOG(TS_OFF, VLEVEL_M, "\n\r");
APP_LOG(TS_OFF, VLEVEL_M, "\n###############################################\n\r");
APP_LOG(TS_OFF, VLEVEL_H, "\n\r");
APP_LOG(TS_OFF, VLEVEL_H, "\n###############################################\n\r");
}
void STS_SENSOR_Distance_Test_Process(void)
{

View File

@ -39,7 +39,7 @@ volatile sts_zone_center_by_rows_of_spads_t zone_center[4]={
extern volatile uint8_t sts_door_jam_profile;
volatile uint8_t sts_presence_state=0;
static int PresenceState=0, PrevPresenceState=0;
volatile uint8_t sts_distance_mode = 0; //sts_door_jam_profile; //DOOR_JAM_3000;
volatile uint8_t sts_distance_mode = DOOR_JAM_2400; //sts_door_jam_profile; //DOOR_JAM_3000;
#endif
#if (defined(STS_P2))
volatile uint8_t sts_people_count_number_changed = 0;
@ -59,8 +59,8 @@ static int PathTrack[] = {0,0,0,0};
static int PathTrackFillingSize = 1; // init this to 1 as we start from state where nobody is any of the zones
static int LeftPreviousStatus = NOBODY;
static int RightPreviousStatus = NOBODY;
//static int PeopleCount = 0;
volatile int PeopleCount = 0;
static int PeopleCount = 0;
static uint16_t Distances[2][DISTANCES_ARRAY_SIZE];
static uint8_t DistancesTableSize[2] = {0,0};
static int ProcessPeopleCountingData(int16_t Distance, uint8_t zone, uint8_t RangeStatus);
@ -545,8 +545,11 @@ void STS_TOF_VL53LX_PeopleCounting_Process_Start(void)
//APP_LOG(TS_OFF, VLEVEL_M,"############### TOF VL53LX_ PEOPLE COUNTING SUB-PROCESS \r\n");
{
status = sts_tof_vl53lx_peoplecount_start();
sts_people_count_sensor_data.Count_Valid = (status ==0)? 1:0;
//APP_LOG(TS_OFF, VLEVEL_M,"############### SUB-PROCESS running .... \r\n");
if (status !=0)
{
sts_people_count_sensor_data.Count_Valid = 0;
APP_LOG(TS_OFF, VLEVEL_M,"# Counting time out... \r\n");
}
}
}
@ -671,9 +674,9 @@ int sts_tof_vl53lx_peoplecount_init(void)
status = VL53L1_RdByte(dev, 0x010F, &byteData);
APP_LOG(TS_OFF, VLEVEL_H,"VL53L1X Model_ID: %X\n", byteData);
status = VL53L1_RdByte(dev, 0x0110, &byteData);
APP_LOG(TS_OFF, VLEVEL_M,"VL53L1X Module_Type: %X\n", byteData);
APP_LOG(TS_OFF, VLEVEL_H,"VL53L1X Module_Type: %X\n", byteData);
status = VL53L1_RdWord(dev, 0x010F, &wordData);
APP_LOG(TS_OFF, VLEVEL_M,"VL53L1X: %X\n", wordData);
APP_LOG(TS_OFF, VLEVEL_H,"VL53L1X: %X\n", wordData);
sensor_id = wordData;
wordData = 0;
while (sensorState == 0) {
@ -685,7 +688,7 @@ int sts_tof_vl53lx_peoplecount_init(void)
return status;
}
}
APP_LOG(TS_OFF, VLEVEL_M,"\nChip booted\n\n");
APP_LOG(TS_OFF, VLEVEL_H,"\nChip booted\n\n");
/* Initialize and configure the device according to people counting need */
status = VL53L1X_SensorInit(dev);
@ -699,7 +702,7 @@ int sts_tof_vl53lx_peoplecount_init(void)
APP_LOG(TS_OFF, VLEVEL_H,"Initialization or configuration of the device\n");
return (-1);
}
APP_LOG(TS_OFF, VLEVEL_M,"\n\nInit finished...\r\nStart counting people with profile : %s...\r\n\n\n\n", PROFILE_STRING);
APP_LOG(TS_OFF, VLEVEL_H,"\n\nInit finished...\r\nStart counting people with profile : %d \r\n\n\n\n", sts_distance_mode);
status = VL53L1X_StartRanging(dev); /* This function has to be called to enable the ranging */
if (status != 0) {
@ -761,7 +764,7 @@ int sts_tof_vl53lx_peoplecount_start(void)
//printf("\nPplCounter =%d \n\r", PplCounter);
//sprintf(DisplayStr, "%4d", PplCounter); // only use for special EVK with display
//XNUCLEO53L1A1_SetDisplayString(DisplayStr);
//APP_LOG(TS_OFF, VLEVEL_H,"%d,%d,%d\n", Zone, Distance, Signal);
//APP_LOG(TS_OFF, VLEVEL_M,"%d,%d,%d\n", Zone, Distance, Signal);
Zone++;
Zone = Zone%2;