diff --git a/.gitignore b/.gitignore
index 3940a2cc..dfb805f2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,5 @@ board/*/MDK-ARM/*.uvguix.*
board/*/MDK-ARM/EventRecorderStub.scvd
board/*/MDK-ARM/*/*.htm
board/*/MDK-ARM/*/*.build_log.htm
+Obj/*
+Debug/*
diff --git a/board/NUCLEO_STM32L073RZ/BSP/HardWare/Common/bsp.c b/board/NUCLEO_STM32L073RZ/BSP/HardWare/Common/bsp.c
new file mode 100644
index 00000000..57f6df9c
--- /dev/null
+++ b/board/NUCLEO_STM32L073RZ/BSP/HardWare/Common/bsp.c
@@ -0,0 +1,35 @@
+/**
+ ******************************************************************************
+ * @file bsp.c
+ * @author jieranzhi
+ * @brief provide high level interfaces to manage the sensors on the
+ * application, this is a modified version of the official api
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+#include "bsp.h"
+
+void BSP_Sensor_Init(void)
+{
+ /* Initialize sensors */
+ HTS221_Init();
+ LPS22HB_Init();
+ LIS3MDL_Init();
+}
+
+void BSP_Sensor_Read(sensor_data_t *sensor_data)
+{
+ sensor_tempnhumi_t tempnhumi_sensor;
+ sensor_press_t press_sensor;
+ sensor_magn_t magn_sensor;
+
+ HTS221_Get_TemperatureAndHumidity(&tempnhumi_sensor);
+ LPS22HB_Get_Press(&press_sensor);
+ LIS3MDL_Get_Magn(&magn_sensor);
+
+ sensor_data->sensor_press = press_sensor;
+ sensor_data->sensor_tempnhumi = tempnhumi_sensor;
+ sensor_data->sensor_magn = magn_sensor;
+}
+
diff --git a/board/NUCLEO_STM32L073RZ/BSP/HardWare/Common/bsp.h b/board/NUCLEO_STM32L073RZ/BSP/HardWare/Common/bsp.h
new file mode 100644
index 00000000..c9f515ae
--- /dev/null
+++ b/board/NUCLEO_STM32L073RZ/BSP/HardWare/Common/bsp.h
@@ -0,0 +1,89 @@
+/*
+ / _____) _ | |
+( (____ _____ ____ _| |_ _____ ____| |__
+ \____ \| ___ | (_ _) ___ |/ ___) _ \
+ _____) ) ____| | | || |_| ____( (___| | | |
+(______/|_____)_|_|_| \__)_____)\____)_| |_|
+ (C)2013 Semtech
+
+Description: contains all hardware driver
+
+License: Revised BSD License, see LICENSE.TXT file include in the project
+
+Maintainer: Miguel Luis and Gregory Cristian
+*/
+/**
+ ******************************************************************************
+ * @file bsp.h
+ * @author MCD Application Team
+ * @brief contains all hardware driver
+ ******************************************************************************
+ * @attention
+ *
+ *
© Copyright (c) 2018 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software component is licensed by ST under Ultimate Liberty license
+ * SLA0044, the "License"; You may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at:
+ * www.st.com/SLA0044
+ *
+ ******************************************************************************
+ */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __BSP_H__
+#define __BSP_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* Includes ------------------------------------------------------------------*/
+#include
+#include "HTS221.h"
+#include "LPS22HB.h"
+#include "LIS3MDL.h"
+
+/* Exported types ------------------------------------------------------------*/
+typedef struct
+{
+ sensor_press_t sensor_press; /* pressure sensor */
+ sensor_tempnhumi_t sensor_tempnhumi; /* temperature and humidity */
+ sensor_magn_t sensor_magn; /* magnetometer */
+
+ //--------------------------- accelerator and gyroscope -------------------//
+ int16_t accel_x; /* in g */
+ int16_t accel_y; /* in g */
+ int16_t accel_z; /* in g */
+ int16_t gyro_x; /* in degree/s */
+ int16_t gyro_y; /* in degree/s */
+ int16_t gyro_z; /* in degree/s */
+
+} sensor_data_t;
+
+/* Exported constants --------------------------------------------------------*/
+/* External variables --------------------------------------------------------*/
+/* Exported macros -----------------------------------------------------------*/
+/* Exported functions ------------------------------------------------------- */
+/**
+ * @brief initialises the sensor
+ *
+ * @note
+ * @retval None
+ */
+void BSP_Sensor_Init(void);
+
+/**
+ * @brief sensor read.
+ *
+ * @note none
+ * @retval sensor_data
+ */
+void BSP_Sensor_Read(sensor_data_t *sensor_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __BSP_H__ */
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
diff --git a/board/NUCLEO_STM32L073RZ/BSP/HardWare/HTS221/HTS221.c b/board/NUCLEO_STM32L073RZ/BSP/HardWare/HTS221/HTS221.c
index 58854aac..5415544d 100644
--- a/board/NUCLEO_STM32L073RZ/BSP/HardWare/HTS221/HTS221.c
+++ b/board/NUCLEO_STM32L073RZ/BSP/HardWare/HTS221/HTS221.c
@@ -2,7 +2,8 @@
* @breif HTS221驱动文件
* @author Mculover666(www.mculover666.cn)
* @date 2019-12-27
- * @version 1.0.0
+ * @modified by jieranzhi 2020/03/23
+ * @version 1.0.1
********************************************/
#include
@@ -15,7 +16,7 @@ void HTS221_Init()
//设置分辨率
cmd = 0x3F;
- HAL_I2C_Mem_Write(&hi2c1, HTS221_ADDR_WR, 0x10, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+ HAL_I2C_Mem_Write(&hi2c1, HTS221_ADDR_WR, HTS221_AV_CONF, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
//设置电源、数据块更新模式、数据输出速率
cmd = 0x84;
@@ -57,11 +58,11 @@ uint8_t HTS221_Get_Temperature(int16_t* temperature)
int32_t tmp32;
/*1. 读取T0_degC_x8 和 T1_degC_x8 校验值 */
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x32, I2C_MEMADD_SIZE_8BIT, &T0_degC_x8, 1, 0xFFFF);
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x33, I2C_MEMADD_SIZE_8BIT, &T1_degC_x8, 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_T0_degC_x8, I2C_MEMADD_SIZE_8BIT, &T0_degC_x8, 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_T1_degC_x8, I2C_MEMADD_SIZE_8BIT, &T1_degC_x8, 1, 0xFFFF);
/*2. 读取T1_degC 和 T0_degC 的最高位*/
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x35, I2C_MEMADD_SIZE_8BIT, &tmp, 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_T1_T0_msb, I2C_MEMADD_SIZE_8BIT, &tmp, 1, 0xFFFF);
// 计算T0_degC and T1_degC 值 */
T0_degC_x8_u16 = (((uint16_t)(tmp & 0x03)) << 8) | ((uint16_t)T0_degC_x8);
@@ -70,10 +71,10 @@ uint8_t HTS221_Get_Temperature(int16_t* temperature)
T1_degC = T1_degC_x8_u16>>3;
/*3. 读取 T0_OUT 和 T1_OUT 值 */
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x3C, I2C_MEMADD_SIZE_8BIT, &buffer[0], 1, 0xFFFF);
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x3D, I2C_MEMADD_SIZE_8BIT, &buffer[1], 1, 0xFFFF);
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x3E, I2C_MEMADD_SIZE_8BIT, &buffer[0], 1, 0xFFFF);
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x3F, I2C_MEMADD_SIZE_8BIT, &buffer[1], 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_T0_OUT_L, I2C_MEMADD_SIZE_8BIT, &buffer[0], 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_T0_OUT_H, I2C_MEMADD_SIZE_8BIT, &buffer[1], 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_T1_OUT_L, I2C_MEMADD_SIZE_8BIT, &buffer[0], 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_T1_OUT_H, I2C_MEMADD_SIZE_8BIT, &buffer[1], 1, 0xFFFF);
T0_out = (((uint16_t)buffer[1])<<8) | (uint16_t)buffer[0];
T1_out = (((uint16_t)buffer[3])<<8) | (uint16_t)buffer[2];
@@ -90,8 +91,8 @@ uint8_t HTS221_Get_Temperature(int16_t* temperature)
T_out = (((uint16_t)buffer[1])<<8) | (uint16_t)buffer[0];
/* 5. 使用线性插值法计算当前对应的温度值 */
- tmp32 = ((int32_t)(T_out - T0_out)) * ((int32_t)(T1_degC - T0_degC)*10);
- *temperature = tmp32 /(T1_out - T0_out) + T0_degC*10;
+ tmp32 = ((int32_t)(T_out - T0_out)) * ((int32_t)(T1_degC - T0_degC));
+ *temperature = tmp32*10 /(T1_out - T0_out) + T0_degC*10;
return 0;
}
@@ -108,24 +109,24 @@ uint8_t HTS221_Get_Humidity(int16_t* humidity)
/* 1. 读取H0_rH and H1_rH 校验值 */
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x30, I2C_MEMADD_SIZE_8BIT, &buffer[0], 1, 0xFFFF);
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x31, I2C_MEMADD_SIZE_8BIT, &buffer[1], 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_H0_rH_x2, I2C_MEMADD_SIZE_8BIT, &buffer[0], 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_H1_rH_x2, I2C_MEMADD_SIZE_8BIT, &buffer[1], 1, 0xFFFF);
H0_rh = buffer[0] >> 1;
H1_rh = buffer[1] >> 1;
/*2. 读取 H0_T0_OUT 校验值 */
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x36, I2C_MEMADD_SIZE_8BIT, &buffer[0], 1, 0xFFFF);
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x37, I2C_MEMADD_SIZE_8BIT, &buffer[1], 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_H0_T0_OUT_L, I2C_MEMADD_SIZE_8BIT, &buffer[0], 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_H0_T0_OUT_H, I2C_MEMADD_SIZE_8BIT, &buffer[1], 1, 0xFFFF);
H0_T0_out = (((uint16_t)buffer[1])<<8) | (uint16_t)buffer[0];
/*3. 读取 H1_T0_OUT 校验值 */
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x3A, I2C_MEMADD_SIZE_8BIT, &buffer[0], 1, 0xFFFF);
- HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, 0x3B, I2C_MEMADD_SIZE_8BIT, &buffer[1], 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_H1_T0_OUT_L, I2C_MEMADD_SIZE_8BIT, &buffer[0], 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_H1_T0_OUT_H, I2C_MEMADD_SIZE_8BIT, &buffer[1], 1, 0xFFFF);
H1_T0_out = (((uint16_t)buffer[1])<<8) | (uint16_t)buffer[0];
/*4. 启动转换,等待完成后读取转换后的值 */
HTS221_Start();
- while(status_dat != 0x03)
+ while(status_dat != (HTS221_T_DA|HTS221_H_DA))
{
HAL_I2C_Mem_Read(&hi2c1, HTS221_ADDR_RD, HTS221_STATUS_REG, I2C_MEMADD_SIZE_8BIT, &status_dat, 1, 0xFFFF);
}
@@ -145,3 +146,20 @@ uint8_t HTS221_Get_Humidity(int16_t* humidity)
return 0;
}
+
+/* 读取HT221的所有sensor的数据 */
+uint8_t HTS221_Get_TemperatureAndHumidity(sensor_tempnhumi_t* tempnhumi_sensor)
+{
+ int16_t temperature;
+ int16_t humidity;
+
+ HTS221_Get_Temperature(&temperature);
+ HTS221_Get_Humidity(&humidity);
+
+ tempnhumi_sensor->temp_sensitivity = 64;
+ tempnhumi_sensor->temperature = temperature;
+ tempnhumi_sensor->humi_sensitivity = 256;
+ tempnhumi_sensor->humidity = humidity;
+
+ return 0;
+}
diff --git a/board/NUCLEO_STM32L073RZ/BSP/HardWare/HTS221/HTS221.h b/board/NUCLEO_STM32L073RZ/BSP/HardWare/HTS221/HTS221.h
index 2d0377c0..b81e6f8b 100644
--- a/board/NUCLEO_STM32L073RZ/BSP/HardWare/HTS221/HTS221.h
+++ b/board/NUCLEO_STM32L073RZ/BSP/HardWare/HTS221/HTS221.h
@@ -10,6 +10,7 @@
#define HTS221_CTRL_REG2 0x21
#define HTS221_CTRL_REG3 0x22
+#define HTS221_AV_CONF 0x10
#define HTS221_STATUS_REG 0x27
#define HTS221_HUMIDITY_OUT_L 0x28
@@ -17,9 +18,45 @@
#define HTS221_TEMP_OUT_L 0x2A
#define HTS221_TEMP_OUT_H 0x2B
-void HTS221_Init(void);
+#define HTS221_H0_rH_x2 0x30
+#define HTS221_H1_rH_x2 0x31
+#define HTS221_H0_T0_OUT_L 0x36
+#define HTS221_H0_T0_OUT_H 0x37
+#define HTS221_H1_T0_OUT_L 0x3A
+#define HTS221_H1_T0_OUT_H 0x3B
+#define HTS221_T0_degC_x8 0x32
+#define HTS221_T1_degC_x8 0x33
+#define HTS221_T1_T0_msb 0x35
+#define HTS221_T0_OUT_L 0x3C
+#define HTS221_T0_OUT_H 0x3D
+#define HTS221_T1_OUT_L 0x3E
+#define HTS221_T1_OUT_H 0x3F
+
+/**
+ * @brief temperature & humidity sensor structures definition
+ * added by jieranzhi, 2020/03/29
+ */
+typedef struct
+{
+ uint8_t temp_sensitivity;
+ int16_t temperature;
+ uint16_t humi_sensitivity;
+ int16_t humidity;
+}sensor_tempnhumi_t;
+
+/**
+ * @brief STATUS structures definition
+ */
+typedef enum
+{
+ HTS221_T_DA = 0x01U, /*!< temperature data available */
+ HTS221_H_DA = 0x02U, /*!< humidity data available */
+}HTS221_StatusTypeDef;
+
+void HTS221_Init(void);
uint8_t HTS221_Get_Temperature(int16_t* temperature);
uint8_t HTS221_Get_Humidity(int16_t* humidity);
+uint8_t HTS221_Get_TemperatureAndHumidity(sensor_tempnhumi_t* tempnhumi_sensor);
#endif /* _HTS221_H_ */
diff --git a/board/NUCLEO_STM32L073RZ/BSP/HardWare/LIS3MDL/LIS3MDL.c b/board/NUCLEO_STM32L073RZ/BSP/HardWare/LIS3MDL/LIS3MDL.c
new file mode 100644
index 00000000..adffac7b
--- /dev/null
+++ b/board/NUCLEO_STM32L073RZ/BSP/HardWare/LIS3MDL/LIS3MDL.c
@@ -0,0 +1,136 @@
+/**
+ ******************************************************************************
+ * @file LIS3MDL.c
+ * @author jieranzhi
+ * @update 2020/03/23 19:00 CST
+ * @brief This file provides code for the LIS3MDL Initialization
+ * and data output codes.
+ ******************************************************************************
+ * @attention
+ *
+ * 1. this code is used as one of the examples in TencentOS_tiny project, it's
+ * just a simple implementation of the sensor functionalities, to implement
+ * more functions, please refer to the datasheet or the official software
+ * package provided by ST (STM32CubeExpansion_LRWAN_V1.3.1)
+ *
+ * 2. in this file the host MCU will to read the output persistently, which is
+ * NOT of power efficient.
+ *
+ ******************************************************************************
+ */
+
+#include
+#include
+
+// initialization of LIS3MDL
+void LIS3MDL_Init()
+{
+ uint8_t cmd = 0;
+
+ // enable temperature sensor(temperature compensation);X and Y axes operative
+ // mode(Medium-performance); Output data rate(10Hz); disable high data rate
+ // disable Self-test
+ cmd = 0xB0;
+ HAL_I2C_Mem_Write(&hi2c1, LIS3MDL_ADDR_WR, LIS3MDL_CTRL_REG1, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+
+ // Full-scale:+/-4gauss; Reboot memory(normal)
+ cmd = 0x00;
+ HAL_I2C_Mem_Write(&hi2c1, LIS3MDL_ADDR_WR, LIS3MDL_CTRL_REG2, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+
+ // disable lowpower mode; Operating mode (continuous mode)
+ cmd = 0x00;
+ HAL_I2C_Mem_Write(&hi2c1, LIS3MDL_ADDR_WR, LIS3MDL_CTRL_REG3, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+
+ // Z-axis operative mode (Medium-performance)
+ cmd = 0x04;
+ HAL_I2C_Mem_Write(&hi2c1, LIS3MDL_ADDR_WR, LIS3MDL_CTRL_REG4, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+
+ // disable FAST READ; data block update(continuous)
+ cmd = 0x40;
+ HAL_I2C_Mem_Write(&hi2c1, LIS3MDL_ADDR_WR, LIS3MDL_CTRL_REG5, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+}
+
+// get fullscale configuration
+LIS3MDL_FullScaleTypeDef LIS3MDL_Get_FullScale()
+{
+ uint8_t fullscale;
+ HAL_I2C_Mem_Read(&hi2c1, LIS3MDL_ADDR_RD, LIS3MDL_CTRL_REG2, I2C_MEMADD_SIZE_8BIT, &fullscale, 1, 0xFFFF);
+ fullscale = (fullscale<<1)>>6;
+ return (LIS3MDL_FullScaleTypeDef)fullscale;
+}
+
+// set fullscale of the sensor
+void LIS3MDL_Set_FullScale(LIS3MDL_FullScaleTypeDef fullscale)
+{
+ uint8_t ctrl_reg2_value;
+ uint8_t fullscale_config = (uint8_t)fullscale;
+ HAL_I2C_Mem_Read(&hi2c1, LIS3MDL_ADDR_RD, LIS3MDL_CTRL_REG2, I2C_MEMADD_SIZE_8BIT, &ctrl_reg2_value, 1, 0xFFFF);
+ fullscale_config = (ctrl_reg2_value&0x9F)|(fullscale_config<<5);
+ HAL_I2C_Mem_Write(&hi2c1, LIS3MDL_ADDR_WR, LIS3MDL_CTRL_REG2, I2C_MEMADD_SIZE_8BIT, &fullscale_config, 1, 0xFFFF);
+}
+
+// calculate the sensitivity per fullscale
+uint16_t LIS3MDL_Get_Sensitivity(LIS3MDL_FullScaleTypeDef fullscale)
+{
+ uint16_t sensitivity = 1;
+ switch(fullscale)
+ {
+ case FULLSCALE_4:{
+ sensitivity = 6842;
+ break;
+ }
+ case FULLSCALE_8:{
+ sensitivity = 3421;
+ break;
+ }
+ case FULLSCALE_12:{
+ sensitivity = 2281;
+ break;
+ }
+ case FULLSCALE_16:{
+ sensitivity = 1711;
+ break;
+ }
+ default:{
+ sensitivity = 1;
+ }
+ }
+ return sensitivity;
+}
+
+// start a new acquisition by enabling the one-shot bit in the LIS3MDL_CTRL_REG2
+// and read the magnetic field from the sensor
+uint8_t LIS3MDL_Get_Magn(sensor_magn_t* magn_sensor)
+{
+ uint8_t status_dat = 0;
+ uint8_t magn_x_out_l = 0;
+ uint8_t magn_x_out_h = 0;
+ uint8_t magn_y_out_l = 0;
+ uint8_t magn_y_out_h = 0;
+ uint8_t magn_z_out_l = 0;
+ uint8_t magn_z_out_h = 0;
+
+ // get fullscale and sensitivity
+ LIS3MDL_FullScaleTypeDef fullscale = LIS3MDL_Get_FullScale();
+ magn_sensor->fullscale = (uint8_t)fullscale;
+ magn_sensor->sensitivity = LIS3MDL_Get_Sensitivity(fullscale);
+
+ // wait until the data is ready
+ while((status_dat&LIS3MDL_ZYXDA) != LIS3MDL_ZYXDA)
+ {
+ HAL_I2C_Mem_Read(&hi2c1, LIS3MDL_ADDR_RD, LIS3MDL_STATUS_REG, I2C_MEMADD_SIZE_8BIT, &status_dat, 1, 0xFFFF);
+ }
+
+ HAL_I2C_Mem_Read(&hi2c1, LIS3MDL_ADDR_RD, LIS3MDL_X_OUT_L, I2C_MEMADD_SIZE_8BIT, &magn_x_out_l, 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, LIS3MDL_ADDR_RD, LIS3MDL_X_OUT_H, I2C_MEMADD_SIZE_8BIT, &magn_x_out_h, 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, LIS3MDL_ADDR_RD, LIS3MDL_Y_OUT_L, I2C_MEMADD_SIZE_8BIT, &magn_y_out_l, 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, LIS3MDL_ADDR_RD, LIS3MDL_Y_OUT_H, I2C_MEMADD_SIZE_8BIT, &magn_y_out_h, 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, LIS3MDL_ADDR_RD, LIS3MDL_Z_OUT_L, I2C_MEMADD_SIZE_8BIT, &magn_z_out_l, 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, LIS3MDL_ADDR_RD, LIS3MDL_Z_OUT_H, I2C_MEMADD_SIZE_8BIT, &magn_z_out_h, 1, 0xFFFF);
+
+ magn_sensor->magn_x = (uint16_t)magn_x_out_h<<8|magn_x_out_l;
+ magn_sensor->magn_y = (uint16_t)magn_y_out_h<<8|magn_y_out_l;
+ magn_sensor->magn_z = (uint16_t)magn_z_out_h<<8|magn_z_out_l;
+
+ return 0;
+}
diff --git a/board/NUCLEO_STM32L073RZ/BSP/HardWare/LIS3MDL/LIS3MDL.h b/board/NUCLEO_STM32L073RZ/BSP/HardWare/LIS3MDL/LIS3MDL.h
new file mode 100644
index 00000000..f61302c6
--- /dev/null
+++ b/board/NUCLEO_STM32L073RZ/BSP/HardWare/LIS3MDL/LIS3MDL.h
@@ -0,0 +1,93 @@
+/**
+ ******************************************************************************
+ * @file LIS3MDL.h
+ * @author jieranzhi (the developer)
+ * @update 2020/03/23 19:00 CST
+ * @brief This file contains basic functions prototypes and pre-definitions
+ * of the register addresses
+ ******************************************************************************
+ * @attention
+ *
+ * 1. the temperature sensor embedded in the LIS3MDL is intended to be embedded
+ * temperature compensation. Therefore, in this file we DO NOT include the
+ * temperature output
+ *
+ * 2. on the P-NUCLEO-LRWAN3, the SDO/SA0 pad is connected to voltage supply(
+ * via a resistor), LSb is ‘1’ (address 1011101b)
+ *
+ * 3. for more information, please refer to the datasheet
+ * (https://www.st.com/resource/en/datasheet/lis3mdl.pdf)
+ *
+ ******************************************************************************
+ */
+#ifndef _LIS3MDL_H_
+#define _LIS3MDL_H_
+
+#include
+
+/* Registers -----------------------------------------------------------------*/
+#define LIS3MDL_ADDR_WR 0x3C
+#define LIS3MDL_ADDR_RD 0x3D
+
+#define LIS3MDL_CTRL_REG1 0x20
+#define LIS3MDL_CTRL_REG2 0x21
+#define LIS3MDL_CTRL_REG3 0x22
+#define LIS3MDL_CTRL_REG4 0x23
+#define LIS3MDL_CTRL_REG5 0x24
+
+#define LIS3MDL_STATUS_REG 0x27
+
+#define LIS3MDL_X_OUT_L 0x28
+#define LIS3MDL_X_OUT_H 0x29
+#define LIS3MDL_Y_OUT_L 0x2A
+#define LIS3MDL_Y_OUT_H 0x2B
+#define LIS3MDL_Z_OUT_L 0x2C
+#define LIS3MDL_Z_OUT_H 0x2D
+
+/* Enumeration ---------------------------------------------------------------*/
+/**
+ * @brief STATUS structures definition
+ */
+typedef enum
+{
+ LIS3MDL_ZYXOR = 0x80U, /*!< XYZ-axis data overrun */
+ LIS3MDL_ZOR = 0x40U, /*!< Z-axis data overrun */
+ LIS3MDL_YOR = 0x20U, /*!< Y-axis data overrun */
+ LIS3MDL_XOR = 0x10U, /*!< X-axis data overrun */
+ LIS3MDL_ZYXDA = 0x08U, /*!< XYZ-axis data available */
+ LIS3MDL_ZDA = 0x04U, /*!< Z-axis data available */
+ LIS3MDL_YDA = 0x02U, /*!< Y-axis data available */
+ LIS3MDL_XDA = 0x01U, /*!< X-axis data available */
+}LIS3MDL_StatusTypeDef;
+
+/**
+ * @brief STATUS structures definition
+ */
+typedef enum
+{
+ FULLSCALE_4 = 0x00U,
+ FULLSCALE_8 = 0x01U,
+ FULLSCALE_12 = 0x02U,
+ FULLSCALE_16 = 0x03U
+}LIS3MDL_FullScaleTypeDef;
+
+/**
+ * @brief magnetic sensor structures definition
+ */
+typedef struct
+{
+ uint8_t fullscale; // fullscale of magnetometer
+ uint16_t sensitivity; // sensitivity per fullscale
+ uint16_t magn_x; // X-magnetic value in LSB
+ uint16_t magn_y; // Y-magnetic value in LSB
+ uint16_t magn_z; // Z-magnetic value in LSB
+}sensor_magn_t;
+
+/* Functions -----------------------------------------------------------------*/
+void LIS3MDL_Init(void);
+void LIS3MDL_Set_FullScale(LIS3MDL_FullScaleTypeDef fullscale);
+LIS3MDL_FullScaleTypeDef LIS3MDL_Get_FullScale(void);
+uint16_t LIS3MDL_Get_Sensitivity(LIS3MDL_FullScaleTypeDef fullscale);
+uint8_t LIS3MDL_Get_Magn(sensor_magn_t* magn_sensor);
+
+#endif /* _LIS3MDL_H_ */
diff --git a/board/NUCLEO_STM32L073RZ/BSP/HardWare/LPS22HB/LPS22HB.c b/board/NUCLEO_STM32L073RZ/BSP/HardWare/LPS22HB/LPS22HB.c
new file mode 100644
index 00000000..86b3c108
--- /dev/null
+++ b/board/NUCLEO_STM32L073RZ/BSP/HardWare/LPS22HB/LPS22HB.c
@@ -0,0 +1,79 @@
+/**
+ ******************************************************************************
+ * @file LPS22HB.c
+ * @author jieranzhi
+ * @update 2020/03/23 19:00 CST
+ * @brief This file provides code for the LPS22HB Initialization
+ * and data output codes.
+ ******************************************************************************
+ * @attention
+ *
+ * 1. this code is used as one of the examples in TencentOS_tiny project, it's
+ * just a simple implementation of the sensor functionalities, to implement
+ * more functions, please refer to the datasheet or the official software
+ * package provided by ST (STM32CubeExpansion_LRWAN_V1.3.1)
+ *
+ * 2. in this file the host MCU need to read the output persistently, which is
+ * not of power efficient, to achieve better power consumption performance,
+ * it is recommended to use FIFO.
+ *
+ ******************************************************************************
+ */
+
+#include
+#include
+
+// initialization of LPS22HB
+void LPS22HB_Init()
+{
+ uint8_t cmd = 0;
+
+ // reset the Low-power mode configuration
+ cmd = 0x00;
+ HAL_I2C_Mem_Write(&hi2c1, LPS22HB_ADDR_WR, LPS22HB_RES_CONF_REG, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+
+ // setup data rate(power down, 000); disable lowpass filter (we use one-shot in this case); Block data update(continuous)
+ cmd = 0x00;
+ HAL_I2C_Mem_Write(&hi2c1, LPS22HB_ADDR_WR, LPS22HB_CTRL_REG1, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+
+ // reboot mode(normal); disable FIFO; enable IF_ADD_INC; enable I2C; software reset mode(normal); one-shot mode(idle)
+ cmd = 0x10;
+ HAL_I2C_Mem_Write(&hi2c1, LPS22HB_ADDR_WR, LPS22HB_CTRL_REG2, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+
+ // interupt control: set to default value (0x00)
+ cmd = 0x00;
+ HAL_I2C_Mem_Write(&hi2c1, LPS22HB_ADDR_WR, LPS22HB_CTRL_REG3, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+}
+
+// enable one-shot to start a new acquisition (conversion)
+static void LPS22HB_Start()
+{
+ uint8_t cmd = 0;
+ HAL_I2C_Mem_Read(&hi2c1, LPS22HB_ADDR_RD, LPS22HB_CTRL_REG2, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+ cmd |= 0x01;
+ HAL_I2C_Mem_Write(&hi2c1, LPS22HB_ADDR_WR, LPS22HB_CTRL_REG2, I2C_MEMADD_SIZE_8BIT, &cmd, 1, 0xFFFF);
+}
+
+// start a new acquisition by enabling the one-shot bit in the LPS22HB_CTRL_REG2
+// and read the pressure from the sensor
+uint8_t LPS22HB_Get_Press(sensor_press_t* press_sensor)
+{
+ uint8_t status_dat = 0;
+ uint8_t pressure_out_l = 0;
+ uint8_t pressure_out_h = 0;
+ uint8_t pressure_out_xl = 0;
+ press_sensor->sensitivity = 4096;
+
+ LPS22HB_Start();
+ while((status_dat&LPS22HB_P_DA) != LPS22HB_P_DA)
+ {
+ HAL_I2C_Mem_Read(&hi2c1, LPS22HB_ADDR_RD, LPS22HB_STATUS_REG, I2C_MEMADD_SIZE_8BIT, &status_dat, 1, 0xFFFF);
+ }
+
+ HAL_I2C_Mem_Read(&hi2c1, LPS22HB_ADDR_RD, LPS22HB_PRESS_OUT_XL, I2C_MEMADD_SIZE_8BIT, &pressure_out_xl, 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, LPS22HB_ADDR_RD, LPS22HB_PRESS_OUT_L, I2C_MEMADD_SIZE_8BIT, &pressure_out_l, 1, 0xFFFF);
+ HAL_I2C_Mem_Read(&hi2c1, LPS22HB_ADDR_RD, LPS22HB_PRESS_OUT_H, I2C_MEMADD_SIZE_8BIT, &pressure_out_h, 1, 0xFFFF);
+
+ press_sensor->pressure = (((uint32_t)pressure_out_h<<16) | ((uint16_t)pressure_out_l<<8) | pressure_out_xl);
+ return 0;
+}
diff --git a/board/NUCLEO_STM32L073RZ/BSP/HardWare/LPS22HB/LPS22HB.h b/board/NUCLEO_STM32L073RZ/BSP/HardWare/LPS22HB/LPS22HB.h
new file mode 100644
index 00000000..fbb2d265
--- /dev/null
+++ b/board/NUCLEO_STM32L073RZ/BSP/HardWare/LPS22HB/LPS22HB.h
@@ -0,0 +1,68 @@
+/**
+ ******************************************************************************
+ * @file LPS22HB.h
+ * @author jieranzhi (the developer)
+ * @update 2020/03/23 19:00 CST
+ * @brief This file contains basic functions prototypes and pre-definitions
+ * of the register addresses
+ ******************************************************************************
+ * @attention
+ *
+ * 1. the temperature sensor embedded in the LPS22HB is intended to be embedded
+ * temperature compensation. Therefore, in this file we DO NOT include the
+ * temperature output
+ *
+ * 2. on the P-NUCLEO-LRWAN3, the SDO/SA0 pad is connected to voltage supply(
+ * via a resistor), LSb is ‘1’ (address 1011101b)
+ *
+ * 3. for more information, please refer to the datasheet
+ * (https://www.st.com/resource/en/datasheet/dm00140895.pdf)
+ *
+ ******************************************************************************
+ */
+#ifndef _LPS22HB_H_
+#define _LPS22HB_H_
+
+#include
+
+/* Registers -----------------------------------------------------------------*/
+#define LPS22HB_ADDR_WR 0xBA
+#define LPS22HB_ADDR_RD 0xBB
+
+#define LPS22HB_CTRL_REG1 0x10
+#define LPS22HB_CTRL_REG2 0x11
+#define LPS22HB_CTRL_REG3 0x12
+
+#define LPS22HB_RES_CONF_REG 0x1A
+#define LPS22HB_STATUS_REG 0x27
+
+#define LPS22HB_PRESS_OUT_XL 0x28
+#define LPS22HB_PRESS_OUT_L 0x29
+#define LPS22HB_PRESS_OUT_H 0x2A
+
+/* Enumeration ---------------------------------------------------------------*/
+/**
+ * @brief STATUS structures definition
+ */
+typedef enum
+{
+ LPS22HB_T_OR = 0x20, /*!< temperature overrun */
+ LPS22HB_P_OR = 0x10, /*!< pressure overrun */
+ LPS22HB_T_DA = 0x02, /*!< new temperature data available */
+ LPS22HB_P_DA = 0x01, /*!< new pressure data available */
+}LPS22HB_StatusTypeDef;
+
+/**
+ * @brief pressure sensor structures definition
+ */
+typedef struct
+{
+ uint16_t sensitivity; // sensitivity per fullscale
+ uint32_t pressure; // X-magnetic value in LSB
+}sensor_press_t;
+
+/* Functions -----------------------------------------------------------------*/
+void LPS22HB_Init(void);
+uint8_t LPS22HB_Get_Press(sensor_press_t* press_sensor);
+
+#endif /* _LPS22HB_H_ */
diff --git a/board/NUCLEO_STM32L073RZ/BSP/Src/lora_demo.c b/board/NUCLEO_STM32L073RZ/BSP/Src/lora_demo.c
index accc7323..475d14a3 100644
--- a/board/NUCLEO_STM32L073RZ/BSP/Src/lora_demo.c
+++ b/board/NUCLEO_STM32L073RZ/BSP/Src/lora_demo.c
@@ -1,6 +1,7 @@
#include "lora_demo.h"
-#include "HTS221.h"
#include "RHF76.h"
+#include
+#include "bsp.h"
/*
==================================================================================
@@ -54,9 +55,18 @@
uint16_t report_period = 10;
typedef struct device_data_st {
- uint8_t temperature;
- uint8_t humidity;
+ uint8_t magn_fullscale; // fullscale of magnetometer
+ uint8_t temp_sensitivity;
+ uint16_t humi_sensitivity;
+ uint16_t press_sensitivity;
+ uint16_t magn_sensitivity; // sensitivity per fullscale
+ int16_t temperature;
+ int16_t humidity;
+ int16_t magn_x; // X-magnetic value in LSB
+ int16_t magn_y; // Y-magnetic value in LSB
+ int16_t magn_z; // Z-magnetic value in LSB
uint16_t period;
+ uint32_t pressure;
} __PACKED__ dev_data_t;
typedef struct device_data_wrapper_st {
@@ -86,29 +96,103 @@ void recv_callback(uint8_t *data, uint8_t len)
printf("report_period: %d\n", report_period);
}
+void print_to_screen(sensor_data_t sensor_data)
+{
+ float pressure = sensor_data.sensor_press.pressure*1.0/sensor_data.sensor_press.sensitivity;
+ float altitude = (pow(1013.25/pressure,1.0/5.257) - 1)*((int16_t)sensor_data.sensor_tempnhumi.temperature/10.0+273.15)/0.0065;
+ printf("temperature: %2.2f\n", (int16_t)sensor_data.sensor_tempnhumi.temperature / 10.0);
+ printf("humidity : %2.2f\n", sensor_data.sensor_tempnhumi.humidity / 10.0);
+ printf("pressure : %2.2f,\t altitude: %2.2f\n", pressure, altitude);
+ printf("magn : %2.3f, %2.3f, %2.3f\n",
+ (int16_t)sensor_data.sensor_magn.magn_x*1.0/sensor_data.sensor_magn.sensitivity,
+ (int16_t)sensor_data.sensor_magn.magn_y*1.0/sensor_data.sensor_magn.sensitivity,
+ (int16_t)sensor_data.sensor_magn.magn_z*1.0/sensor_data.sensor_magn.sensitivity);
+}
+
+/**
+ * @brief application entry
+ * @modified by jieranzhi 2020/03/31
+ * @note following javascript code snippet demonstrate how to correctly
+ * decode the data passed to Tencent cloud
+ ****************************** CODE START *****************************
+ function RawToProtocol(fPort, bytes)
+ {
+ var data ={
+ "method": "report",
+ "clientToken": new Date(),
+ "params": {}
+ }
+ var magnFullscale = bytes[0];
+ switch(magnFullscale)
+ {
+ case 0:
+ data.params.magnFullscale = 4;
+ break;
+ case 1:
+ data.params.magnFullscale = 8;
+ break;
+ case 2:
+ data.params.magnFullscale = 12;
+ break;
+ case 3:
+ data.params.magnFullscale = 16;
+ break;
+ }
+ var tempSensitivity = bytes[1];
+ var humiSensitivity = bytes[2] | (bytes[3]<<8);
+ var presSensitivity = bytes[4] | (bytes[5]<<8);
+ var magnSensitivity = bytes[6] | (bytes[7]<<8);
+
+ data.params.temperature = (convertToInt16(bytes[8] | (bytes[9]<<8))*1.0/10).toFixed(2);
+ data.params.humidity = ((bytes[10] | (bytes[11]<<8))*1.0/10).toFixed(2);
+ data.params.magnX = (convertToInt16(bytes[12] | (bytes[13]<<8))*1.0/magnSensitivity).toFixed(2);
+ data.params.magnY = (convertToInt16(bytes[14] | (bytes[15]<<8))*1.0/magnSensitivity).toFixed(2);
+ data.params.magnZ = (convertToInt16(bytes[16] | (bytes[17]<<8))*1.0/magnSensitivity).toFixed(2);
+ data.params.period = bytes[18] | (bytes[19]<<8);
+ data.params.pressure = ((bytes[20] | (bytes[21]<<8) | (bytes[22]<<16) | (bytes[23]<<24))*1.0/presSensitivity).toFixed(2);
+ data.params.altitude = ((Math.pow(1017.92/data.params.pressure,1.0/5.257) - 1)*(data.params.temperature/10.0+273.15)/0.0065).toFixed(2);
+ data.params.fPort = fPort;
+ return data;
+ }
+
+ function convertToInt16(num)
+ {
+ var intNum = num;
+ if ((num & 0x8000) > 0) {
+ intNum = num - 0x10000;
+ }
+ return intNum;
+ }
+ ****************************** CODE END *****************************
+ */
void application_entry(void *arg)
{
- int16_t temperature;
- int16_t humidity;
+ sensor_data_t sensor_data;
- HTS221_Init();
+ // initialization of sensors
+ BSP_Sensor_Init();
rhf76_lora_init(HAL_UART_PORT_1);
tos_lora_module_recvcb_register(recv_callback);
-
- tos_lora_module_join_otaa("8cf957200000fa57", "8cf957200000fa572059aaaaad204a72");
+ tos_lora_module_join_otaa("8cf957200000f53c", "8cf957200000f52c6d09aaaaad205a72");
while (1) {
- HTS221_Get_Temperature(&temperature);
- HTS221_Get_Humidity(&humidity);
-
- printf("temperature: %2.1f\n", temperature / 10.0);
- printf("humidity : %2.1f\n", humidity / 10.0);
-
- dev_data_wrapper.u.dev_data.temperature = temperature / 10;
- dev_data_wrapper.u.dev_data.humidity = humidity / 10;
- dev_data_wrapper.u.dev_data.period = report_period;
-
+ BSP_Sensor_Read(&sensor_data);
+ print_to_screen(sensor_data);
+ // generate data frame
+ dev_data_wrapper.u.dev_data.magn_fullscale = (uint8_t)(sensor_data.sensor_magn.fullscale);
+ dev_data_wrapper.u.dev_data.temp_sensitivity = (uint8_t)(sensor_data.sensor_tempnhumi.temp_sensitivity);
+ dev_data_wrapper.u.dev_data.humi_sensitivity = (uint16_t)(sensor_data.sensor_tempnhumi.humi_sensitivity);
+ dev_data_wrapper.u.dev_data.press_sensitivity = (uint16_t)(sensor_data.sensor_press.sensitivity);
+ dev_data_wrapper.u.dev_data.magn_sensitivity = (uint16_t)(sensor_data.sensor_magn.sensitivity);
+ dev_data_wrapper.u.dev_data.temperature = (int16_t)(sensor_data.sensor_tempnhumi.temperature);
+ dev_data_wrapper.u.dev_data.humidity = (int16_t)(sensor_data.sensor_tempnhumi.humidity);
+ dev_data_wrapper.u.dev_data.magn_x = (int16_t)(sensor_data.sensor_magn.magn_x);
+ dev_data_wrapper.u.dev_data.magn_y = (int16_t)(sensor_data.sensor_magn.magn_y);
+ dev_data_wrapper.u.dev_data.magn_z = (int16_t)(sensor_data.sensor_magn.magn_z);
+ dev_data_wrapper.u.dev_data.pressure = (uint32_t)(sensor_data.sensor_press.pressure);
+ dev_data_wrapper.u.dev_data.period = report_period;
+ // send data to the server (via gateway)
tos_lora_module_send(dev_data_wrapper.u.serialize, sizeof(dev_data_t));
tos_task_delay(report_period * 1000);
}
diff --git a/board/NUCLEO_STM32L073RZ/IAR/hello_world/TencentOS_tiny.ewd b/board/NUCLEO_STM32L073RZ/IAR/hello_world/TencentOS_tiny.ewd
index d77ea578..9fb31acd 100644
--- a/board/NUCLEO_STM32L073RZ/IAR/hello_world/TencentOS_tiny.ewd
+++ b/board/NUCLEO_STM32L073RZ/IAR/hello_world/TencentOS_tiny.ewd
@@ -1,1419 +1,1476 @@
- 3
-
- TencentOS_tiny
-
- ARM
-
- 1
-
- C-SPY
- 2
-
- 29
- 1
- 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ARMSIM_ID
- 2
-
- 1
- 1
- 1
-
-
-
-
-
-
-
- CADI_ID
- 2
-
- 0
- 1
- 1
-
-
-
-
-
-
-
-
- CMSISDAP_ID
- 2
-
- 4
- 1
- 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- GDBSERVER_ID
- 2
-
- 0
- 1
- 1
-
-
-
-
-
-
-
-
-
-
- IJET_ID
- 2
-
- 8
- 1
- 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- JLINK_ID
- 2
-
- 16
- 1
- 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- LMIFTDI_ID
- 2
-
- 2
- 1
- 1
-
-
-
-
-
-
-
-
-
- PEMICRO_ID
- 2
-
- 3
- 1
- 1
-
-
-
-
-
-
-
- STLINK_ID
- 2
-
- 4
- 1
- 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- THIRDPARTY_ID
- 2
-
- 0
- 1
- 1
-
-
-
-
-
-
-
- TIFET_ID
- 2
-
- 1
- 1
- 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- XDS100_ID
- 2
-
- 6
- 1
- 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin
- 0
-
-
- $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin
- 0
-
-
- $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin
- 0
-
-
- $TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin
- 0
-
-
- $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin
- 0
-
-
- $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin
- 0
-
-
- $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin
- 0
-
-
- $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin
- 0
-
-
- $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin
- 0
-
-
- $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin
- 0
-
-
- $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin
- 0
-
-
- $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin
- 1
-
-
- $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin
- 0
-
-
- $EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin
- 0
-
-
- $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin
- 0
-
-
-
+ 3
+
+ TencentOS_tiny
+
+ ARM
+
+ 1
+
+ C-SPY
+ 2
+
+ 30
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ARMSIM_ID
+ 2
+
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ CADI_ID
+ 2
+
+ 0
+ 1
+ 1
+
+
+
+
+
+
+
+
+ CMSISDAP_ID
+ 2
+
+ 4
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GDBSERVER_ID
+ 2
+
+ 0
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+
+ IJET_ID
+ 2
+
+ 8
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JLINK_ID
+ 2
+
+ 16
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ LMIFTDI_ID
+ 2
+
+ 2
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+ NULINK_ID
+ 2
+
+ 0
+ 1
+ 1
+
+
+
+
+
+
+ PEMICRO_ID
+ 2
+
+ 3
+ 1
+ 1
+
+
+
+
+
+
+
+ STLINK_ID
+ 2
+
+ 5
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ THIRDPARTY_ID
+ 2
+
+ 0
+ 1
+ 1
+
+
+
+
+
+
+
+ TIFET_ID
+ 2
+
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ XDS100_ID
+ 2
+
+ 8
+ 1
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\FreeRtos\FreeRtosArmPlugin.ENU.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin.ENU.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\Mbed\MbedArmPlugin2.ENU.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\SMX\smxAwareIarArm8.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\SMX\smxAwareIarArm8BE.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\TI-RTOS\tirtosplugin.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin
+ 0
+
+
+ $TOOLKIT_DIR$\plugins\rtos\uCOS-III\uCOS-III-KA-CSpy.ewplugin
+ 0
+
+
+ $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin
+ 1
+
+
+ $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin
+ 0
+
+
+ $EW_DIR$\common\plugins\TargetAccessServer\TargetAccessServer.ENU.ewplugin
+ 0
+
+
+ $EW_DIR$\common\plugins\uCProbe\uCProbePlugin.ENU.ewplugin
+ 0
+
+
+
diff --git a/board/NUCLEO_STM32L073RZ/IAR/hello_world/TencentOS_tiny.ewp b/board/NUCLEO_STM32L073RZ/IAR/hello_world/TencentOS_tiny.ewp
index b793626e..b77c05a0 100644
--- a/board/NUCLEO_STM32L073RZ/IAR/hello_world/TencentOS_tiny.ewp
+++ b/board/NUCLEO_STM32L073RZ/IAR/hello_world/TencentOS_tiny.ewp
@@ -66,7 +66,7 @@