diff --git a/Core/Inc/main.h b/Core/Inc/main.h index c754323..2a6afca 100644 --- a/Core/Inc/main.h +++ b/Core/Inc/main.h @@ -106,8 +106,8 @@ void MX_TIM2_Init(void); #define USARTx_TX_GPIO_Port GPIOA /* USER CODE BEGIN Private defines */ -#define MEMS_EXTI1_Pin BUT1_Pin -#define MEMS_EXTI1_Port BUT1_GPIO_Port +#define MEMS_EXTI1_Pin BUT1_Pin +#define MEMS_EXTI1_Port BUT1_GPIO_Port #define MEMS_EXTI2_Pin BUT2_Pin #define MEMS_EXTI2_Port BUT2_GPIO_Port /* USER CODE END Private defines */ diff --git a/Core/Inc/platform.h b/Core/Inc/platform.h index c9c00e4..8ff3d52 100644 --- a/Core/Inc/platform.h +++ b/Core/Inc/platform.h @@ -28,9 +28,7 @@ extern "C" { /* Exported constants --------------------------------------------------------*/ -/* //#define USE_BSP_DRIVER -*/ /* USER CODE BEGIN EC */ /* USER CODE END EC */ @@ -44,8 +42,8 @@ extern "C" { /* code generated by STM32CubeMX does not support BSP. */ /* In order to use BSP, users can add the BSP files in the IDE project space */ /* and define USE_BSP_DRIVER in the preprocessor definitions */ -#include "stm32wlxx_STS_radio.h" -#include "stm32wlxx_STS.h" /* not used by this project*/ +#include "stm32wlxx_nucleo_radio.h" +#include "stm32wlxx_nucleo.h" /* not used by this project*/ #endif /* defined(USE_BSP_DRIVER) */ /* USER CODE BEGIN include */ diff --git a/Core/Inc/sys_sensors_yunhorn_sensors.h b/Core/Inc/sys_sensors_yunhorn_sensors.h index a7047d2..6629295 100644 --- a/Core/Inc/sys_sensors_yunhorn_sensors.h +++ b/Core/Inc/sys_sensors_yunhorn_sensors.h @@ -19,8 +19,8 @@ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __YUNHORN_STS_SENSORS_H__ -#define __YUNHORN_STS_SENSORS_H__ +#ifndef __SYS_SENSORS_YUNHORN_SENSORS_H__ +#define __SYS_SENSORS_YUNHORN_SENSORS_H__ #ifdef __cplusplus extern "C" { @@ -29,9 +29,6 @@ extern "C" { /* USER CODE BEGIN Includes */ #include "stdint.h" -#include "yunhorn_tof.h" -#include "ssd1306.h" -#include "ssd1306_tests.h" #include "yunhorn_sts_prd_conf.h" /* USER CODE END Includes */ diff --git a/Core/Inc/yunhorn_sts_motion_adxl345.h b/Core/Inc/yunhorn_sts_motion_adxl345.h index b33a283..e9c909a 100644 --- a/Core/Inc/yunhorn_sts_motion_adxl345.h +++ b/Core/Inc/yunhorn_sts_motion_adxl345.h @@ -199,6 +199,7 @@ unsigned char ADXL345_GetDeviceIDValue(void); /*! Initializes the I2C peripheral and checks if the ADXL345 part is present. */ void ADXL345_Init_Prepare_Measure(void); void ADXL345_Init_Motion_Detection(void); + /*! Places the device into standby/measure mode. */ void ADXL345_SetPowerMode(unsigned char pwrMode); diff --git a/Core/Inc/yunhorn_sts_motion_sensor.h b/Core/Inc/yunhorn_sts_motion_sensor.h index edc310e..8de3ccf 100644 --- a/Core/Inc/yunhorn_sts_motion_sensor.h +++ b/Core/Inc/yunhorn_sts_motion_sensor.h @@ -143,9 +143,17 @@ int32_t STS_MOTION_SENSOR_Set_Sleep_Duration(uint8_t Duration); void STS_MOTION_SENSOR_Enable_Wake_Up_Detection(void); void STS_MOTION_SENSOR_Disable_Wake_Up_Detection(void); - +void STS_MOTION_SENSOR_Power_ON(void); +void STS_MOTION_SENSOR_Power_OFF(void); +void STS_MOTION_SENSOR_ACT_INACT_DURATION_Init(); void STS_M7_GetValue(void); +/* YUNHORN STS Product Sensor Reset */ + +void STS_SENSOR_Reset(void); + +/* YUNHORN STS Product Sensor Reset */ + /** * @} */ diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index 548850f..38e9546 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -211,10 +211,15 @@ #endif /* YUNHORN_STS_R0_ENABLED */ #ifdef YUNHORN_STS_M7_ENABLED +#define MajorVer 22U +#define MinorVer 10U +#define SubMinorVer 21U +#define FirmwareVersion 3U + #include "yunhorn_sts_motion_sensor.h" #define YUNHORN_STS_M7_LORA_APP_DATA_PORT 72U #define YUNHORN_STS_M7_LORA_APP_HTBT_PORT 72U -#define YUNHORN_STS_M7_USER_APP_CTRL_PORT 2U +#define YUNHORN_STS_M7_USER_APP_CTRL_PORT 77U //TESTING #define sts_mtmcode 9U #define sts_senddataport YUNHORN_STS_M7_LORA_APP_DATA_PORT #define sts_sendhtbtport YUNHORN_STS_M7_LORA_APP_HTBT_PORT @@ -227,11 +232,14 @@ #ifdef USE_OLED_SSD1306 #define SSD1306_I2C_HANDLE hi2c2 +#include "ssd1306.h" +#include "ssd1306_tests.h" #endif #ifdef USE_TOF_VL53LXX // RETIRED TODO #define I2C_TIMING_TOF250 0x20303E5D #define I2C_TIMING 0x20303E5D //DEFAULT FOR I2C TOF +#include "yunhorn_tof.h" #endif #ifdef USE_STM32WLE5 @@ -239,7 +247,7 @@ #define I2C_TIMING_FAST_PLUS_MODE 0x20000209 //FAST PLUS MODE 1000Khz #endif -#ifdef USE_STM32WL55 //for ADXL345 +#ifdef USE_STM32WL55 //DEFAULT for MEMS_ADXL345 #define I2C_TIMING_STANDARD_MODE 0x2000090E //STANDARD MODE 100Khz #define I2C_TIMING_FAST_MODE 0x2010091A //FAST MODE 400Khz #define I2C_TIMING_FAST_PLUS_MODE 0x20000209 //FAST PLUS MODE 1000Khz @@ -247,6 +255,44 @@ #endif /* YUNHORN_STS_M7_ENABLED */ +#define YUNHORN_STS_DUTY_CYCLE_INTERVAL_ENABLED + +#ifdef YUNHORN_STS_DUTY_CYCLE_INTERVAL_ENABLED +enum APP_CTRL_CMD_CONFIG { + TX_DUTY_CYCLE_LEVEL_0 = 0, + TX_DUTY_CYCLE_LEVEL_1 = 1, + TX_DUTY_CYCLE_LEVEL_2 = 2, + TX_DUTY_CYCLE_LEVEL_3 = 3, + TX_DUTY_CYCLE_LEVEL_4 = 4, + TX_DUTY_CYCLE_LEVEL_5 = 5, + TX_DUTY_CYCLE_LEVEL_6 = 6, + TX_DUTY_CYCLE_LEVEL_7 = 7, + TX_DUTY_CYCLE_LEVEL_8 = 8, + TX_DUTY_CYCLE_LEVEL_9 = 9 +}; +static const uint16_t STS_Duty_Cycle_Interval_In_Seconds[]={ + 1, //TX_DUTY_CYCLE_Level 0 = 10s [ time_level * 5 seconds ] 5*2^0=5 + 2, //TX_DUTY_CYCLE_Level 1 = 30s 30 seconds 5*2^1=5*2 =10 + 12, //TX_DUTY_CYCLE_Level 2 = 60s 60 s, 1 min 5*2^2=5*4 =20 + 36, //TX_DUTY_CYCLE_Level 3 = 180s 3 min = 5*2^3=5*2*2*2 =40 + 60, //TX_DUTY_CYCLE_Level 4 = 5min 5*2^4 = 5*16 = 90 + 120, //TX_DUTY_CYCLE_Level 5 = 10min 5*2^5 = 5*32 = 160 + 180, //TX_DUTY_CYCLE_Level 6 = 15min 5*2^6 = 5*64 =320 + 360, //TX_DUTY_CYCLE_Level 7 = 30min 5*2^7=5*128=640 + 720, //TX_DUTY_CYCLE_Level 8 = 60min 5*2^8=5*256= 1280 + 2880 //TX_DUTY_CYCLE_Level 9 = 240min 5*2^9=5*512= 2560 +}; +#define INTERVAL_TIME_LEVEL_0 2 //10s //for debug 2*5= 10 seconds change back to 6 as 30 seconds in production +#define INTERVAL_TIME_LEVEL_1 6 //30s +#define INTERVAL_TIME_LEVEL_2 12 //60s +#define INTERVAL_TIME_LEVEL_3 36 //180s +#define INTERVAL_TIME_LEVEL_4 60 //5min +#define INTERVAL_TIME_LEVEL_5 120 //10min +#define INTERVAL_TIME_LEVEL_6 180 //15min +#define INTERVAL_TIME_LEVEL_7 360 //30min +#define INTERVAL_TIME_LEVEL_8 720 //60min +#define INTERVAL_TIME_LEVEL_9 2880 //240min +#endif /* YUNHORN_STS_DUTY_CYCLE_INTERVAL_ENABLED */ // YUNHORN_STS_BP (3K,6K,19K) // BATTERY PACK STS_BPER_3K, STS_BPER_6K, STS_BPER_19K diff --git a/Core/Inc/yunhorn_sts_sensors.h b/Core/Inc/yunhorn_sts_sensors.h index c47944c..43dd5ad 100644 --- a/Core/Inc/yunhorn_sts_sensors.h +++ b/Core/Inc/yunhorn_sts_sensors.h @@ -38,6 +38,68 @@ extern "C" { * Sensor data parameters */ +//SP0,SP1, SV1,SS0,SS1,SS2,SR1234, +enum { + YUNHORN_STS_PRD_BOARD_SOFT_RESET=0, //BOARD LEVEL RE_BOOT, REVIVE, 'YZH' + YUNHORN_STS_PRD_VERSION_REPORT, //BOARD LEVEL REPORT VERSION, 'YVH' + YUNHORN_STS_PRD_PERIODICITY_CHANGE, //BOARD LEVEL PERIODICTY CHANGE, 'YP#' #={0-9} + STS_SENSOR_CMD_MEMS_POWER_ON_OFF, //Num # MEMS LEVEL POWER ENABLE, 'Y#O','Y#F' #={1}{2,3..9} + STS_SENSOR_CMD_MEMS_SOFT_RESET, //Num # MEMS LEVEL SOFT_RESET, 'Y#H' #={1}{,2,3..9} +} ; // MEMS sensor_control_type + +//"P 0 0 "+"1 2 3 1 2 3 1 2 3 1 2" +// P +// P 1 SENSOR HEAD 0 +// P 1 0 SENSOR HEAD 0, VERSION 0 +// P 1 0 1 2 SENSOR HEAD 0, VERSION 0, VALUE 12, 1*10+2 +enum { + STS_CTRL_CMD_TYPE_DUTYCYCLE_LEVEL_CHANGE, + STS_CTRL_CMD_MEMS_TUNE_TOF_VL53L0X=0x00, + STS_CTRL_CMD_MEMS_TUNE_TOF_VL53L1X, //0X01 + STS_CTRL_CMD_MEMS_TUNE_TOF_VL53L2X, //0X02 + STS_CTRL_CMD_MEMS_TUNE_TOF_VL53L3X, //0X03 + STS_CTRL_CMD_MEMS_TUNE_TOF_VL53L4X, //0X04 + STS_CTRL_CMD_MEMS_TUNE_TOF_VL53L5X, //0X05 + + STS_CTRL_CMD_MEMS_TUNE_MV_ADXL345, //0X06 + STS_CTRL_CMD_MEMS_TUNE_MV_ADXL365, //0X07 + STS_CTRL_CMD_MEMS_TUNE_MV_ADXL362, //0X08 + STS_CTRL_CMD_MEMS_TUNE_MV_ADXL110X, //0X09 + + STS_CTRL_CMD_MEMS_TUNE_FMCW_TI16X, + STS_CTRL_CMD_MEMS_TUNE_FMCW_TI68X, + + STS_CTRL_CMD_MEMS_TUNE_PCR_A11X, + STS_CTRL_CMD_MEMS_TUNE_PCR_A12X, + + STS_CTRL_CMD_PRESENCE_SETTING, + STS_CTRL_CMD_PRESENCE_TUNE_LED_COLOR, + STS_CTRL_CMD_PRESENCE_TUNE_WORK_MODE, + + STS_CTRL_CMD_MEMS_TUNE_SMOKING_MUSIC, + STS_CTRL_CMD_MEMS_TUNE_SMOKING_ENABLE, + + STS_CTRL_CMD_MEMS_TUNE_WATER_FLOW_DN, + + STS_CTRL_CMD_MEMS_TUNE_DIGITAL_RELAY, + + STS_CTRL_CMD_MEMS_TUNE_FAN_CONTROL, + STS_CTRL_CMD_MEMS_TUNE_VENTILATION_FAN_SPEED, + STS_CTRL_CMD_MEMS_TUNE_VENTILATION_FAN_SWING, + + + STS_CTRL_CMD_MEMS_TUNE_DEVICE_COMPONENT +}; // sensor_mems_type + +enum { + STS_CTRL_CMD_MEMS_TUNE_TOF_RANGE_START=0, + STS_CTRL_CMD_MEMS_TUNE_TOF_RANGE_END, + STS_CTRL_CMD_MEMS_TUNE_TOF_THRESHOLD, + STS_CTRL_CMD_MEMS_TUNE_TOF_GAIN, + STS_CTRL_CMD_MEMS_TUNE_TOF_MAX_DISTANCE +}; // sensor_mems_tof_tune_type + + #if (defined(YUNHORN_STS_R0_ENABLED) || defined(YUNHORN_STS_R1_ENABLED) || defined(YUNHORN_STS_R2_ENABLED) || defined(YUNHORN_STS_R5_ENABLED)) typedef struct { @@ -256,24 +318,6 @@ typedef struct #endif - - ////////////////////////////////////////////////////////////////////// for testing only -typedef struct -{ - float pressure; /*!< in mbar */ - float temperature; /*!< in degC */ - float humidity; /*!< in % */ - int32_t latitude; /*!< latitude converted to binary */ - int32_t longitude; /*!< longitude converted to binary */ - int16_t altitudeGps; /*!< in m */ - int16_t altitudeBar; /*!< in m * 10 */ - /**more may be added*/ - /* USER CODE BEGIN sensor_t */ - - /* USER CODE END sensor_t */ -} sensor_t; -////////////////////////////////////////////////////////////////////// for testing only - /* USER CODE BEGIN ET */ /* USER CODE END ET */ @@ -287,31 +331,6 @@ typedef struct //#endif /* SENSOR_ENABLED & X_NUCLEO_IKS01A2 */ #define SENSOR_QUANTITY 2 -enum APP_CTRL_CMD_CONFIG{ - TX_DUTY_CYCLE_LEVEL_0 = 0, - TX_DUTY_CYCLE_LEVEL_1 = 1, - TX_DUTY_CYCLE_LEVEL_2 = 2, - TX_DUTY_CYCLE_LEVEL_3 = 3, - TX_DUTY_CYCLE_LEVEL_4 = 4, - TX_DUTY_CYCLE_LEVEL_5 = 5, - TX_DUTY_CYCLE_LEVEL_6 = 6, - TX_DUTY_CYCLE_LEVEL_7 = 7, - TX_DUTY_CYCLE_LEVEL_8 = 8 -}; -#define SPLC 5 //5 seconds duration_per_level_count -static const uint16_t Level_DutyCycleTime[] = - { 1, //TX_DUTY_CYCLE_Level 0 = 10s [ time_level * 5 seconds ] 5*2^0=5 - 2, //TX_DUTY_CYCLE_Level 1 = 30s 30 seconds 5*2^1=5*2 =10 - 12, //TX_DUTY_CYCLE_Level 2 = 60s 60 s, 1 min 5*2^2=5*4 =20 - 36, //TX_DUTY_CYCLE_Level 3 = 180s 3 min = 5*2^3=5*2*2*2 =40 - 60, //TX_DUTY_CYCLE_Level 4 = 5min 5*2^4 = 5*16 = 90 - 120, //TX_DUTY_CYCLE_Level 5 = 10min 5*2^5 = 5*32 = 160 - 180, //TX_DUTY_CYCLE_Level 6 = 15min 5*2^6 = 5*64 =320 - 360, //TX_DUTY_CYCLE_Level 7 = 30min 5*2^7=5*128=640 - 720, //TX_DUTY_CYCLE_Level 8 = 60min 5*2^8=5*256= 1280 - 255 // N/A - }; - /* USER CODE END EC */ /* External variables --------------------------------------------------------*/ @@ -361,6 +380,11 @@ uint8_t * read_duty_cycle_level_from_flash(uint8_t *flash_code_duty_cycle_level, void yunhorn_smartoilets_mini_display_splash(char *prd_name); void yunhorn_banner(char *s1, char *s2, char *s3); +void STS_MOTION_SENSOR_Power_ON(void); +void STS_MOTION_SENSOR_Power_OFF(void); +void STS_SENSOR_Upload_Message(uint8_t appDataPort, uint8_t appBufferSize, char *appDataBuffer); +void STS_SENSOR_Auto_Responder_Process(uint8_t tlv_ver,uint8_t tlv_type, uint8_t tlv_length, uint8_t *tlv_content); + void function_Test_Vibration_Sensor(void); void STS_M7_GetValue(void); void STS_M7_SineWaveTest(uint16_t cycles); @@ -369,6 +393,7 @@ void STS_MOTION_SENSOR_Init(void); void STS_MOTION_SENSOR_Disable_Wake_Up_Detection(void); + int32_t STS_MOTION_SENSOR_Set_Wake_Up_Threshold(uint8_t Threshold); int32_t STS_MOTION_SENSOR_Set_Wake_Up_Duration(uint8_t Duration); int32_t STS_MOTION_SENSOR_Enable_Inactivity_Detection(STS_MOTION_SENSOR_IntPin_t IntPin); @@ -379,9 +404,8 @@ void STS_MOTION_SENSOR_Get_Event_Status(STS_MOTION_SENSOR_Event_Status_t *Status void STS_MOTION_SENSOR_Enable_Wake_Up_Detection(void); void STS_MOTION_SENSOR_Initialization(void); -void USER_APP_DOWNLINK_CTRL_DATA_Parse(char *tlv_buf); -void USER_APP_DOWNLINK_CTRL_DATA_Process(char *tlv_buf); - +void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, size_t tlv_buf_size); + /* USER CODE BEGIN Private defines */ /* In this example TIM2 input clock (TIM2CLK) is set to APB1 clock (PCLK1), diff --git a/Core/Src/main.c b/Core/Src/main.c index b046eff..bfca33c 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -102,7 +102,7 @@ int main(void) /* Infinite loop */ /* USER CODE BEGIN WHILE */ - STS_MOTION_SENSOR_Function_Test_Process(); + //STS_MOTION_SENSOR_Function_Test_Process(); while (1) { diff --git a/Core/Src/stm32_lpm_if.c b/Core/Src/stm32_lpm_if.c index 26231ff..041879d 100644 --- a/Core/Src/stm32_lpm_if.c +++ b/Core/Src/stm32_lpm_if.c @@ -30,11 +30,8 @@ /* External variables ---------------------------------------------------------*/ /* USER CODE BEGIN EV */ -#if defined(YUNHORN_STS_M7_ENABLED) extern I2C_HandleTypeDef MOTION_SENSOR_I2C_HANDLE; -extern I2C_HandleTypeDef SSD1306_I2C_HANDLE; extern TIM_HandleTypeDef MOTION_SENSOR_TIM_HANDLE; -#endif /* USER CODE END EV */ /* Private typedef -----------------------------------------------------------*/ @@ -135,7 +132,8 @@ void PWR_ExitStopMode(void) #endif HAL_I2C_Init(&MOTION_SENSOR_I2C_HANDLE); HAL_TIM_Base_Start_IT(&MOTION_SENSOR_TIM_HANDLE); -#endif +#endif + /* USER CODE END ExitStopMode_2 */ } diff --git a/Core/Src/stm32wlxx_hal_msp.c b/Core/Src/stm32wlxx_hal_msp.c index c975c99..73cf370 100644 --- a/Core/Src/stm32wlxx_hal_msp.c +++ b/Core/Src/stm32wlxx_hal_msp.c @@ -115,20 +115,27 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c) /**I2C1 GPIO Configuration - PB6 ------> I2C1_SCL //STM32WLE5 - PB7 ------> I2C1_SDA + PA10 ------> I2C1_SDA //STM32WLE5 + PB8 ------> I2C1_SCL */ #ifdef USE_STM32WLE5 + __HAL_RCC_GPIOB_CLK_ENABLE(); - GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7; + GPIO_InitStruct.Pin = GPIO_PIN_6; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = GPIO_AF4_I2C1; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + GPIO_InitStruct.Pin = GPIO_PIN_7; + GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF4_I2C1; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); #endif /* Peripheral clock enable */ __HAL_RCC_I2C1_CLK_ENABLE(); @@ -225,8 +232,8 @@ void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c) #endif /**I2C1 GPIO Configuration //STM32WLE5 - PB7 ------> I2C1_SDA - PB6 ------> I2C1_SCL + PA10 ------> I2C1_SDA + PB8 ------> I2C1_SCL */ #ifdef USE_STM32WLE5 diff --git a/Core/Src/usart.c b/Core/Src/usart.c index 81d40d9..4d2db62 100644 --- a/Core/Src/usart.c +++ b/Core/Src/usart.c @@ -128,7 +128,7 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) // Error_Handler(); // } -// __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart2_tx); + __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart2_tx); /* USART2 interrupt Init */ HAL_NVIC_SetPriority(USART2_IRQn, 2, 0); diff --git a/Core/Src/yunhorn_sts_motion_sensor.c b/Core/Src/yunhorn_sts_motion_sensor.c index efc3307..66326d3 100644 --- a/Core/Src/yunhorn_sts_motion_sensor.c +++ b/Core/Src/yunhorn_sts_motion_sensor.c @@ -3,7 +3,7 @@ ****************************************************************************** * @file yunhorn_sts_motion_sensor.c * @author Yunhorn (r) Technology Limited Application Team * - * @brief Yunhorn (r) SmarToilets (r) Product configuration file. * + * @brief Yunhorn (r) SmarToilets (r) Product configuration file. * ****************************************************************************** * @attention * @@ -30,7 +30,7 @@ #include "stm32_systime.h" #include "adc_if.h" #include "gpio.h" - +#include "LmHandler.h" extern I2C_HandleTypeDef MOTION_SENSOR_I2C_HANDLE; #ifdef USE_OLED_SSD1306 extern I2C_HandleTypeDef SSD1306_I2C_HANDLE; @@ -90,8 +90,8 @@ uint32_t freq_at_spectrumPeak_x,freq_at_spectrumPeak_y,freq_at_spectrumPeak_z; uint32_t ft_x, ft_y, ft_z, get_value_count; uint32_t bin_at_spectrumPeak_x,bin_at_spectrumPeak_y,bin_at_spectrumPeak_z; -static void STS_MOTION_SENSOR_Power_ON(void); -static void STS_MOTION_SENSOR_Power_OFF(void); +void STS_MOTION_SENSOR_Power_ON(void); +void STS_MOTION_SENSOR_Power_OFF(void); /* USER CODE END PFP */ @@ -280,6 +280,11 @@ void STS_MOTION_SENSOR_Init(void) } +void STS_MOTION_SENSOR_ACT_INACT_DURATION_Init() +{ + ADXL345_Init_Motion_Detection(); +} + void STS_MOTION_SENSOR_Get_Event_Status(STS_MOTION_SENSOR_Event_Status_t *Status) { uint8_t int_source=0; @@ -437,7 +442,17 @@ void STS_MOTION_SENSOR_Power_OFF(void) // HAL_Delay(1000); } + +void STS_SENSOR_Reset(void) +{ + + __set_FAULTMASK(1); // disable all INT + + NVIC_SystemReset(); // system board reset + +} + #ifdef USE_OLED_SSD1306 static void Display_Axis(SSD1306_COLOR color) { @@ -501,7 +516,7 @@ void Display_Chart(float *px,float *py, float *pz, SSD1306_COLOR color, char *ti //ssd1306_SetDisplayOn(0); } #endif - + /* USER CODE BEGIN EF */ diff --git a/Core/Src/yunhorn_sts_motion_sensor_adxl345.c b/Core/Src/yunhorn_sts_motion_sensor_adxl345.c index 26256d3..dc14e50 100644 --- a/Core/Src/yunhorn_sts_motion_sensor_adxl345.c +++ b/Core/Src/yunhorn_sts_motion_sensor_adxl345.c @@ -34,6 +34,7 @@ extern uint32_t freq_at_spectrumPeak_x,freq_at_spectrumPeak_y,freq_at_spectrumP extern uint32_t bin_at_spectrumPeak_x,bin_at_spectrumPeak_y,bin_at_spectrumPeak_z; extern volatile uint16_t TIM2_Counter, ggx,ggy,ggz; +volatile uint8_t act_threshold=6, inact_threshold=3, inact_duration=3; extern I2C_HandleTypeDef MOTION_SENSOR_I2C_HANDLE; extern TIM_HandleTypeDef htim2; /******************************************************************************/ @@ -52,7 +53,7 @@ void ADXL345_SetRegisterValue(unsigned char registerAddress, unsigned char registerValue) { HAL_I2C_Mem_Write(&MOTION_SENSOR_I2C_HANDLE, (uint16_t)ADXL345_ADDRESS, (uint16_t)registerAddress, (uint16_t)I2C_MEMADD_SIZE_8BIT, ®isterValue, 1, 1000) ; - + } /***************************************************************************//** @@ -67,7 +68,7 @@ unsigned char ADXL345_GetRegisterValue(unsigned char registerAddress) unsigned char registerValue=0; HAL_I2C_Mem_Read(&MOTION_SENSOR_I2C_HANDLE, (uint16_t)ADXL345_ADDRESS, (uint16_t)registerAddress, 1, ®isterValue, 1, 100); - + return(registerValue); } @@ -226,7 +227,7 @@ void ADXL345_Init_Motion_Detection(void) val=0xFF; //ACT AND IN-ACT ALL SET ADXL345_SetRegisterValue(ADXL345_REG_ACT_INACT_CTL, val); - val=6; //THRESHOLD FOR ACTIVITY 62.5mg/LSB + val= act_threshold; //6, THRESHOLD FOR ACTIVITY 62.5mg/LSB ADXL345_SetRegisterValue(ADXL345_REG_THRESH_ACT, val); //val=~(0x10); //INT map for activity (*** STEP 1 ) @@ -234,11 +235,11 @@ void ADXL345_Init_Motion_Detection(void) ADXL345_SetRegisterValue(ADXL345_REG_INT_MAP, val); // THRESH_INACT inactivity threshold and duration - val=0x02; // threshold to 06 vs activity 10 + val=inact_threshold; //0x02 threshold to 06 vs activity 10 ADXL345_SetRegisterValue(ADXL345_REG_THRESH_INACT, val); // TIME_INACT ****** must be less than THRESH_INACT - val=0x03; //duration for 3 seconds + val= inact_duration; //3 seconds duration for 3 seconds ADXL345_SetRegisterValue(ADXL345_REG_TIME_INACT, val); // INT ENABLE (*** STEP 2 ) diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index e52ea4e..5db0fe3 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -37,6 +37,7 @@ #include "flash_if.h" /* USER CODE BEGIN Includes */ +#include "yunhorn_sts_sensors.h" #include "yunhorn_sts_motion_sensor.h" /* USER CODE END Includes */ @@ -45,6 +46,7 @@ volatile uint8_t mems_int1_detected = 0; extern volatile uint8_t sensor_data_ready; extern volatile STS_M7_SensorDataTypeDef sts_m7_sensorData; +extern volatile uint8_t act_threshold, inact_threshold, inact_duration; /* USER CODE END EV */ /* Private typedef -----------------------------------------------------------*/ @@ -348,7 +350,7 @@ void LoRaWAN_Init(void) /* USER CODE END LoRaWAN_Init_LV */ /* USER CODE BEGIN LoRaWAN_Init_1 */ - APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n##### YUNHORN_STS_M7_VERSION: 2022.10.19.R0 #####\r\n\n\n"); + APP_LOG(TS_OFF, VLEVEL_M, "\r\n\n\n##### YUNHORN_STS_M7_VERSION: 2022.10.21.R1 #####\r\n\n\n"); /* Get LoRaWAN APP version*/ APP_LOG(TS_OFF, VLEVEL_M, "APPLICATION_VERSION: V%X.%X.%X\r\n", (uint8_t)(APP_VERSION_MAIN), @@ -539,7 +541,7 @@ static void OnRxData(LmHandlerAppData_t *appData, LmHandlerRxParams_t *params) case LORAWAN_USER_APP_PORT: if (appData->BufferSize == 1) { - AppLedStateOn = appData->Buffer[0] & 0x01; + AppLedStateOn = (appData->Buffer[0] -0x30) & 0x01; if (AppLedStateOn == RESET) { APP_LOG(TS_OFF, VLEVEL_H, "LED OFF\r\n"); @@ -553,29 +555,17 @@ static void OnRxData(LmHandlerAppData_t *appData, LmHandlerRxParams_t *params) } break; case LORAWAN_USER_APP_CTRL_PORT: - if (appData->BufferSize == 1) + if (appData->BufferSize != 1) { - AppLedStateOn = appData->Buffer[0] & 0x01; - if (AppLedStateOn == RESET) - { - APP_LOG(TS_OFF, VLEVEL_H, "LED OFF\r\n"); - HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_RESET); /* LED_RED */ - } - else - { - APP_LOG(TS_OFF, VLEVEL_H, "LED ON\r\n"); - HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET); /* LED_RED */ - } - } - else - { //TLV = type, length, variables YUNHORN_TODO_LIST -// uint8_t tlv_buf[128]=""; -// if (appData->BufferSize < 128) { -// memcpy(tlv_buf, appData->Buffer,appData->BufferSize); -// USER_APP_AUTO_RESPONDER_Parse(tlv_buf); -// USER_APP_AUTO_RESPONDER_Process(tlv_cmd); -// } + APP_LOG(TS_OFF, VLEVEL_M, "######## YUNHORN STS D/L FRAME:%04d | PORT:%d | DR:%d | SLOT:%s | RSSI:%d | SNR:%d\r\n", + params->DownlinkCounter, RxPort, params->Datarate, slotStrings[params->RxSlot], params->Rssi, params->Snr); + APP_LOG(TS_OFF, VLEVEL_M, "######## BUFFER SIZE =%d, { %s }\r\n", appData->BufferSize,appData->Buffer); + if (appData->BufferSize < 128) { + //memcpy(tlv_buf, appData->Buffer,appData->BufferSize); + USER_APP_AUTO_RESPONDER_Parse((char*)appData->Buffer, appData->BufferSize); + } } + break; @@ -595,52 +585,251 @@ static void OnRxData(LmHandlerAppData_t *appData, LmHandlerRxParams_t *params) /* USER CODE END OnRxData_1 */ } -enum { - STS_SENSOR_CTRL_CMD_POWER_ON_OFF=0x00, - STS_SENSOR_CTRL_CMD_POWER_TOGGLE=0x01, - - -}; - -void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf) //YUNHORN_TODO_LIST +void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, size_t tlv_buf_size) { uint8_t i=0; - switch (tlv_buf[i+1]){ - case 'P': //Power on off - if (tlv_buf[i+2] == 0) { - -// STS_MOTION_SENSOR_Power_OFF(); - } else if (tlv_buf[i+2]==1) { - - // STS_MOTION_SENSOR_Power_ON(); - } - break; - case 'V': // version report - // STS_REPLY - break; - case 'C': + char tlv_h1_cmd = (char)tlv_buf[0]; + char outbuf[64]=""; - break; + /* + * YUNHORN STS PRODUCT BOARD LEVEL CONTROL OR REPORT + */ + + APP_LOG(TS_OFF, VLEVEL_M, "# In Parse: BUFFER SIZE =%d, { %c %c %c }\r\n", tlv_buf_size,tlv_buf[0],tlv_buf[1],tlv_buf[2]); + + if ((tlv_h1_cmd == 'Y') && (tlv_buf_size == 3)) // BOARD LEVEL CONTROL OR REPORT + { + switch ((char)tlv_buf[1]) { + case 'Z': + if ((char)tlv_buf[2] == 'H') { //BOARD SOFT RESET, REVIVE "YZH" + //BOARD REVIVE + + memcpy(outbuf,"!* YUNHORN STS BOARD REVIVING *!",sizeof(outbuf)); + APP_LOG(TS_OFF, VLEVEL_M, "\r\nSize=%d M=%s\r\n", sizeof(outbuf), outbuf); + + STS_SENSOR_Upload_Message(LORAWAN_USER_APP_PORT, 20, "!YunHorn STS Revive!"); + HAL_Delay(5000); + + STS_SENSOR_Reset(); + } + break; + + case 'V': + if ((char)tlv_buf[2] == 'H') { // REPORT FIRMWARE VERSION "YVH" + // FIRMWARE VERSION REPORT + outbuf[i++] = (uint8_t) 'V'; + outbuf[i++] = (uint8_t) sts_mtmcode; + outbuf[i++] = (uint8_t) MajorVer; + outbuf[i++] = (uint8_t) MinorVer; + outbuf[i++] = (uint8_t) SubMinorVer; + STS_SENSOR_Upload_Message(LORAWAN_USER_APP_PORT, i, outbuf); + APP_LOG(TS_OFF, VLEVEL_M, "###### YUNHORN Report Version [ %10x ] \r\n", outbuf); + } + break; + + case 'P': // "YP#" + if (((char)tlv_buf[2] >='0') && ((char)tlv_buf[2] <='9')) { // UPLOAD MESSAGE INTERVAL OR PERIODICITY CHANGE + + uint32_t periodicity = STS_Duty_Cycle_Interval_In_Seconds[(tlv_buf[2]-0x30)]; + periodicity = (periodicity>10)? periodicity : 10; + OnTxPeriodicityChanged(periodicity*1000); + + outbuf[i++] = (uint8_t) 'P'; + outbuf[i++] = (uint8_t) (STS_Duty_Cycle_Interval_In_Seconds[(tlv_buf[2]-0x30)]>>8)&0xFF; + outbuf[i++] = (uint8_t) (STS_Duty_Cycle_Interval_In_Seconds[(tlv_buf[2]-0x30)]&0xFF); + + STS_SENSOR_Upload_Message(LORAWAN_USER_APP_PORT, i, outbuf); + APP_LOG(TS_OFF, VLEVEL_M, "###### YUNHORN Periodicity Changed to [ %d ] Seconds\r\n", periodicity); + + } + break; + + default: // "Y # F", "Y # O" + if (((char)tlv_buf[1] >='0') && ((char)tlv_buf[1] <='9')) { // YUNHORN TODO for multi-sensors power control + + if ((char)tlv_buf[2] == 'F') { // POWER OFF + // TODO # of modules + STS_MOTION_SENSOR_Power_OFF(); + } + else if ((char)tlv_buf[2] == 'O') { // POWER ON + // TODO # of modules + STS_MOTION_SENSOR_Power_ON(); + } + outbuf[i++] = (uint8_t) tlv_buf[0]; + outbuf[i++] = (uint8_t) (tlv_buf[1]-0x30); + outbuf[i++] = (uint8_t) tlv_buf[2]; + + STS_SENSOR_Upload_Message(LORAWAN_USER_APP_PORT, i, outbuf); + APP_LOG(TS_OFF, VLEVEL_M, "###### YUNHORN MEMS Power control #[%d] %s \r\n", (uint8_t)(tlv_buf[1]-0x30), (char*)outbuf); + } + break; + } + } else + if (((char)tlv_h1_cmd == 'P') && (tlv_buf_size > 3)) + { + /* + * YUNHORN STS PRODUCT SUBMODULE, MEMS OR SENSOR HEAD LEVEL PARAMETER TUNING SECTION + */ + uint8_t tlv_h2_cnt = 0x00, mems_ver=0x00; + i++; // skip 'P' + + switch (tlv_buf[i++]-0x30) { //# of MEMS components + //default first sensor head or MEMS component, default 1 sensor heads + case 0: //default sensor head or MEMS component + case 1: //first sensor head or MEMS component + + #ifdef YUNHORN_STS_M7_ENABLED + mems_ver = (tlv_buf[i++]-0x30); // "P 0 0" + switch (mems_ver) { // Firmware version or Variation of MEMS/component + case 0: // ADXL345 --- version 2022 + if (tlv_buf_size == 9) { + act_threshold = (uint8_t) (tlv_buf[i++]-0x30)*10; // "P 0 0 0 8" -> 0*10 + act_threshold += (tlv_buf[i++]-0x30); // "P 0 0 0 8" -> 0*10 + 8 + inact_threshold = (uint8_t) (tlv_buf[i++]-0x30)*10; // "P 0 0 0 8 0 4" -> 0*10 + inact_threshold += (tlv_buf[i++]-0x30); // "P 0 0 0 8 0 4" -> 0*10 + 4 + inact_duration = (uint8_t) (tlv_buf[i++]-0x30)*10; // "P 0 0 0 8 0 4 0 3" -> 0*10 + inact_duration += (uint8_t) (tlv_buf[i++]-0x30); // "P 0 0 0 8 0 0 4 0 3" -> 0*10+3 + } + + STS_MOTION_SENSOR_ACT_INACT_DURATION_Init(); + + i=0; // START RESPONDER + outbuf[i++] = (char) 'P'; + outbuf[i++] = (uint8_t) act_threshold; + outbuf[i++] = (uint8_t) inact_threshold; + outbuf[i++] = (uint8_t) inact_duration; + STS_SENSOR_Upload_Message(LORAWAN_USER_APP_PORT, i, outbuf); + APP_LOG(TS_OFF, VLEVEL_M, "###### YUNHORN STS ADXL345 TUNE [ Act=%02x Inact=%02x Duration=%02x]seconds \r\n", + act_threshold,inact_threshold,inact_duration); + + break; + case 1: + break; + default: + break; + } + + #endif - if ((tlv_buf[1] == STS_SENSOR_CTRL_CMD_POWER_ON_OFF)) { } +#if defined(YUNHORN_STS_R1_ENABLED) || defined(YUNHORN_STS_R2_ENABLED)|| defined(YUNHORN_STS_R3_ENABLED) || defined(YUNHORN_STS_R5_ENABLED) + +#endif +#ifdef YUNHORN_STS_O1_ENABLED + +#endif + break; + + // for multipul sensor heads or MEMS components, TODO 2022-10-21 PARK HERE + + case 2: + +#ifdef YUNHORN_STS_O2_ENABLED + + // for 2nd sensor heads such as 2x Presence radar, 2 reedswitch or hall elements + +#endif + break; + + + default: + // for multipul sensor heads or MEMS components, TODO 2022-10-21 PARK HERE + break; + } + } + +} // END OF USER_APP_AUTO_RESPONDER_Parse + +void STS_SENSOR_Upload_Message(uint8_t appDataPort, uint8_t appBufferSize, char *appDataBuffer) +{ + LmHandlerErrorStatus_t status = LORAMAC_HANDLER_ERROR; + UTIL_TIMER_Time_t nextTxIn = 0; + + for (uint8_t i=0;i 0) + { + APP_LOG(TS_ON, VLEVEL_L, "Next Tx in : ~%d second(s)\r\n", (nextTxIn / 1000)); + } + } + +} + + +void STS_SENSOR_Auto_Responder_Process(uint8_t tlv_ver,uint8_t tlv_type, uint8_t tlv_length, uint8_t *tlv_content) +{ + uint8_t sensor_mems_type=(tlv_content[0]-0x30); //sensor_mems_type defined in sts_sensors.h + +#ifdef YUNHORN_STS_M7_ENABLED + uint8_t fm_version = FirmwareVersion; //MajorVer+MinorVer+SubMinorVer; + +#endif + + switch (sensor_mems_type) + { +#ifdef YUNHORN_STS_M7_ENABLED + case STS_CTRL_CMD_MEMS_TUNE_MV_ADXL345: + if (tlv_length == 3) { + if ( fm_version == tlv_ver) { + act_threshold = tlv_content[1]; + inact_threshold = tlv_content[2]; + inact_duration = tlv_content[3]; + } + STS_MOTION_SENSOR_ACT_INACT_DURATION_Init(); + APP_LOG(TS_OFF, VLEVEL_M, "###### YUNHORN STS ADXL345 TUNE [ Act=%02x Inact=%02x Duration=%02x]seconds \r\n", + act_threshold,inact_threshold,inact_duration); + + } + break; +#endif +#ifdef YUNHORN_STS_R0_ENABLED + case STS_CTRL_CMD_MEMS_TUNE_TOF_VL53L0X: + + break; +#endif +#ifdef YUNHORN_STS_P1_ENABLED + case STS_CTRL_CMD_MEMS_TUNE_FMCW_TI68X: + + break; +#endif +#ifdef YUNHORN_STS_OO_ENABLED + case STS_CTRL_CMD_MEMS_TUNE_PCR_A12X: + + break; + + case STS_CTRL_CMD_PRESENCE_SETTING: + + break; +#endif +#ifdef YUNHORN_STS_M3_ENABLED + case STS_CTRL_CMD_MEMS_TUNE_DIGITAL_RELAY: + + break; +#endif +#ifdef YUNHORN_STS_M5_ENABLED + case STS_CTRL_CMD_MEMS_TUNE_FAN_CONTROL: + + break; +#endif + default: + + break; } - /* - if (tlv_buf[1] - - */ -// -// } -// - } -void USER_APP_AUTO_RESPONDER_Process(char *tlv_buf) //YUNHORN_TODO_LIST -{ - -} - static void SendTxData(void) { @@ -690,8 +879,8 @@ static void SendTxData(void) //AppData.Buffer[i++] = (uint8_t)(0xFF & m7_data.battery_Pct); //15 AppData.Buffer[i++] = (uint8_t)(99*batteryLevel/254); //15 /* 99% (very low) to 254 (fully charged) */ - APP_LOG(TS_OFF, VLEVEL_L, "###### LoRa_User_Port:%03d | Duration:%02d seconds | FREQ_X:%d Hz | FREQ_Y:%d Hz | FREQ_Z:%d Hz |\r\n###### | RMS_X:%d | RMS_Y:%d | RMS_Z:%d | BATTERY_B:%02d%% |\r\n", - AppData.Port, AppData.Buffer[2], + APP_LOG(TS_OFF, VLEVEL_L, "###### Duration:%02d seconds | FREQ_X:%d Hz | FREQ_Y:%d Hz | FREQ_Z:%d Hz |\r\n###### | RMS_X:%d | RMS_Y:%d | RMS_Z:%d | BATTERY_B:%02d%% |\r\n", + AppData.Buffer[2], (AppData.Buffer[3]*255+AppData.Buffer[4]), (AppData.Buffer[5]*255+AppData.Buffer[6]), (AppData.Buffer[7]*255+AppData.Buffer[8]), (AppData.Buffer[9]*255+AppData.Buffer[10]), (AppData.Buffer[11]*255+AppData.Buffer[12]),(AppData.Buffer[13]*255+AppData.Buffer[14]),AppData.Buffer[15]); } diff --git a/LoRaWAN/App/lora_app.h b/LoRaWAN/App/lora_app.h index 2a50fde..14c2baf 100644 --- a/LoRaWAN/App/lora_app.h +++ b/LoRaWAN/App/lora_app.h @@ -66,7 +66,7 @@ extern "C" { /*! * LoRaWAN default class */ -#define LORAWAN_DEFAULT_CLASS CLASS_A +#define LORAWAN_DEFAULT_CLASS CLASS_C /*! * LoRaWAN default confirm state diff --git a/LoRaWAN/Target/lorawan_conf.h b/LoRaWAN/Target/lorawan_conf.h index c97e7f4..9e52b96 100644 --- a/LoRaWAN/Target/lorawan_conf.h +++ b/LoRaWAN/Target/lorawan_conf.h @@ -55,7 +55,7 @@ extern "C" { * @brief LoRaWAN version definition * @note possible values: 0x01000300 or 0x01000400 */ -#define LORAMAC_SPECIFICATION_VERSION 0x01000400 +#define LORAMAC_SPECIFICATION_VERSION 0x01000300 //YUNHORN_STS_MM 2022-10-20 /* Region ------------------------------------*/ /* the region listed here will be linked in the MW code */ diff --git a/MDK-ARM/LoRaWAN_End_Node/STS_M7_10_19_R1.build_log.htm b/MDK-ARM/LoRaWAN_End_Node/STS_M7_10_19_R1.build_log.htm index 91ec3b7..74bee89 100644 --- a/MDK-ARM/LoRaWAN_End_Node/STS_M7_10_19_R1.build_log.htm +++ b/MDK-ARM/LoRaWAN_End_Node/STS_M7_10_19_R1.build_log.htm @@ -28,74 +28,74 @@ Project File Date: 10/19/2022 *** Using Compiler 'V6.15', folder: 'D:\Keil_v5\ARM\ARMCLANG\Bin' Rebuild target 'STS_MM_WLE5' assembling startup_stm32wle5xx.s... -compiling gpio.c... compiling adc.c... compiling main.c... -compiling sys_debug.c... -compiling stm32_lpm_if.c... compiling dma.c... -compiling adc_if.c... +compiling gpio.c... compiling subghz.c... +compiling stm32_lpm_if.c... compiling sys_sensors.c... compiling stm32wlxx_it.c... -compiling rtc.c... -compiling usart.c... +compiling sys_debug.c... compiling timer_if.c... -compiling usart_if.c... +compiling usart.c... +compiling rtc.c... compiling sys_app.c... +compiling adc_if.c... +compiling usart_if.c... compiling stm32wlxx_hal_msp.c... compiling ssd1306_fonts.c... -compiling app_lorawan.c... compiling flash_if.c... -compiling radio_board_if.c... -compiling ssd1306.c... -compiling ssd1306_tests.c... +compiling app_lorawan.c... compiling CayenneLpp.c... +compiling ssd1306.c... compiling lora_info.c... +compiling radio_board_if.c... +compiling ssd1306_tests.c... compiling stm32wlxx_ll_adc.c... -compiling lora_app.c... compiling stm32wlxx_hal_adc_ex.c... +compiling lora_app.c... compiling yunhorn_sts_motion_sensor.c... compiling yunhorn_sts_motion_sensor_adxl345.c... +compiling stm32wlxx_hal_flash.c... +compiling stm32wlxx_hal_rcc_ex.c... compiling stm32wlxx_hal_adc.c... compiling stm32wlxx_hal_rcc.c... -compiling stm32wlxx_hal_rcc_ex.c... -compiling stm32wlxx_hal_flash.c... compiling stm32wlxx_hal_flash_ex.c... compiling stm32wlxx_hal_gpio.c... compiling stm32wlxx_hal_dma_ex.c... -compiling stm32wlxx_hal_dma.c... compiling stm32wlxx_hal_pwr.c... -compiling stm32wlxx_hal_pwr_ex.c... +compiling stm32wlxx_hal_dma.c... compiling stm32wlxx_hal_cortex.c... +compiling stm32wlxx_hal_pwr_ex.c... compiling stm32wlxx_hal.c... compiling stm32wlxx_hal_exti.c... compiling stm32wlxx_hal_rtc.c... compiling stm32wlxx_hal_rtc_ex.c... compiling stm32wlxx_hal_subghz.c... -compiling stm32wlxx_hal_tim_ex.c... -compiling stm32wlxx_hal_tim.c... compiling stm32wlxx_hal_uart_ex.c... compiling stm32wlxx_hal_i2c_ex.c... -compiling system_stm32wlxx.c... compiling cmac.c... -compiling stm32wlxx_hal_uart.c... +compiling system_stm32wlxx.c... compiling lorawan_aes.c... -compiling LmhpCompliance.c... +compiling stm32wlxx_hal_tim_ex.c... compiling soft-se.c... compiling Region.c... -compiling stm32wlxx_hal_i2c.c... +compiling LmhpCompliance.c... compiling RegionAU915.c... -compiling RegionAS923.c... compiling RegionBaseUS.c... compiling RegionCN470.c... +compiling RegionAS923.c... compiling RegionCN779.c... +compiling stm32wlxx_hal_uart.c... compiling RegionEU433.c... -compiling RegionCommon.c... compiling RegionEU868.c... compiling RegionIN865.c... +compiling stm32wlxx_hal_tim.c... +compiling RegionCommon.c... compiling RegionKR920.c... compiling RegionRU864.c... +compiling stm32wlxx_hal_i2c.c... compiling RegionUS915.c... compiling LoRaMacAdr.c... compiling LoRaMacClassB.c... @@ -104,40 +104,40 @@ compiling LoRaMacConfirmQueue.c... compiling LoRaMacParser.c... compiling LoRaMacCrypto.c... compiling LoRaMacSerializer.c... -compiling LoRaMac.c... compiling NvmDataMgmt.c... compiling utilities.c... compiling RegionCN470A20.c... -compiling LmHandler.c... compiling RegionCN470A26.c... -compiling RegionCN470B20.c... compiling RegionCN470B26.c... -compiling radio_fw.c... +compiling RegionCN470B20.c... +compiling LmHandler.c... +compiling LoRaMac.c... compiling stm32_mem.c... -compiling stm32_adv_trace.c... -compiling radio_driver.c... +compiling radio_fw.c... compiling stm32_systime.c... -compiling stm32_tiny_sscanf.c... +compiling stm32_adv_trace.c... compiling stm32_tiny_vsnprintf.c... -compiling radio.c... +compiling stm32_tiny_sscanf.c... compiling stm32_seq.c... -compiling stm32_timer.c... +compiling radio_driver.c... compiling stm32_lpm.c... +compiling stm32_timer.c... compiling BayesFunctions.c... -compiling BasicMathFunctions.c... -compiling ControllerFunctions.c... +compiling radio.c... compiling ComplexMathFunctions.c... +compiling ControllerFunctions.c... +compiling BasicMathFunctions.c... compiling FastMathFunctions.c... compiling DistanceFunctions.c... compiling SVMFunctions.c... compiling StatisticsFunctions.c... -compiling MatrixFunctions.c... compiling SupportFunctions.c... +compiling MatrixFunctions.c... compiling CommonTables.c... compiling TransformFunctions.c... compiling FilteringFunctions.c... linking... -Program Size: Code=71348 RO-data=122768 RW-data=284 ZI-data=58684 +Program Size: Code=71608 RO-data=123120 RW-data=300 ZI-data=59068 FromELF: creating hex file... ".\LoRaWAN_End_Node\STS_M7_10_19_R1.axf" - 0 Error(s), 0 Warning(s). @@ -167,21 +167,21 @@ Package Vendor: Keil * Component: ARM::CMSIS:CORE:5.4.0 * Component: ARM::CMSIS:DSP:Source:1.8.0 - Source file: CMSIS\DSP\Source\FilteringFunctions\FilteringFunctions.c - Source file: CMSIS\DSP\Source\MatrixFunctions\MatrixFunctions.c - Source file: CMSIS\DSP\Source\FastMathFunctions\FastMathFunctions.c - Source file: CMSIS\DSP\Source\StatisticsFunctions\StatisticsFunctions.c - Source file: CMSIS\DSP\Source\SupportFunctions\SupportFunctions.c - Source file: CMSIS\DSP\Source\TransformFunctions\TransformFunctions.c Source file: CMSIS\DSP\Source\SVMFunctions\SVMFunctions.c + Source file: CMSIS\DSP\Source\StatisticsFunctions\StatisticsFunctions.c + Source file: CMSIS\DSP\Source\MatrixFunctions\MatrixFunctions.c + Source file: CMSIS\DSP\Source\TransformFunctions\TransformFunctions.c + Source file: CMSIS\DSP\Source\SupportFunctions\SupportFunctions.c Include file: CMSIS\DSP\Include\arm_math.h + Source file: CMSIS\DSP\Source\ComplexMathFunctions\ComplexMathFunctions.c + Source file: CMSIS\DSP\Source\DistanceFunctions\DistanceFunctions.c + Source file: CMSIS\DSP\Source\CommonTables\CommonTables.c + Source file: CMSIS\DSP\Source\ControllerFunctions\ControllerFunctions.c + Source file: CMSIS\DSP\Source\FastMathFunctions\FastMathFunctions.c + Source file: CMSIS\DSP\Source\FilteringFunctions\FilteringFunctions.c Source file: CMSIS\DSP\Source\BasicMathFunctions\BasicMathFunctions.c Source file: CMSIS\DSP\Source\BayesFunctions\BayesFunctions.c - Source file: CMSIS\DSP\Source\DistanceFunctions\DistanceFunctions.c - Source file: CMSIS\DSP\Source\ComplexMathFunctions\ComplexMathFunctions.c - Source file: CMSIS\DSP\Source\ControllerFunctions\ControllerFunctions.c - Source file: CMSIS\DSP\Source\CommonTables\CommonTables.c -Build Time Elapsed: 00:00:11 +Build Time Elapsed: 00:00:07 diff --git a/MDK-ARM/LoRaWAN_End_Node/STS_M7_10_19_R1.htm b/MDK-ARM/LoRaWAN_End_Node/STS_M7_10_19_R1.htm index 301711b..53941f4 100644 --- a/MDK-ARM/LoRaWAN_End_Node/STS_M7_10_19_R1.htm +++ b/MDK-ARM/LoRaWAN_End_Node/STS_M7_10_19_R1.htm @@ -3,7 +3,7 @@ Static Call Graph - [.\LoRaWAN_End_Node\STS_M7_10_19_R1.axf]

Static Call Graph for image .\LoRaWAN_End_Node\STS_M7_10_19_R1.axf


-

#<CALLGRAPH># ARM Linker, 6150002: Last Updated: Wed Oct 19 15:31:19 2022 +

#<CALLGRAPH># ARM Linker, 6150002: Last Updated: Sat Oct 22 18:04:36 2022

Maximum Stack Usage = 0 bytes + Unknown(Cycles, Untraceable Function Pointers)

Call chain for Maximum Stack Depth:

@@ -11,4558 +11,4624 @@ Call chain for Maximum Stack Depth:

Mutually Recursive functions -

  • ADC_IRQHandler   ⇒   ADC_IRQHandler
    -
  • BusFault_Handler   ⇒   BusFault_Handler
    -
  • HardFault_Handler   ⇒   HardFault_Handler
    -
  • memcpy1   ⇒   memcpy1
    -
  • memset1   ⇒   memset1
    -
  • MemManage_Handler   ⇒   MemManage_Handler
    -
  • NMI_Handler   ⇒   NMI_Handler
    -
  • UTIL_MEM_set_8   ⇒   UTIL_MEM_set_8
    -
  • UsageFault_Handler   ⇒   UsageFault_Handler
    -
  • UTIL_MEM_cpy_8   ⇒   UTIL_MEM_cpy_8
    -
  • UART_EndTxTransfer   ⇒   UART_EndTxTransfer
    -
  • OUTLINED_FUNCTION_6   ⇒   RadioSetModem
    +
  • ADC_IRQHandler   ⇒   ADC_IRQHandler
    +
  • BusFault_Handler   ⇒   BusFault_Handler
    +
  • HardFault_Handler   ⇒   HardFault_Handler
    +
  • memcpy1   ⇒   memcpy1
    +
  • memset1   ⇒   memset1
    +
  • MemManage_Handler   ⇒   MemManage_Handler
    +
  • NMI_Handler   ⇒   NMI_Handler
    +
  • UTIL_MEM_set_8   ⇒   UTIL_MEM_set_8
    +
  • UsageFault_Handler   ⇒   UsageFault_Handler
    +
  • UTIL_MEM_cpy_8   ⇒   UTIL_MEM_cpy_8
    +
  • UART_EndTxTransfer   ⇒   UART_EndTxTransfer
    +
  • OUTLINED_FUNCTION_6   ⇒   RadioSetModem

    Function Pointers

    Global Symbols

    -

    __main (Thumb, 0 bytes, Stack size 0 bytes, entry.o(.ARM.Collect$$$$00000000)) +

    __main (Thumb, 0 bytes, Stack size 0 bytes, entry.o(.ARM.Collect$$$$00000000))
    [Address Reference Count : 1]

    -

    _main_scatterload (Thumb, 0 bytes, Stack size 0 bytes, entry5.o(.ARM.Collect$$$$00000004)) -

    [Calls]