From d00587f02a3dcb8844589bb1d7f23fa78f0c381d Mon Sep 17 00:00:00 2001 From: mculover666 <2412828003@qq.com> Date: Sat, 18 Dec 2021 00:04:28 +0800 Subject: [PATCH] add wifi_esp8266tc_bh1750 demo on tos_evb_wl board --- .../BSP/Hardware/BH1750/bh1750_i2c_drv.c | 54 + .../BSP/Hardware/BH1750/bh1750_i2c_drv.h | 35 + .../TencentOS_Tiny_EVB_STM32WL/BSP/Inc/i2c.h | 52 + .../BSP/Inc/mcu_init.h | 1 + .../BSP/Inc/stm32wlxx_hal_conf.h | 2 +- .../TencentOS_Tiny_EVB_STM32WL/BSP/Src/i2c.c | 147 ++ .../KEIL/wifi_esp8266tc_bh1750/App/mcu_init.c | 119 ++ .../wifi_esp8266tc_bh1750/App/stm32wlxx_it.c | 261 ++++ .../App/wifi_esp8266tc_bh1750.c | 150 ++ .../TencentOS_Tiny.uvoptx | 1237 +++++++++++++++++ .../TencentOS_Tiny.uvprojx | 848 +++++++++++ .../startup_stm32wle5xx.s | 359 +++++ 12 files changed, 3264 insertions(+), 1 deletion(-) create mode 100644 board/TencentOS_Tiny_EVB_STM32WL/BSP/Hardware/BH1750/bh1750_i2c_drv.c create mode 100644 board/TencentOS_Tiny_EVB_STM32WL/BSP/Hardware/BH1750/bh1750_i2c_drv.h create mode 100644 board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/i2c.h create mode 100644 board/TencentOS_Tiny_EVB_STM32WL/BSP/Src/i2c.c create mode 100644 board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/mcu_init.c create mode 100644 board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/stm32wlxx_it.c create mode 100644 board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/wifi_esp8266tc_bh1750.c create mode 100644 board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/TencentOS_Tiny.uvoptx create mode 100644 board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/TencentOS_Tiny.uvprojx create mode 100644 board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/startup_stm32wle5xx.s diff --git a/board/TencentOS_Tiny_EVB_STM32WL/BSP/Hardware/BH1750/bh1750_i2c_drv.c b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Hardware/BH1750/bh1750_i2c_drv.c new file mode 100644 index 00000000..e6a5264a --- /dev/null +++ b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Hardware/BH1750/bh1750_i2c_drv.c @@ -0,0 +1,54 @@ +/** + * @Copyright (c) 2019,mculover666 All rights reserved + * @filename bh1750_i2c_drv.h + * @breif Drive BH1750 based on iic1 commucation interface + * @version + * v1.0 完成基本驱动程序 mculover666 2019/7/15 + * @note 移植说明(非常重要): + * 1. bh1750_i2c_drv.h文件中的BH1750读写地址即可; + * 2. 此驱动程序需要STM32CubeMX生成的I2C初始化文件i2c.h和i2c.c支持; + * 3. 每次写完指令之后需要延时再读取数据(大于等于该模式的测量时间)。 + */ + +#include "bh1750_i2c_drv.h" +#include "i2c.h" + +static int bh1750_send_cmd(BH1750_MODE cmd) +{ + return HAL_I2C_Master_Transmit(&hi2c2, BH1750_ADDR_WRITE, (uint8_t*)&cmd, 1, 0xFFFF); +} + +static int bh1750_recv_dat(uint8_t* dat) +{ + return HAL_I2C_Master_Receive(&hi2c2, BH1750_ADDR_READ, dat, 2, 0xFFFF); +} + +static uint16_t bh1750_dat2lux(uint8_t* dat) +{ + uint16_t lux = 0; + lux = dat[0]; + lux <<= 8; + lux += dat[1]; + lux = (int)(lux / 1.2); + + return lux; +} + +int bh1750_read_data_once(uint16_t *lux) +{ + uint8_t dat[2] = {0}; + + if (bh1750_send_cmd(ONCE_H_MODE) != HAL_OK) { + return -1; + } + + HAL_Delay(200); + + if (bh1750_recv_dat(dat) != HAL_OK) { + return -1; + } + + *lux = bh1750_dat2lux(dat); + + return 0; +} diff --git a/board/TencentOS_Tiny_EVB_STM32WL/BSP/Hardware/BH1750/bh1750_i2c_drv.h b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Hardware/BH1750/bh1750_i2c_drv.h new file mode 100644 index 00000000..bb6c0631 --- /dev/null +++ b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Hardware/BH1750/bh1750_i2c_drv.h @@ -0,0 +1,35 @@ +/** + * @Copyright (c) 2019,mculover666 All rights reserved + * @filename bh1750_i2c_drv.h + * @breif Drive BH1750 based on iic1 commucation interface + * @version + * v1.0 完成基本驱动程序 mculover666 2019/7/15 + * @note 移植说明(非常重要): + * 1. bh1750_i2c_drv.h文件中的BH1750读写地址即可; + * 2. 此驱动程序需要STM32CubeMX生成的I2C初始化文件i2c.h和i2c.c支持; + * 3. 每次写完指令之后需要延时再读取数据(大于等于该模式的测量时间)。 + */ +#ifndef _BH1750_I2C_DRV_H_ +#define _BH1750_I2C_DRV_H_ + +#include "stm32wlxx_hal.h" + +#define BH1750_ADDR_WRITE 0x46 //01000110 +#define BH1750_ADDR_READ 0x47 //01000111 + +typedef enum +{ + POWER_OFF_CMD = 0x00, //断电:无激活状态 + POWER_ON_CMD = 0x01, //通电:等待测量指令 + RESET_REGISTER = 0x07, //重置数字寄存器(在断电状态下不起作用) + CONT_H_MODE = 0x10, //连续H分辨率模式:在11x分辨率下开始测量,测量时间120ms + CONT_H_MODE2 = 0x11, //连续H分辨率模式2:在0.51x分辨率下开始测量,测量时间120ms + CONT_L_MODE = 0x13, //连续L分辨率模式:在411分辨率下开始测量,测量时间16ms + ONCE_H_MODE = 0x20, //一次高分辨率模式:在11x分辨率下开始测量,测量时间120ms,测量后自动设置为断电模式 + ONCE_H_MODE2 = 0x21, //一次高分辨率模式2:在0.51x分辨率下开始测量,测量时间120ms,测量后自动设置为断电模式 + ONCE_L_MODE = 0x23 //一次低分辨率模式:在411x分辨率下开始测量,测量时间16ms,测量后自动设置为断电模式 +} BH1750_MODE; + +int bh1750_read_data_once(uint16_t *lux); + +#endif /* _AT24C02_I2C_DRV_H_ */ diff --git a/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/i2c.h b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/i2c.h new file mode 100644 index 00000000..74a7ee62 --- /dev/null +++ b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/i2c.h @@ -0,0 +1,52 @@ +/** + ****************************************************************************** + * @file i2c.h + * @brief This file contains all the function prototypes for + * the i2c.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __I2C_H__ +#define __I2C_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern I2C_HandleTypeDef hi2c2; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_I2C2_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __I2C_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/mcu_init.h b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/mcu_init.h index 4c637cff..8a10bd90 100644 --- a/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/mcu_init.h +++ b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/mcu_init.h @@ -7,6 +7,7 @@ #include "main.h" #include "usart.h" #include "gpio.h" +#include "i2c.h" #include "tos_k.h" #include "stdio.h" diff --git a/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/stm32wlxx_hal_conf.h b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/stm32wlxx_hal_conf.h index 96a25727..1a967293 100644 --- a/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/stm32wlxx_hal_conf.h +++ b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Inc/stm32wlxx_hal_conf.h @@ -40,7 +40,7 @@ //#define HAL_DAC_MODULE_ENABLED //#define HAL_GTZC_MODULE_ENABLED //#define HAL_HSEM_MODULE_ENABLED -//#define HAL_I2C_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED //#define HAL_I2S_MODULE_ENABLED //#define HAL_IPCC_MODULE_ENABLED //#define HAL_IRDA_MODULE_ENABLED diff --git a/board/TencentOS_Tiny_EVB_STM32WL/BSP/Src/i2c.c b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Src/i2c.c new file mode 100644 index 00000000..e3fcdca9 --- /dev/null +++ b/board/TencentOS_Tiny_EVB_STM32WL/BSP/Src/i2c.c @@ -0,0 +1,147 @@ +/** + ****************************************************************************** + * @file i2c.c + * @brief This file provides code for the configuration + * of the I2C instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "i2c.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +I2C_HandleTypeDef hi2c2; + +/* I2C2 init function */ +void MX_I2C2_Init(void) +{ + + /* USER CODE BEGIN I2C2_Init 0 */ + + /* USER CODE END I2C2_Init 0 */ + + /* USER CODE BEGIN I2C2_Init 1 */ + + /* USER CODE END I2C2_Init 1 */ + hi2c2.Instance = I2C2; + hi2c2.Init.Timing = 0x20303E5D; + hi2c2.Init.OwnAddress1 = 0; + hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; + hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; + hi2c2.Init.OwnAddress2 = 0; + hi2c2.Init.OwnAddress2Masks = I2C_OA2_NOMASK; + hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; + hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; + if (HAL_I2C_Init(&hi2c2) != HAL_OK) + { + Error_Handler(); + } + /** Configure Analogue filter + */ + if (HAL_I2CEx_ConfigAnalogFilter(&hi2c2, I2C_ANALOGFILTER_ENABLE) != HAL_OK) + { + Error_Handler(); + } + /** Configure Digital filter + */ + if (HAL_I2CEx_ConfigDigitalFilter(&hi2c2, 0) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN I2C2_Init 2 */ + + /* USER CODE END I2C2_Init 2 */ + +} + +void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; + if(i2cHandle->Instance==I2C2) + { + /* USER CODE BEGIN I2C2_MspInit 0 */ + + /* USER CODE END I2C2_MspInit 0 */ + /** Initializes the peripherals clocks + */ + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2C2; + PeriphClkInitStruct.I2c2ClockSelection = RCC_I2C2CLKSOURCE_PCLK1; + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) + { + Error_Handler(); + } + + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**I2C2 GPIO Configuration + PA15 ------> I2C2_SDA + PB15 ------> I2C2_SCL + */ + GPIO_InitStruct.Pin = GPIO_PIN_15; + GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF4_I2C2; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_15; + GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF4_I2C2; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* I2C2 clock enable */ + __HAL_RCC_I2C2_CLK_ENABLE(); + /* USER CODE BEGIN I2C2_MspInit 1 */ + + /* USER CODE END I2C2_MspInit 1 */ + } +} + +void HAL_I2C_MspDeInit(I2C_HandleTypeDef* i2cHandle) +{ + + if(i2cHandle->Instance==I2C2) + { + /* USER CODE BEGIN I2C2_MspDeInit 0 */ + + /* USER CODE END I2C2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_I2C2_CLK_DISABLE(); + + /**I2C2 GPIO Configuration + PA15 ------> I2C2_SDA + PB15 ------> I2C2_SCL + */ + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_15); + + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_15); + + /* USER CODE BEGIN I2C2_MspDeInit 1 */ + + /* USER CODE END I2C2_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/mcu_init.c b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/mcu_init.c new file mode 100644 index 00000000..c9fc9f23 --- /dev/null +++ b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/mcu_init.c @@ -0,0 +1,119 @@ +#include "mcu_init.h" + +int fputc(int ch, FILE *f) +{ + if (ch == '\n') { + HAL_UART_Transmit(&huart1, (void *)"\r", 1, 30000); + } + HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF); + return ch; + +} + +int _write(int fd, char *ptr, int len) +{ + (void)HAL_UART_Transmit(&huart1, (uint8_t *)ptr, len, 0xFFFF); + return len; +} + +int fgetc(FILE *f) +{ + /* Place your implementation of fgetc here */ + /* e.g. readwrite a character to the USART2 and Loop until the end of transmission */ + uint8_t ch = 0; + HAL_UART_Receive(&huart1, &ch, 1,30000); + return ch; +} + +void board_init(void) +{ + HAL_Init(); + SystemClock_Config(); + MX_GPIO_Init(); + MX_USART1_UART_Init(); + MX_I2C2_Init(); +} + +/** + * @brief System Clock Configuration + * @retval None + */ +void SystemClock_Config(void) +{ + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + + /** Initializes the CPU, AHB and APB busses clocks + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.LSEState = RCC_LSE_OFF; + RCC_OscInitStruct.HSICalibrationValue = 70; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV2; + RCC_OscInitStruct.PLL.PLLN = 30; + RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV5; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV5; + RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV5; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + { + Error_Handler(); + } + + /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers + */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2 | RCC_CLOCKTYPE_HCLK3); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) + { + Error_Handler(); + } +} + + +/* USER CODE BEGIN 4 */ + +/* USER CODE END 4 */ + +/** + * @brief This function is executed in case of error occurrence. + * @retval None + */ +void Error_Handler(void) +{ + /* USER CODE BEGIN Error_Handler_Debug */ + /* User can add his own implementation to report the HAL error return state */ + while(1) + { + } + /* USER CODE END Error_Handler_Debug */ +} + +#ifdef USE_FULL_ASSERT +/** + * @brief Reports the name of the source file and the source line number + * where the assert_param error has occurred. + * @param file: pointer to the source file name + * @param line: assert_param error line source number + * @retval None + */ +void assert_failed(uint8_t *file, uint32_t line) +{ + /* USER CODE BEGIN 6 */ + /* User can add his own implementation to report the file name and line number, + ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ + /* Infinite loop */ + while (1) + { + } + + /* USER CODE END 6 */ +} +#endif /* USE_FULL_ASSERT */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/stm32wlxx_it.c b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/stm32wlxx_it.c new file mode 100644 index 00000000..9b4afc56 --- /dev/null +++ b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/stm32wlxx_it.c @@ -0,0 +1,261 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file Templates/Src/stm32wlxx_it.c + * @author MCD Application Team + * @brief Main Interrupt Service Routines. + * This file provides template for all exceptions handler and + * peripherals interrupt service routine. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "stm32wlxx_it.h" +#include "tos_k.h" +#include "tos_at.h" +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Private user code ---------------------------------------------------------*/ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* External variables --------------------------------------------------------*/ +extern UART_HandleTypeDef huart1; +extern UART_HandleTypeDef huart2; +extern UART_HandleTypeDef hlpuart1; +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/******************************************************************************/ +/* Cortex Processor Interruption and Exception Handlers */ +/******************************************************************************/ +/** + * @brief This function handles Non maskable interrupt. + */ +void NMI_Handler(void) +{ + /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ + + /* USER CODE END NonMaskableInt_IRQn 0 */ + /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ + + /* USER CODE END NonMaskableInt_IRQn 1 */ +} + +/** + * @brief This function handles Hard fault interrupt. + */ +void HardFault_Handler(void) +{ + /* USER CODE BEGIN HardFault_IRQn 0 */ + + /* USER CODE END HardFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_HardFault_IRQn 0 */ + /* USER CODE END W1_HardFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Memory management fault. + */ +void MemManage_Handler(void) +{ + /* USER CODE BEGIN MemoryManagement_IRQn 0 */ + + /* USER CODE END MemoryManagement_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ + /* USER CODE END W1_MemoryManagement_IRQn 0 */ + } +} + +/** + * @brief This function handles Prefetch fault, memory access fault. + */ +void BusFault_Handler(void) +{ + /* USER CODE BEGIN BusFault_IRQn 0 */ + + /* USER CODE END BusFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_BusFault_IRQn 0 */ + /* USER CODE END W1_BusFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Undefined instruction or illegal state. + */ +void UsageFault_Handler(void) +{ + /* USER CODE BEGIN UsageFault_IRQn 0 */ + + /* USER CODE END UsageFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ + /* USER CODE END W1_UsageFault_IRQn 0 */ + } +} + +/** + * @brief This function handles System service call via SWI instruction. + */ +void SVC_Handler(void) +{ + /* USER CODE BEGIN SVCall_IRQn 0 */ + + /* USER CODE END SVCall_IRQn 0 */ + /* USER CODE BEGIN SVCall_IRQn 1 */ + + /* USER CODE END SVCall_IRQn 1 */ +} + +/** + * @brief This function handles Debug monitor. + */ +void DebugMon_Handler(void) +{ + /* USER CODE BEGIN DebugMonitor_IRQn 0 */ + + /* USER CODE END DebugMonitor_IRQn 0 */ + /* USER CODE BEGIN DebugMonitor_IRQn 1 */ + + /* USER CODE END DebugMonitor_IRQn 1 */ +} + +/** + * @brief This function handles Pendable request for system service. + */ +__weak void PendSV_Handler(void) +{ + /* USER CODE BEGIN PendSV_IRQn 0 */ + + /* USER CODE END PendSV_IRQn 0 */ + /* USER CODE BEGIN PendSV_IRQn 1 */ + + /* USER CODE END PendSV_IRQn 1 */ +} + +/** + * @brief This function handles System tick timer. + */ +void SysTick_Handler(void) +{ + /* USER CODE BEGIN SysTick_IRQn 0 */ + + /* USER CODE END SysTick_IRQn 0 */ + HAL_IncTick(); + if (tos_knl_is_running()) + { + tos_knl_irq_enter(); + tos_tick_handler(); + tos_knl_irq_leave(); + } + /* USER CODE BEGIN SysTick_IRQn 1 */ + + /* USER CODE END SysTick_IRQn 1 */ +} + +/******************************************************************************/ +/* STM32WLxx Peripheral Interrupt Handlers */ +/* Add here the Interrupt Handlers for the used peripherals. */ +/* For the available peripheral interrupt handler names, */ +/* please refer to the startup file (startup_stm32wlxx.s). */ +/******************************************************************************/ +void LPUART1_IRQHandler(void) +{ + /* USER CODE BEGIN LPUART1_IRQn 0 */ + + /* USER CODE END LPUART1_IRQn 0 */ + tos_knl_irq_enter(); + HAL_UART_IRQHandler(&hlpuart1); + tos_knl_irq_leave(); + /* USER CODE BEGIN LPUART1_IRQn 1 */ + + /* USER CODE END LPUART1_IRQn 1 */ +} +void USART1_IRQHandler(void) +{ + /* USER CODE BEGIN USART1_IRQn 0 */ + + /* USER CODE END USART1_IRQn 0 */ + HAL_UART_IRQHandler(&huart1); + /* USER CODE BEGIN USART2_IRQn 1 */ + + /* USER CODE END USART2_IRQn 1 */ +} + +void USART2_IRQHandler(void) +{ + /* USER CODE BEGIN LPUART1_IRQn 0 */ + + /* USER CODE END LPUART1_IRQn 0 */ + tos_knl_irq_enter(); + HAL_UART_IRQHandler(&huart2); + tos_knl_irq_leave(); + /* USER CODE BEGIN LPUART1_IRQn 1 */ + + /* USER CODE END LPUART1_IRQn 1 */ +} + + +/* USER CODE BEGIN 1 */ +void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) +{ + extern uint8_t pm2d5_byte_data; + extern uint8_t data; + + if (huart->Instance == LPUART1) { + HAL_UART_Receive_IT(&hlpuart1, &data, 1); + tos_at_uart_input_byte(data); + } +} +/* USER CODE END 1 */ +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/wifi_esp8266tc_bh1750.c b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/wifi_esp8266tc_bh1750.c new file mode 100644 index 00000000..85a24190 --- /dev/null +++ b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/App/wifi_esp8266tc_bh1750.c @@ -0,0 +1,150 @@ +#include "bh1750_i2c_drv.h" +#include "tos_k.h" +#include "esp8266_tencent_firmware.h" +#include "tencent_firmware_module_wrapper.h" +#include "math.h" + +#define USE_WIFI + +#define WIFI_SSID "Mculover666" +#define WIFI_PASSWD "mculover666" +#define PRODUCT_ID "4MBSKQWDO9" +#define DEVICE_NAME "TOS_EVB_WL" +#define DEVICE_KEY "C9s+2U3B7uXrzngyXggsyA==" + +#define REPORT_DATA_TEMPLATE "{\"method\":\"report\",\"clientToken\":\"%s\",\"params\":{\"lux\":%d}}" + +void default_message_handler(mqtt_message_t* msg) +{ + printf("callback:\r\n"); + printf("---------------------------------------------------------\r\n"); + printf("\ttopic:%s\r\n", msg->topic); + printf("\tpayload:%s\r\n", msg->payload); + printf("---------------------------------------------------------\r\n"); +} + +char payload[1024] = {0}; +static char report_topic_name[TOPIC_NAME_MAX_SIZE] = {0}; +static char report_reply_topic_name[TOPIC_NAME_MAX_SIZE] = {0}; + +void generate_client_token(char* buffer, size_t size) +{ + long client_token_value; + + memset(buffer, 0, size); + client_token_value = ((long)tos_systick_get()) % (long)(pow(10, size)); + snprintf(buffer, size, "%ld", client_token_value); +} + +void mqtt_demo_task(void) +{ + int ret = 0; + int size = 0; + int i = 0; + char *product_id = PRODUCT_ID; + char *device_name = DEVICE_NAME; + char *key = DEVICE_KEY; + + device_info_t dev_info; + memset(&dev_info, 0, sizeof(device_info_t)); + char str[16]; + uint8_t report_error_count = 0; + char client_token[10]; + uint16_t lux; + + /** + * Please Choose your AT Port first, default is HAL_UART_2(USART2) + */ + ret = esp8266_tencent_firmware_sal_init(HAL_UART_PORT_0); + + if (ret < 0) { + printf("esp8266 tencent firmware sal init fail, ret is %d\r\n", ret); + return; + } + + while (1) { + if ( esp8266_tencent_firmware_join_ap(WIFI_SSID, WIFI_PASSWD) == 0) { + printf("module WIFI connect success\n"); + break; + } + printf("module WIFI connect fail\n"); + tos_sleep_ms(2000); + } + + strncpy(dev_info.product_id, product_id, PRODUCT_ID_MAX_SIZE); + strncpy(dev_info.device_name, device_name, DEVICE_NAME_MAX_SIZE); + strncpy(dev_info.device_serc, key, DEVICE_SERC_MAX_SIZE); + tos_tf_module_info_set(&dev_info, TLS_MODE_PSK); + mqtt_param_t init_params = DEFAULT_MQTT_PARAMS; + while (1) { + if (tos_tf_module_mqtt_conn(init_params) == 0) { + printf("module mqtt connect success\n"); + break; + } + printf("module mqtt connect fail\n"); + tos_sleep_ms(5000); + } + + /* 开始订阅topic */ + size = snprintf(report_reply_topic_name, TOPIC_NAME_MAX_SIZE, "$thing/down/property/%s/%s", product_id, device_name); + + if (size < 0 || size > sizeof(report_reply_topic_name) - 1) { + printf("sub topic content length not enough! content size:%d buf size:%d", size, (int)sizeof(report_reply_topic_name)); + } + if (tos_tf_module_mqtt_sub(report_reply_topic_name, QOS0, default_message_handler) != 0) { + printf("module mqtt sub fail\n"); + } else { + printf("module mqtt sub success\n"); + } + + memset(report_topic_name, 0, sizeof(report_topic_name)); + size = snprintf(report_topic_name, TOPIC_NAME_MAX_SIZE, "$thing/up/property/%s/%s", product_id, device_name); + + if (size < 0 || size > sizeof(report_topic_name) - 1) { + printf("pub topic content length not enough! content size:%d buf size:%d", size, (int)sizeof(report_topic_name)); + } + + while (1) { + // 读取传感器数据 + if (bh1750_read_data_once(&lux) != 0) { + printf("bh1750 read fail\r\n"); + tos_sleep_ms(5000); + continue; + } + + // 收到之后打印信息 + printf("lux[%d]\r\n", lux); + + // 上报值 + generate_client_token(client_token, sizeof(client_token)); + memset(payload, 0, 1024); + snprintf(payload, 1024, REPORT_DATA_TEMPLATE, client_token, lux); + + if (tos_tf_module_mqtt_publ(report_topic_name, QOS0, payload) != 0) { + report_error_count++; + printf("module mqtt publ fail, count: %d\n", report_error_count); + sprintf(str, "# report fail"); + } else { + report_error_count = 0; + printf("module mqtt publ success\n"); + sprintf(str, "# report ok"); + } + + if (report_error_count >= 6) { + HAL_NVIC_SystemReset(); + } + + tos_sleep_ms(5000); + + } +} + +void application_entry(void *arg) +{ + mqtt_demo_task(); + while (1) { + printf("This is a mqtt demo!\r\n"); + tos_task_delay(1000); + } + +} diff --git a/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/TencentOS_Tiny.uvoptx b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/TencentOS_Tiny.uvoptx new file mode 100644 index 00000000..a09d6e86 --- /dev/null +++ b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/TencentOS_Tiny.uvoptx @@ -0,0 +1,1237 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + TencentOS_Tiny + 0x4 + ARM-ADS + + 12000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\List\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 18 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 6 + + + + + + + + + + + STLink\ST-LINKIII-KEIL_SWO.dll + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 ) -FN1 -FC1000 -FD20000000 -FF0STM32WLxx_CM4 -FL040000 -FS08000000 -FP0($$Device:STM32WLE5JCIx$CMSIS\Flash\STM32WLxx_CM4.FLM) + + + 0 + ST-LINKIII-KEIL_SWO + -U57FF6C065071505513331287 -O206 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(6BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO31 -FD20000000 -FC1000 -FN1 -FF0STM32WLxx_CM4.FLM -FS08000000 -FL040000 -FP0($$Device:STM32WLE5JCIx$CMSIS\Flash\STM32WLxx_CM4.FLM) + + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + (105=-1,-1,-1,-1,0) + + + + + 0 + 0 + 153 + 1 +
134218060
+ 0 + 0 + 0 + 0 + 0 + 1 + .\startup_stm32wle5xx.s + + \\TencentOS_Tiny\startup_stm32wle5xx.s\153 +
+ + 1 + 0 + 122 + 0 +
134279228
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\..\..\..\kernel\core\tos_task.c + + \\TencentOS_Tiny\../../../../kernel/core/tos_task.c\122 +
+
+ + + 0 + 1 + task + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + +
+
+ + + Application/MDK-ARM + 0 + 0 + 0 + 0 + + 1 + 1 + 2 + 0 + 0 + 0 + .\startup_stm32wle5xx.s + startup_stm32wle5xx.s + 0 + 0 + + + + + Application/User + 1 + 0 + 0 + 0 + + 2 + 2 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\main.c + main.c + 0 + 0 + + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\adc.c + adc.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\dma.c + dma.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\gpio.c + gpio.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\rtc.c + rtc.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32wlxx_hal_msp.c + stm32wlxx_hal_msp.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\usart.c + usart.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + .\App\mcu_init.c + mcu_init.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + .\App\stm32wlxx_it.c + stm32wlxx_it.c + 0 + 0 + + + 2 + 11 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\i2c.c + i2c.c + 0 + 0 + + + + + Drivers/STM32WLxx_HAL_Driver + 0 + 0 + 0 + 0 + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal.c + stm32wlxx_hal.c + 0 + 0 + + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_cortex.c + stm32wlxx_hal_cortex.c + 0 + 0 + + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_dma.c + stm32wlxx_hal_dma.c + 0 + 0 + + + 3 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_dma_ex.c + stm32wlxx_hal_dma_ex.c + 0 + 0 + + + 3 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_exti.c + stm32wlxx_hal_exti.c + 0 + 0 + + + 3 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_flash.c + stm32wlxx_hal_flash.c + 0 + 0 + + + 3 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_flash_ex.c + stm32wlxx_hal_flash_ex.c + 0 + 0 + + + 3 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_gpio.c + stm32wlxx_hal_gpio.c + 0 + 0 + + + 3 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_pwr.c + stm32wlxx_hal_pwr.c + 0 + 0 + + + 3 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_pwr_ex.c + stm32wlxx_hal_pwr_ex.c + 0 + 0 + + + 3 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_rcc.c + stm32wlxx_hal_rcc.c + 0 + 0 + + + 3 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_rcc_ex.c + stm32wlxx_hal_rcc_ex.c + 0 + 0 + + + 3 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_tim.c + stm32wlxx_hal_tim.c + 0 + 0 + + + 3 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_tim_ex.c + stm32wlxx_hal_tim_ex.c + 0 + 0 + + + 3 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_uart.c + stm32wlxx_hal_uart.c + 0 + 0 + + + 3 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_uart_ex.c + stm32wlxx_hal_uart_ex.c + 0 + 0 + + + 3 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_adc.c + stm32wlxx_hal_adc.c + 0 + 0 + + + 3 + 29 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_adc_ex.c + stm32wlxx_hal_adc_ex.c + 0 + 0 + + + 3 + 30 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_rtc.c + stm32wlxx_hal_rtc.c + 0 + 0 + + + 3 + 31 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_rtc_ex.c + stm32wlxx_hal_rtc_ex.c + 0 + 0 + + + 3 + 32 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_subghz.c + stm32wlxx_hal_subghz.c + 0 + 0 + + + 3 + 33 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_i2c.c + stm32wlxx_hal_i2c.c + 0 + 0 + + + 3 + 34 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_i2c_ex.c + stm32wlxx_hal_i2c_ex.c + 0 + 0 + + + + + Drivers/CMSIS + 0 + 0 + 0 + 0 + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\system_stm32wlxx.c + system_stm32wlxx.c + 0 + 0 + + + + + tos/arch + 0 + 0 + 0 + 0 + + 5 + 36 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + tos_cpu.c + 0 + 0 + + + 5 + 37 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + port_c.c + 0 + 0 + + + 5 + 38 + 2 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + port_s.S + 0 + 0 + + + + + tos/kernel + 0 + 0 + 0 + 0 + + 6 + 39 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_barrier.c + tos_barrier.c + 0 + 0 + + + 6 + 40 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_binary_heap.c + tos_binary_heap.c + 0 + 0 + + + 6 + 41 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_bitmap.c + tos_bitmap.c + 0 + 0 + + + 6 + 42 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_char_fifo.c + tos_char_fifo.c + 0 + 0 + + + 6 + 43 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_completion.c + tos_completion.c + 0 + 0 + + + 6 + 44 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_countdownlatch.c + tos_countdownlatch.c + 0 + 0 + + + 6 + 45 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_event.c + tos_event.c + 0 + 0 + + + 6 + 46 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_global.c + tos_global.c + 0 + 0 + + + 6 + 47 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mail_queue.c + tos_mail_queue.c + 0 + 0 + + + 6 + 48 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_message_queue.c + tos_message_queue.c + 0 + 0 + + + 6 + 49 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmblk.c + tos_mmblk.c + 0 + 0 + + + 6 + 50 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmheap.c + tos_mmheap.c + 0 + 0 + + + 6 + 51 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mutex.c + tos_mutex.c + 0 + 0 + + + 6 + 52 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_pend.c + tos_pend.c + 0 + 0 + + + 6 + 53 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + tos_priority_mail_queue.c + 0 + 0 + + + 6 + 54 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + tos_priority_message_queue.c + 0 + 0 + + + 6 + 55 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_queue.c + tos_priority_queue.c + 0 + 0 + + + 6 + 56 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_ring_queue.c + tos_ring_queue.c + 0 + 0 + + + 6 + 57 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_robin.c + tos_robin.c + 0 + 0 + + + 6 + 58 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_rwlock.c + tos_rwlock.c + 0 + 0 + + + 6 + 59 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sched.c + tos_sched.c + 0 + 0 + + + 6 + 60 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sem.c + tos_sem.c + 0 + 0 + + + 6 + 61 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_stopwatch.c + tos_stopwatch.c + 0 + 0 + + + 6 + 62 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sys.c + tos_sys.c + 0 + 0 + + + 6 + 63 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_task.c + tos_task.c + 0 + 0 + + + 6 + 64 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_tick.c + tos_tick.c + 0 + 0 + + + 6 + 65 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_time.c + tos_time.c + 0 + 0 + + + 6 + 66 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_timer.c + tos_timer.c + 0 + 0 + + + + + tos/cmsis + 0 + 0 + 0 + 0 + + 7 + 67 + 1 + 0 + 0 + 0 + ..\..\..\..\osal\cmsis_os\cmsis_os.c + cmsis_os.c + 0 + 0 + + + + + TOS-CONFIG + 0 + 0 + 0 + 0 + + 8 + 68 + 5 + 0 + 0 + 0 + ..\..\TOS_CONFIG\tos_config.h + tos_config.h + 0 + 0 + + + + + Hardware + 1 + 0 + 0 + 0 + + 9 + 69 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\BH1750\bh1750_i2c_drv.c + bh1750_i2c_drv.c + 0 + 0 + + + + + application + 1 + 0 + 0 + 0 + + 10 + 70 + 1 + 0 + 0 + 0 + .\App\wifi_esp8266tc_bh1750.c + wifi_esp8266tc_bh1750.c + 0 + 0 + + + + + at + 1 + 0 + 0 + 0 + + 11 + 71 + 1 + 0 + 0 + 0 + ..\..\..\..\net\at\src\tos_at.c + tos_at.c + 0 + 0 + + + 11 + 72 + 1 + 0 + 0 + 0 + ..\..\..\..\net\tencent_firmware_module_wrapper\tencent_firmware_module_wrapper.c + tencent_firmware_module_wrapper.c + 0 + 0 + + + + + hal + 1 + 0 + 0 + 0 + + 12 + 73 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\hal\st\stm32wl\src\tos_hal_uart.c + tos_hal_uart.c + 0 + 0 + + + + + devices + 1 + 0 + 0 + 0 + + 13 + 74 + 1 + 0 + 0 + 0 + ..\..\..\..\devices\esp8266_tencent_firmware\esp8266_tencent_firmware.c + esp8266_tencent_firmware.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/TencentOS_Tiny.uvprojx b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/TencentOS_Tiny.uvprojx new file mode 100644 index 00000000..feb01bee --- /dev/null +++ b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/TencentOS_Tiny.uvprojx @@ -0,0 +1,848 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + TencentOS_Tiny + 0x4 + ARM-ADS + 6160000::V6.16::ARMCLANG + 1 + + + STM32WLE5JCIx + STMicroelectronics + Keil.STM32WLxx_DFP.1.1.0 + http://www.keil.com/pack/ + IRAM(0x20000000,0x10000) IROM(0x08000000,0x40000) CPUTYPE("Cortex-M4") CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32WLxx_CM4 -FS08000000 -FL040000 -FP0($$Device:STM32WLE5JCIx$CMSIS\Flash\STM32WLxx_CM4.FLM)) + 0 + $$Device:STM32WLE5JCIx$Drivers\Device\ST\STM32WLxx\Include\stm32wlxx.h + + + + + + + + + + $$Device:STM32WLE5JCIx$CMSIS\SVD\STM32WLE5_CM4.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\Obj\ + TencentOS_Tiny + 1 + 0 + 1 + 1 + 1 + .\List\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 0 + + + SARMCM3.DLL + -REMAP -MPU + DCM.DLL + -pCM4 + SARMCM3.DLL + -MPU + TCM.DLL + -pCM4 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4107 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M4" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 7 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 3 + 0 + 0 + 1 + 0 + 0 + 3 + 3 + 1 + 1 + 0 + 0 + 0 + + + USE_HAL_DRIVER,STM32WLE5xx,CORE_CM4 + + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Inc\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32WLxx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\..\..\kernel\core\include;..\..\..\..\kernel\pm\include;..\..\..\..\kernel\hal\include;..\..\..\..\osal\cmsis_os;..\..\TOS_CONFIG;..\..\BSP\Inc;..\..\..\..\net\at\include;..\..\..\..\net\tencent_firmware_module_wrapper;..\..\..\..\devices\esp8266_tencent_firmware;..\..\BSP\Hardware\BH1750 + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 4 + + + + + + + + + 0 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + --diag_suppress L6314W + + + + + + + + Application/MDK-ARM + + + startup_stm32wle5xx.s + 2 + .\startup_stm32wle5xx.s + + + + + Application/User + + + main.c + 1 + ..\..\BSP\Src\main.c + + + adc.c + 1 + ..\..\BSP\Src\adc.c + + + dma.c + 1 + ..\..\BSP\Src\dma.c + + + gpio.c + 1 + ..\..\BSP\Src\gpio.c + + + rtc.c + 1 + ..\..\BSP\Src\rtc.c + + + stm32wlxx_hal_msp.c + 1 + ..\..\BSP\Src\stm32wlxx_hal_msp.c + + + usart.c + 1 + ..\..\BSP\Src\usart.c + + + mcu_init.c + 1 + .\App\mcu_init.c + + + stm32wlxx_it.c + 1 + .\App\stm32wlxx_it.c + + + i2c.c + 1 + ..\..\BSP\Src\i2c.c + + + + + Drivers/STM32WLxx_HAL_Driver + + + stm32wlxx_hal.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal.c + + + stm32wlxx_hal_cortex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_cortex.c + + + stm32wlxx_hal_dma.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_dma.c + + + stm32wlxx_hal_dma_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_dma_ex.c + + + stm32wlxx_hal_exti.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_exti.c + + + stm32wlxx_hal_flash.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_flash.c + + + stm32wlxx_hal_flash_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_flash_ex.c + + + stm32wlxx_hal_gpio.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_gpio.c + + + stm32wlxx_hal_pwr.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_pwr.c + + + stm32wlxx_hal_pwr_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_pwr_ex.c + + + stm32wlxx_hal_rcc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_rcc.c + + + stm32wlxx_hal_rcc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_rcc_ex.c + + + stm32wlxx_hal_tim.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_tim.c + + + stm32wlxx_hal_tim_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_tim_ex.c + + + stm32wlxx_hal_uart.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_uart.c + + + stm32wlxx_hal_uart_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_uart_ex.c + + + stm32wlxx_hal_adc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_adc.c + + + stm32wlxx_hal_adc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_adc_ex.c + + + stm32wlxx_hal_rtc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_rtc.c + + + stm32wlxx_hal_rtc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_rtc_ex.c + + + stm32wlxx_hal_subghz.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_subghz.c + + + stm32wlxx_hal_i2c.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_i2c.c + + + stm32wlxx_hal_i2c_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32WLxx_HAL_Driver\Src\stm32wlxx_hal_i2c_ex.c + + + + + Drivers/CMSIS + + + system_stm32wlxx.c + 1 + ..\..\BSP\Src\system_stm32wlxx.c + + + + + tos/arch + + + tos_cpu.c + 1 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + + + port_c.c + 1 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + + + port_s.S + 2 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + + + + + tos/kernel + + + tos_barrier.c + 1 + ..\..\..\..\kernel\core\tos_barrier.c + + + tos_binary_heap.c + 1 + ..\..\..\..\kernel\core\tos_binary_heap.c + + + tos_bitmap.c + 1 + ..\..\..\..\kernel\core\tos_bitmap.c + + + tos_char_fifo.c + 1 + ..\..\..\..\kernel\core\tos_char_fifo.c + + + tos_completion.c + 1 + ..\..\..\..\kernel\core\tos_completion.c + + + tos_countdownlatch.c + 1 + ..\..\..\..\kernel\core\tos_countdownlatch.c + + + tos_event.c + 1 + ..\..\..\..\kernel\core\tos_event.c + + + tos_global.c + 1 + ..\..\..\..\kernel\core\tos_global.c + + + tos_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_mail_queue.c + + + tos_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_message_queue.c + + + tos_mmblk.c + 1 + ..\..\..\..\kernel\core\tos_mmblk.c + + + tos_mmheap.c + 1 + ..\..\..\..\kernel\core\tos_mmheap.c + + + tos_mutex.c + 1 + ..\..\..\..\kernel\core\tos_mutex.c + + + tos_pend.c + 1 + ..\..\..\..\kernel\core\tos_pend.c + + + tos_priority_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + + + tos_priority_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + + + tos_priority_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_queue.c + + + tos_ring_queue.c + 1 + ..\..\..\..\kernel\core\tos_ring_queue.c + + + tos_robin.c + 1 + ..\..\..\..\kernel\core\tos_robin.c + + + tos_rwlock.c + 1 + ..\..\..\..\kernel\core\tos_rwlock.c + + + tos_sched.c + 1 + ..\..\..\..\kernel\core\tos_sched.c + + + tos_sem.c + 1 + ..\..\..\..\kernel\core\tos_sem.c + + + tos_stopwatch.c + 1 + ..\..\..\..\kernel\core\tos_stopwatch.c + + + tos_sys.c + 1 + ..\..\..\..\kernel\core\tos_sys.c + + + tos_task.c + 1 + ..\..\..\..\kernel\core\tos_task.c + + + tos_tick.c + 1 + ..\..\..\..\kernel\core\tos_tick.c + + + tos_time.c + 1 + ..\..\..\..\kernel\core\tos_time.c + + + tos_timer.c + 1 + ..\..\..\..\kernel\core\tos_timer.c + + + + + tos/cmsis + + + cmsis_os.c + 1 + ..\..\..\..\osal\cmsis_os\cmsis_os.c + + + + + TOS-CONFIG + + + tos_config.h + 5 + ..\..\TOS_CONFIG\tos_config.h + + + + + Hardware + + + bh1750_i2c_drv.c + 1 + ..\..\BSP\Hardware\BH1750\bh1750_i2c_drv.c + + + + + application + + + wifi_esp8266tc_bh1750.c + 1 + .\App\wifi_esp8266tc_bh1750.c + + + + + at + + + tos_at.c + 1 + ..\..\..\..\net\at\src\tos_at.c + + + tencent_firmware_module_wrapper.c + 1 + ..\..\..\..\net\tencent_firmware_module_wrapper\tencent_firmware_module_wrapper.c + + + + + hal + + + tos_hal_uart.c + 1 + ..\..\..\..\platform\hal\st\stm32wl\src\tos_hal_uart.c + + + + + devices + + + esp8266_tencent_firmware.c + 1 + ..\..\..\..\devices\esp8266_tencent_firmware\esp8266_tencent_firmware.c + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + + + + + TencentOS_Tiny + 0 + 1 + + + + +
diff --git a/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/startup_stm32wle5xx.s b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/startup_stm32wle5xx.s new file mode 100644 index 00000000..7f965b48 --- /dev/null +++ b/board/TencentOS_Tiny_EVB_STM32WL/KEIL/wifi_esp8266tc_bh1750/startup_stm32wle5xx.s @@ -0,0 +1,359 @@ +;****************************************************************************** +;* File Name : startup_stm32wle5xx_cm4.s +;* Author : MCD Application Team +;* Description : STM32WLE5xx devices vector table for MDK-ARM toolchain. +;* This module performs: +;* - Set the initial SP +;* - Set the initial PC == Reset_Handler +;* - Set the vector table entries with the exceptions ISR address +;* - Branches to __main in the C library (which eventually +;* calls main()). +;* After Reset the CortexM4 processor is in Thread mode, +;* priority is Privileged, and the Stack is set to Main. +;* <<< Use Configuration Wizard in Context Menu >>> +;****************************************************************************** +;* @attention +;* +;* Copyright (c) 2019 STMicroelectronics. All rights reserved. +;* +;* This software component is licensed by ST under BSD 3-Clause license, +;* the "License"; You may not use this file except in compliance with the +;* License. You may obtain a copy of the License at: +;* opensource.org/licenses/BSD-3-Clause +;* +;****************************************************************************** + +; Amount of memory (in bytes) allocated for Stack +; Tailor this value to your application needs +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x00000800 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x00000200 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD WWDG_IRQHandler ; Window WatchDog + DCD PVD_PVM_IRQHandler ; PVD and PVM detector + DCD TAMP_STAMP_LSECSS_SSRU_IRQHandler ; RTC Tamper, RTC TimeStamp, LSECSS and RTC SSR Underflow Interrupts + DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt + DCD FLASH_IRQHandler ; FLASH global Interrupt + DCD RCC_IRQHandler ; RCC Interrupt + DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt + DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt + DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt + DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup + DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt + DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt + DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt + DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt + DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt + DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt + DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt + DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt + DCD ADC1_IRQHandler ; ADC1 Interrupt + DCD DAC_IRQHandler ; DAC Interrupt + DCD 0 ; Reserved + DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts + DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt + DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt + DCD TIM1_UP_IRQHandler ; TIM1 Update Interrupts + DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Communication Interrupts + DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt + DCD TIM2_IRQHandler ; TIM2 Global Interrupt + DCD TIM16_IRQHandler ; TIM16 Global Interrupt + DCD TIM17_IRQHandler ; TIM17 Global Interrupt + DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt + DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt + DCD I2C2_EV_IRQHandler ; I2C2 Event Interrupt + DCD I2C2_ER_IRQHandler ; I2C2 Error Interrupt + DCD SPI1_IRQHandler ; SPI1 Interrupt + DCD SPI2_IRQHandler ; SPI2 Interrupt + DCD USART1_IRQHandler ; USART1 Interrupt + DCD USART2_IRQHandler ; USART2 Interrupt + DCD LPUART1_IRQHandler ; LPUART1 Interrupt + DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt + DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt + DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts + DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt + DCD LPTIM3_IRQHandler ; LPTIM3 Interrupt + DCD SUBGHZSPI_IRQHandler ; SUBGHZSPI Interrupt + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD HSEM_IRQHandler ; HSEM0 Interrupt + DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt + DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt + DCD Radio_IRQHandler ; Radio Interrupt + DCD AES_IRQHandler ; AES Interrupt + DCD RNG_IRQHandler ; RNG1 Interrupt + DCD PKA_IRQHandler ; PKA Interrupt + DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt + DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt + DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt + DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt + DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt + DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt + DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt + DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +; Reset handler +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +MemManage_Handler\ + PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP +BusFault_Handler\ + PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP +UsageFault_Handler\ + PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +DebugMon_Handler\ + PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC + + EXPORT WWDG_IRQHandler [WEAK] + EXPORT PVD_PVM_IRQHandler [WEAK] + EXPORT TAMP_STAMP_LSECSS_SSRU_IRQHandler [WEAK] + EXPORT RTC_WKUP_IRQHandler [WEAK] + EXPORT FLASH_IRQHandler [WEAK] + EXPORT RCC_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_IRQHandler [WEAK] + EXPORT DMA1_Channel4_IRQHandler [WEAK] + EXPORT DMA1_Channel5_IRQHandler [WEAK] + EXPORT DMA1_Channel6_IRQHandler [WEAK] + EXPORT DMA1_Channel7_IRQHandler [WEAK] + EXPORT ADC1_IRQHandler [WEAK] + EXPORT DAC_IRQHandler [WEAK] + EXPORT COMP_IRQHandler [WEAK] + EXPORT EXTI9_5_IRQHandler [WEAK] + EXPORT TIM1_BRK_IRQHandler [WEAK] + EXPORT TIM1_UP_IRQHandler [WEAK] + EXPORT TIM1_TRG_COM_IRQHandler [WEAK] + EXPORT TIM1_CC_IRQHandler [WEAK] + EXPORT TIM2_IRQHandler [WEAK] + EXPORT TIM16_IRQHandler [WEAK] + EXPORT TIM17_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT I2C2_EV_IRQHandler [WEAK] + EXPORT I2C2_ER_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT LPUART1_IRQHandler [WEAK] + EXPORT LPTIM1_IRQHandler [WEAK] + EXPORT LPTIM2_IRQHandler [WEAK] + EXPORT EXTI15_10_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT LPTIM3_IRQHandler [WEAK] + EXPORT SUBGHZSPI_IRQHandler [WEAK] + EXPORT HSEM_IRQHandler [WEAK] + EXPORT I2C3_EV_IRQHandler [WEAK] + EXPORT I2C3_ER_IRQHandler [WEAK] + EXPORT Radio_IRQHandler [WEAK] + EXPORT AES_IRQHandler [WEAK] + EXPORT RNG_IRQHandler [WEAK] + EXPORT PKA_IRQHandler [WEAK] + EXPORT DMA2_Channel1_IRQHandler [WEAK] + EXPORT DMA2_Channel2_IRQHandler [WEAK] + EXPORT DMA2_Channel3_IRQHandler [WEAK] + EXPORT DMA2_Channel4_IRQHandler [WEAK] + EXPORT DMA2_Channel5_IRQHandler [WEAK] + EXPORT DMA2_Channel6_IRQHandler [WEAK] + EXPORT DMA2_Channel7_IRQHandler [WEAK] + EXPORT DMAMUX1_OVR_IRQHandler [WEAK] + +WWDG_IRQHandler +PVD_PVM_IRQHandler +TAMP_STAMP_LSECSS_SSRU_IRQHandler +RTC_WKUP_IRQHandler +FLASH_IRQHandler +RCC_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_IRQHandler +DMA1_Channel4_IRQHandler +DMA1_Channel5_IRQHandler +DMA1_Channel6_IRQHandler +DMA1_Channel7_IRQHandler +ADC1_IRQHandler +DAC_IRQHandler +COMP_IRQHandler +EXTI9_5_IRQHandler +TIM1_BRK_IRQHandler +TIM1_UP_IRQHandler +TIM1_TRG_COM_IRQHandler +TIM1_CC_IRQHandler +TIM2_IRQHandler +TIM16_IRQHandler +TIM17_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +I2C2_EV_IRQHandler +I2C2_ER_IRQHandler +SPI1_IRQHandler +SPI2_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +LPUART1_IRQHandler +LPTIM1_IRQHandler +LPTIM2_IRQHandler +EXTI15_10_IRQHandler +RTC_Alarm_IRQHandler +LPTIM3_IRQHandler +SUBGHZSPI_IRQHandler +HSEM_IRQHandler +I2C3_EV_IRQHandler +I2C3_ER_IRQHandler +Radio_IRQHandler +AES_IRQHandler +RNG_IRQHandler +PKA_IRQHandler +DMA2_Channel1_IRQHandler +DMA2_Channel2_IRQHandler +DMA2_Channel3_IRQHandler +DMA2_Channel4_IRQHandler +DMA2_Channel5_IRQHandler +DMA2_Channel6_IRQHandler +DMA2_Channel7_IRQHandler +DMAMUX1_OVR_IRQHandler + + B . + + ENDP + + ALIGN + +;******************************************************************************* +; User Stack and Heap initialization +;******************************************************************************* + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap + + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + + ALIGN + + ENDIF + + END + +;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****