diff --git a/board/NUCLEO_STM32L073RZ/KEIL/lorawan/DebugConfig/TencentOS_tiny_STM32L073RZTx.dbgconf b/board/NUCLEO_STM32L073RZ/KEIL/lorawan/DebugConfig/TencentOS_tiny_STM32L073RZTx.dbgconf deleted file mode 100644 index 5b27c4a9..00000000 --- a/board/NUCLEO_STM32L073RZ/KEIL/lorawan/DebugConfig/TencentOS_tiny_STM32L073RZTx.dbgconf +++ /dev/null @@ -1,43 +0,0 @@ -// File: STM32L0x1_0x2_0x3_DBGMCU.ini -// Version: 1.0.0 -// Note: refer to STM32L0x1 reference manual (RM0377) -// refer to STM32L0x1 datasheet -// refer to STM32L0x2 reference manual (RM0376) -// refer to STM32L0x2 datasheet -// refer to STM32L0x3 reference manual (RM0367) -// refer to STM32L0x3 datasheet - -// <<< Use Configuration Wizard in Context Menu >>> - -// Debug MCU configuration register (DBGMCU_CR) -// Reserved bits must be kept at reset value -// DBG_STANDBY Debug Standby Mode -// DBG_STOP Debug Stop Mode -// DBG_SLEEP Debug Sleep Mode -// -DbgMCU_CR = 0x00000007; - -// Debug MCU APB1 freeze register (DBGMCU_APB1_FZ) -// Reserved bits must be kept at reset value -// DBG_LPTIMER_STOP LPTIM1 counter stopped when core is halted -// DBG_I2C3_STOP I2C3 SMBUS timeout mode stopped when core is halted -// DBG_I2C2_STOP I2C2 SMBUS timeout mode stopped when core is halted -// DBG_I2C1_STOP I2C1 SMBUS timeout mode stopped when core is halted -// DBG_IWDG_STOP Debug independent watchdog stopped when core is halted -// DBG_WWDG_STOP Debug window watchdog stopped when core is halted -// DBG_RTC_STOP Debug RTC stopped when core is halted -// DBG_TIM7_STOP TIM7 counter stopped when core is halted -// DBG_TIM6_STOP TIM6 counter stopped when core is halted -// DBG_TIM3_STOP TIM3 counter stopped when core is halted -// DBG_TIM2_STOP TIM2 counter stopped when core is halted -// -DbgMCU_APB1_Fz = 0x00000000; - -// Debug MCU APB2 freeze register (DBGMCU_APB2_FZ) -// Reserved bits must be kept at reset value -// DBG_TIM22_STOP TIM22 counter stopped when core is halted -// DBG_TIM21_STOP TIM21 counter stopped when core is halted -// -DbgMCU_APB2_Fz = 0x00000000; - -// <<< end of configuration section >>> diff --git a/board/TencentOS_tiny_EVB_LX/.project b/board/TencentOS_tiny_EVB_LX/.project new file mode 100644 index 00000000..87584654 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/.project @@ -0,0 +1,11 @@ + + + GigaDevice_GD32VF103C_START + + + + + + + + diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Inc/EVB_LX_IoT_gd32vf103.h b/board/TencentOS_tiny_EVB_LX/BSP/Inc/EVB_LX_IoT_gd32vf103.h new file mode 100644 index 00000000..f02805f0 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/BSP/Inc/EVB_LX_IoT_gd32vf103.h @@ -0,0 +1,173 @@ +#ifndef EVB_LX_IOT_GD32VF103_H +#define EVB_LX_IOT_GD32VF103_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "gd32vf103.h" + +/* exported types */ +typedef enum +{ + LED = 0, + +} led_typedef_enum; + +typedef enum +{ + F1_KEY = 0, + F2_KEY = 1, +} key_typedef_enum; + +typedef enum +{ + KEY_MODE_GPIO = 0, + KEY_MODE_EXTI = 1 +} keymode_typedef_enum; + +/* eval board low layer led */ +#define LEDn 4U + +#define LED_PIN GPIO_PIN_2 +#define LED_GPIO_PORT GPIOB +#define LED_GPIO_CLK RCU_GPIOB +/*****************E53***********************************/ +#define SPI_SCK_PIN GPIO_PIN_13 +#define SPI_GPIO_PORT GPIOB +#define SPI_SCK_CLK RCU_GPIOB + +#define SPI_NSS_PIN GPIO_PIN_12 +#define SPI_NSS_PORT GPIOB +#define SPI_NSS_CLK RCU_GPIOB + +#define GPIO1_PIN GPIO_PIN_0 +#define GPIO1_PORT GPIOA +#define GPIO1_CLK RCU_GPIOA + +#define ADC_PIN GPIO_PIN_1 +#define ADC_PORT GPIOA +#define ADC_CLK RCU_GPIOA + +#define DAC_PIN GPIO_PIN_4 +#define DAC_PORT GPIOA +#define DAC_CLK RCU_GPIOA + +#define GPIO2_PIN GPIO_PIN_9 +#define GPIO2_PORT GPIOB +#define GPIO2_CLK RCU_GPIOB + +#define GPIO3_PIN GPIO_PIN_8 +#define GPIO3_PORT GPIOB +#define GPIO3_CLK RCU_GPIOB + +#define IIC_SCL_PIN GPIO_PIN_6 +#define IIC_SCL_PORT GPIOB +#define IIC_SCL_CLK RCU_GPIOB + +#define IIC_SDA_PIN GPIO_PIN_7 +#define IIC_SDA_PORT GPIOB +#define IIC_SDA_CLK RCU_GPIOB + +#define GPIO4_PIN GPIO_PIN_8 +#define GPIO4_PORT GPIOA +#define GPIO4_CLK RCU_GPIOA + +#define UART_RX_PIN GPIO_PIN_11 +#define UART_RX_PORT GPIOC +#define UART_RX_CLK RCU_GPIOC + +#define UART_TX_PIN GPIO_PIN_10 +#define UART_TX_PORT GPIOC +#define UART_TX_CLK RCU_GPIOC + +#define GPIO5_PIN GPIO_PIN_9 +#define GPIO5_PORT GPIOC +#define GPIO5_CLK RCU_GPIOC + +#define SPI_MOSI_PIN GPIO_PIN_15 +#define SPI_MOSI_PORT GPIOB +#define SPI_MOSI_CLK RCU_GPIOB + +#define SPI_MISO_PIN GPIO_PIN_14 +#define SPI_MISO_PORT GPIOB +#define SPI_MISO_CLK RCU_GPIOB +/*******************************************************/ + +/*************************OLED**************************/ +#define IIC2_SCL_PIN GPIO_PIN_10 +#define IIC2_SCL_PORT GPIOB + +#define IIC2_SDA_PIN GPIO_PIN_11 +#define IIC2_SDA_PORT GPIOB +/********************************************************/ + +#define COMn 2U + +#define EVAL_COM0 USART2 +#define EVAL_COM0_CLK RCU_USART2 +#define EVAL_COM0_TX_PIN GPIO_PIN_2 +#define EVAL_COM0_RX_PIN GPIO_PIN_3 +#define EVAL_COM0_GPIO_PORT GPIOA +#define EVAL_COM0_GPIO_CLK RCU_GPIOA + +#define EVAL_COM1 USART1 +#define EVAL_COM1_CLK RCU_USART1 +#define EVAL_COM1_TX_PIN GPIO_PIN_2 +#define EVAL_COM1_RX_PIN GPIO_PIN_3 +#define EVAL_COM1_GPIO_PORT GPIOA +#define EVAL_COM1_GPIO_CLK RCU_GPIOA + +#define EVAL_COM3 UART3 +#define EVAL_COM3_CLK RCU_UART3 +#define EVAL_COM3_TX_PIN GPIO_PIN_10 +#define EVAL_COM3_RX_PIN GPIO_PIN_11 +#define EVAL_COM3_GPIO_PORT GPIOC +#define EVAL_COM3_GPIO_CLK RCU_GPIOC + +#define KEYn 3U + +/* F1 push-button */ +#define F1_KEY_PIN GPIO_PIN_1 +#define F1_KEY_GPIO_PORT GPIOA +#define F1_KEY_GPIO_CLK RCU_GPIOA +#define F1_KEY_EXTI_LINE EXTI_1 +#define F1_KEY_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOA +#define F1_KEY_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_1 +#define F1_KEY_EXTI_IRQn EXTI1_IRQn + +/* F2 push-button */ +#define F2_KEY_PIN GPIO_PIN_0 +#define F2_KEY_GPIO_PORT GPIOA +#define F2_KEY_GPIO_CLK RCU_GPIOA +#define F2_KEY_EXTI_LINE EXTI_0 +#define F2_KEY_EXTI_PORT_SOURCE GPIO_PORT_SOURCE_GPIOA +#define F2_KEY_EXTI_PIN_SOURCE GPIO_PIN_SOURCE_0 +#define F2_KEY_EXTI_IRQn EXTI0_IRQn + + + + + +/* function declarations */ +/* configure led GPIO */ +void gd_eval_led_init(led_typedef_enum lednum); +/* turn on selected led */ +void gd_eval_led_on(led_typedef_enum lednum); +/* turn off selected led */ +void gd_eval_led_off(led_typedef_enum lednum); +/* toggle the selected led */ +void gd_eval_led_toggle(led_typedef_enum lednum); +/* configure key */ +void gd_eval_key_init(key_typedef_enum key_num, keymode_typedef_enum key_mode); +/* return the selected key state */ +uint8_t gd_eval_key_state_get(key_typedef_enum key); +/* configure COM port */ +void gd_eval_com_init(uint32_t com); + +#ifdef __cplusplus +} +#endif + +#endif /* BEARPI_IOT_GD32F303_H */ + diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Inc/bmp.h b/board/TencentOS_tiny_EVB_LX/BSP/Inc/bmp.h new file mode 100644 index 00000000..9c852fa4 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/BSP/Inc/bmp.h @@ -0,0 +1,80 @@ +////////////////////////////////////////////////////////////////////////////////// +// +// +//存储图片数据,图片大小为64*32像素 +// +///////////////////////////////////////////////////////////////////////////////// + +#ifndef __BMP_H +#define __BMP_H +unsigned char BMP1[] = +{0x00,0x06,0x0A,0xFE,0x0A,0xC6,0x00,0xE0,0x00,0xF0,0x00,0xF8,0x00,0x00,0x00,0x00, +0x00,0x00,0xFE,0x7D,0xBB,0xC7,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF,0xC7,0xBB,0x7D, +0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, +0x0C,0xFE,0xFE,0x0C,0x08,0x20,0x60,0xFE,0xFE,0x60,0x20,0x00,0x00,0x00,0x78,0x48, +0xFE,0x82,0xBA,0xBA,0x82,0xBA,0xBA,0x82,0xBA,0xBA,0x82,0xBA,0xBA,0x82,0xFE,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF, +0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,0xFF,0x00,0x00,0xFE,0xFF,0x03, +0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,0xFE,0x00,0x00,0x00,0x00,0xC0,0xC0, +0xC0,0x00,0x00,0x00,0x00,0xFE,0xFF,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03, +0xFF,0xFE,0x00,0x00,0xFE,0xFF,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF, +0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x0C, +0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xFF,0xFF,0x00,0x00,0x00,0x00,0xE1,0xE1, +0xE1,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0xFF,0xFF,0x00,0x00,0xFF,0xFF,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xFF, +0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x1F, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x0F,0x00,0x00,0x0F,0x1F,0x18, +0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x0F,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x0F,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, +0x1F,0x0F,0x00,0x00,0x0F,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F, +0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x8C,0x42,0x22,0x12,0x0C,0x00,0xFC,0x02,0x02,0x02,0xFC,0x00,0x00,0x04, +0xFE,0x00,0x00,0x00,0x20,0x58,0x44,0xFE,0x40,0x00,0x10,0x10,0x10,0x10,0x10,0x00, +0x00,0x04,0xFE,0x00,0x00,0x00,0xFC,0x02,0x02,0x02,0xFC,0x00,0x10,0x10,0x10,0x10, +0x10,0x00,0xFC,0x02,0x02,0x02,0xFC,0x00,0x00,0x04,0xFE,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x24,0xA4,0x2E,0x24,0xE4,0x24,0x2E,0xA4,0x24,0x00,0x00,0x00,0xF8,0x4A,0x4C, +0x48,0xF8,0x48,0x4C,0x4A,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x01, +0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,0x10,0x10, +0x10,0x10,0x20,0xC0,0x00,0x00,0xC0,0x20,0x10,0x10,0x10,0x10,0x20,0xC0,0x00,0x00, +0x00,0x12,0x0A,0x07,0x02,0x7F,0x02,0x07,0x0A,0x12,0x00,0x00,0x00,0x0B,0x0A,0x0A, +0x0A,0x7F,0x0A,0x0A,0x0A,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x40,0x40, +0x40,0x50,0x20,0x5F,0x80,0x00,0x1F,0x20,0x40,0x40,0x40,0x50,0x20,0x5F,0x80,0x00, + +}; + +#endif + + diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Inc/mcu_init.h b/board/TencentOS_tiny_EVB_LX/BSP/Inc/mcu_init.h new file mode 100644 index 00000000..09da853e --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/BSP/Inc/mcu_init.h @@ -0,0 +1,11 @@ +#ifndef __MCU_INIT_H +#define __MCU_INIT_H + +#include "gd32vf103.h" +#include "usart.h" +#include "oled.h" +#include "EVB_LX_IoT_gd32vf103.h" + +void board_init(); + +#endif //__MCU_INIT_H diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Inc/oled.h b/board/TencentOS_tiny_EVB_LX/BSP/Inc/oled.h new file mode 100644 index 00000000..6cd9d988 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/BSP/Inc/oled.h @@ -0,0 +1,40 @@ +#ifndef __OLED_H +#define __OLED_H +#include "gd32vf103.h" +#include "stdlib.h" +#define OLED_MODE 0 +#define OLED_SIZE 8 +#define XLevelL 0x00 +#define XLevelH 0x10 +#define Max_Column 128 +#define Max_Row 64 +#define Brightness 0xFF +#define X_WIDTH 128 +#define Y_WIDTH 64 + + + +#define OLED_SCLK_Clr() gpio_bit_write(GPIOB,GPIO_PIN_10, RESET);//SCL +#define OLED_SCLK_Set() gpio_bit_write(GPIOB,GPIO_PIN_10, SET); + +#define OLED_SDIN_Clr() gpio_bit_write(GPIOB,GPIO_PIN_11, RESET);//SDA +#define OLED_SDIN_Set() gpio_bit_write(GPIOB,GPIO_PIN_11, SET); + +#define OLED_CMD 0 +#define OLED_DATA 1 + + + +void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size); +void OLED_ShowString(uint8_t x,uint8_t y, uint8_t *p,uint8_t Char_Size); +void OLED_ShowChinese(uint8_t x,uint8_t y,uint8_t no); +void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[]); + + + +void OLED_Init(void); +void OLED_Clear(void); +void OLED_Display_On(void); +void OLED_Display_Off(void); +void OLED_Set_Pos(unsigned char x, unsigned char y); +#endif diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Inc/oledfont.h b/board/TencentOS_tiny_EVB_LX/BSP/Inc/oledfont.h new file mode 100644 index 00000000..bece1302 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/BSP/Inc/oledfont.h @@ -0,0 +1,230 @@ +#ifndef __OLEDFONT_H +#define __OLEDFONT_H +//常用ASCII表 +//偏移量32 +//ASCII字符集 +//偏移量32 +//大小:12*6 +/************************************6*8的点阵************************************/ +const unsigned char F6x8[][6] = +{ +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00},// sp +{0x00, 0x00, 0x00, 0x2f, 0x00, 0x00},// ! +{0x00, 0x00, 0x07, 0x00, 0x07, 0x00},// " +{0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14},// # +{0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12},// $ +{0x00, 0x62, 0x64, 0x08, 0x13, 0x23},// % +{0x00, 0x36, 0x49, 0x55, 0x22, 0x50},// & +{0x00, 0x00, 0x05, 0x03, 0x00, 0x00},// ' +{0x00, 0x00, 0x1c, 0x22, 0x41, 0x00},// ( +{0x00, 0x00, 0x41, 0x22, 0x1c, 0x00},// ) +{0x00, 0x14, 0x08, 0x3E, 0x08, 0x14},// * +{0x00, 0x08, 0x08, 0x3E, 0x08, 0x08},// + +{0x00, 0x00, 0x00, 0xA0, 0x60, 0x00},// , +{0x00, 0x08, 0x08, 0x08, 0x08, 0x08},// - +{0x00, 0x00, 0x60, 0x60, 0x00, 0x00},// . +{0x00, 0x20, 0x10, 0x08, 0x04, 0x02},// / +{0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E},// 0 +{0x00, 0x00, 0x42, 0x7F, 0x40, 0x00},// 1 +{0x00, 0x42, 0x61, 0x51, 0x49, 0x46},// 2 +{0x00, 0x21, 0x41, 0x45, 0x4B, 0x31},// 3 +{0x00, 0x18, 0x14, 0x12, 0x7F, 0x10},// 4 +{0x00, 0x27, 0x45, 0x45, 0x45, 0x39},// 5 +{0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30},// 6 +{0x00, 0x01, 0x71, 0x09, 0x05, 0x03},// 7 +{0x00, 0x36, 0x49, 0x49, 0x49, 0x36},// 8 +{0x00, 0x06, 0x49, 0x49, 0x29, 0x1E},// 9 +{0x00, 0x00, 0x36, 0x36, 0x00, 0x00},// : +{0x00, 0x00, 0x56, 0x36, 0x00, 0x00},// ; +{0x00, 0x08, 0x14, 0x22, 0x41, 0x00},// < +{0x00, 0x14, 0x14, 0x14, 0x14, 0x14},// = +{0x00, 0x00, 0x41, 0x22, 0x14, 0x08},// > +{0x00, 0x02, 0x01, 0x51, 0x09, 0x06},// ? +{0x00, 0x32, 0x49, 0x59, 0x51, 0x3E},// @ +{0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C},// A +{0x00, 0x7F, 0x49, 0x49, 0x49, 0x36},// B +{0x00, 0x3E, 0x41, 0x41, 0x41, 0x22},// C +{0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C},// D +{0x00, 0x7F, 0x49, 0x49, 0x49, 0x41},// E +{0x00, 0x7F, 0x09, 0x09, 0x09, 0x01},// F +{0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A},// G +{0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F},// H +{0x00, 0x00, 0x41, 0x7F, 0x41, 0x00},// I +{0x00, 0x20, 0x40, 0x41, 0x3F, 0x01},// J +{0x00, 0x7F, 0x08, 0x14, 0x22, 0x41},// K +{0x00, 0x7F, 0x40, 0x40, 0x40, 0x40},// L +{0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F},// M +{0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F},// N +{0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E},// O +{0x00, 0x7F, 0x09, 0x09, 0x09, 0x06},// P +{0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E},// Q +{0x00, 0x7F, 0x09, 0x19, 0x29, 0x46},// R +{0x00, 0x46, 0x49, 0x49, 0x49, 0x31},// S +{0x00, 0x01, 0x01, 0x7F, 0x01, 0x01},// T +{0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F},// U +{0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F},// V +{0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F},// W +{0x00, 0x63, 0x14, 0x08, 0x14, 0x63},// X +{0x00, 0x07, 0x08, 0x70, 0x08, 0x07},// Y +{0x00, 0x61, 0x51, 0x49, 0x45, 0x43},// Z +{0x00, 0x00, 0x7F, 0x41, 0x41, 0x00},// [ +{0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55},// 55 +{0x00, 0x00, 0x41, 0x41, 0x7F, 0x00},// ] +{0x00, 0x04, 0x02, 0x01, 0x02, 0x04},// ^ +{0x00, 0x40, 0x40, 0x40, 0x40, 0x40},// _ +{0x00, 0x00, 0x01, 0x02, 0x04, 0x00},// ' +{0x00, 0x20, 0x54, 0x54, 0x54, 0x78},// a +{0x00, 0x7F, 0x48, 0x44, 0x44, 0x38},// b +{0x00, 0x38, 0x44, 0x44, 0x44, 0x20},// c +{0x00, 0x38, 0x44, 0x44, 0x48, 0x7F},// d +{0x00, 0x38, 0x54, 0x54, 0x54, 0x18},// e +{0x00, 0x08, 0x7E, 0x09, 0x01, 0x02},// f +{0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C},// g +{0x00, 0x7F, 0x08, 0x04, 0x04, 0x78},// h +{0x00, 0x00, 0x44, 0x7D, 0x40, 0x00},// i +{0x00, 0x40, 0x80, 0x84, 0x7D, 0x00},// j +{0x00, 0x7F, 0x10, 0x28, 0x44, 0x00},// k +{0x00, 0x00, 0x41, 0x7F, 0x40, 0x00},// l +{0x00, 0x7C, 0x04, 0x18, 0x04, 0x78},// m +{0x00, 0x7C, 0x08, 0x04, 0x04, 0x78},// n +{0x00, 0x38, 0x44, 0x44, 0x44, 0x38},// o +{0x00, 0xFC, 0x24, 0x24, 0x24, 0x18},// p +{0x00, 0x18, 0x24, 0x24, 0x18, 0xFC},// q +{0x00, 0x7C, 0x08, 0x04, 0x04, 0x08},// r +{0x00, 0x48, 0x54, 0x54, 0x54, 0x20},// s +{0x00, 0x04, 0x3F, 0x44, 0x40, 0x20},// t +{0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C},// u +{0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C},// v +{0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C},// w +{0x00, 0x44, 0x28, 0x10, 0x28, 0x44},// x +{0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C},// y +{0x00, 0x44, 0x64, 0x54, 0x4C, 0x44},// z +{0x14, 0x14, 0x14, 0x14, 0x14, 0x14},// horiz lines +}; +/****************************************8*16的点阵************************************/ +const unsigned char F8X16[]= +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 0 + 0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//! 1 + 0x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" 2 + 0x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//# 3 + 0x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$ 4 + 0xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//% 5 + 0x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//& 6 + 0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//' 7 + 0x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//( 8 + 0x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//) 9 + 0x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//* 10 + 0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+ 11 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//, 12 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//- 13 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//. 14 + 0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,/// 15 + 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//0 16 + 0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//1 17 + 0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//2 18 + 0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//3 19 + 0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//4 20 + 0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//5 21 + 0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//6 22 + 0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//7 23 + 0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//8 24 + 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//9 25 + 0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//: 26 + 0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//; 27 + 0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//< 28 + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//= 29 + 0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//> 30 + 0x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//? 31 + 0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//@ 32 + 0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A 33 + 0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B 34 + 0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C 35 + 0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D 36 + 0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E 37 + 0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F 38 + 0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G 39 + 0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H 40 + 0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I 41 + 0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J 42 + 0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K 43 + 0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L 44 + 0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M 45 + 0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N 46 + 0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O 47 + 0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P 48 + 0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q 49 + 0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R 50 + 0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S 51 + 0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T 52 + 0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U 53 + 0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V 54 + 0xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W 55 + 0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X 56 + 0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y 57 + 0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z 58 + 0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[ 59 + 0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\ 60 + 0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//] 61 + 0x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^ 62 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_ 63 + 0x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//` 64 + 0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a 65 + 0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b 66 + 0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c 67 + 0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d 68 + 0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e 69 + 0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f 70 + 0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g 71 + 0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h 72 + 0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i 73 + 0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j 74 + 0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k 75 + 0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l 76 + 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m 77 + 0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n 78 + 0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o 79 + 0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p 80 + 0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q 81 + 0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r 82 + 0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s 83 + 0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t 84 + 0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//u 85 + 0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v 86 + 0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w 87 + 0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x 88 + 0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y 89 + 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z 90 + 0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{ 91 + 0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//| 92 + 0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//} 93 + 0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~ 94 +}; +char Hzk[][16]={ + +{0x40,0x3C,0x10,0xFF,0x10,0x10,0x20,0x10,0x8F,0x78,0x08,0xF8,0x08,0xF8,0x00,0x00}, +{0x02,0x06,0x02,0xFF,0x01,0x01,0x04,0x42,0x21,0x18,0x46,0x81,0x40,0x3F,0x00,0x00},/*"物",0*/ +/* (16 X 16 , 宋体 )*/ + +{0x02,0xFE,0x92,0x92,0xFE,0x02,0x00,0x10,0x11,0x16,0xF0,0x14,0x13,0x10,0x00,0x00}, +{0x10,0x1F,0x08,0x08,0xFF,0x04,0x81,0x41,0x31,0x0D,0x03,0x0D,0x31,0x41,0x81,0x00},/*"联",1*/ +/* (16 X 16 , 宋体 )*/ + +{0x00,0xFE,0x02,0x22,0x42,0x82,0x72,0x02,0x22,0x42,0x82,0x72,0x02,0xFE,0x00,0x00}, +{0x00,0xFF,0x10,0x08,0x06,0x01,0x0E,0x10,0x08,0x06,0x01,0x4E,0x80,0x7F,0x00,0x00},/*"网",2*/ +/* (16 X 16 , 宋体 )*/ + +{0x00,0x80,0x60,0xF8,0x07,0x00,0xFE,0x52,0x52,0x52,0x52,0x52,0xFE,0x00,0x00,0x00}, +{0x01,0x00,0x00,0xFF,0x08,0x88,0x4F,0x29,0x09,0x09,0x09,0x29,0x4F,0x88,0x08,0x00},/*"俱",3*/ +/* (16 X 16 , 宋体 )*/ + +{0x00,0x00,0xE0,0x9C,0x84,0x84,0x84,0xF4,0x82,0x82,0x83,0x82,0x80,0x80,0x00,0x00}, +{0x00,0x20,0x10,0x08,0x06,0x40,0x80,0x7F,0x00,0x00,0x02,0x04,0x08,0x30,0x00,0x00},/*"乐",4*/ +/* (16 X 16 , 宋体 )*/ + +{0x40,0x44,0x54,0x65,0x46,0x44,0x64,0x54,0x44,0x40,0xFE,0x02,0x22,0xDA,0x06,0x00}, +{0x00,0x00,0x7E,0x22,0x22,0x22,0x22,0x7E,0x00,0x00,0xFF,0x08,0x10,0x08,0x07,0x00},/*"部",5*/ +/* (16 X 16 , 宋体 )*/ +}; + +#endif diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Inc/usart.h b/board/TencentOS_tiny_EVB_LX/BSP/Inc/usart.h new file mode 100644 index 00000000..68631a13 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/BSP/Inc/usart.h @@ -0,0 +1,20 @@ +#ifndef __USART_H +#define __USART_H + +#define USART0_GPIO_TX_PIN GPIO_PIN_9 +#define USART0_GPIO_RX_PIN GPIO_PIN_10 +#define USART0_GPIO_PORT GPIOA + +#define USART1_GPIO_TX_PIN GPIO_PIN_2 +#define USART1_GPIO_RX_PIN GPIO_PIN_3 +#define USART1_GPIO_PORT GPIOA + +#define USART2_GPIO_TX_PIN GPIO_PIN_10 +#define USART2_GPIO_RX_PIN GPIO_PIN_11 +#define USART2_GPIO_PORT GPIOC + + +void usart0_init(int baud); +void usart1_init(int baud); +void usart2_init(int baud); +#endif // __USART_H diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Src/EVB_LX_IoT_gd32vf103.c b/board/TencentOS_tiny_EVB_LX/BSP/Src/EVB_LX_IoT_gd32vf103.c new file mode 100644 index 00000000..fe16cfce --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/BSP/Src/EVB_LX_IoT_gd32vf103.c @@ -0,0 +1,208 @@ +/*! + \file BearPi-IoT_gd32f303.c + \brief firmware functions to manage leds, keys, COM ports + + \version 2019-10-30, V1.0.0, demo for BearPi-IoT_GD32F30x + +*/ + +/* + Copyright (c) 2019, BearPi LIMITED. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "EVB_LX_IoT_gd32vf103.h" +#include "gd32vf103.h" +#include + +/* private variables */ +static uint32_t GPIO_PORT[LEDn] = {LED_GPIO_PORT}; +static uint32_t GPIO_PIN[LEDn] = {LED_PIN}; + +static rcu_periph_enum COM_CLK[COMn] = {EVAL_COM0_CLK, EVAL_COM1_CLK}; +static uint32_t COM_TX_PIN[COMn] = {EVAL_COM0_TX_PIN, EVAL_COM1_TX_PIN}; +static uint32_t COM_RX_PIN[COMn] = {EVAL_COM0_RX_PIN, EVAL_COM1_RX_PIN}; +static uint32_t COM_GPIO_PORT[COMn] = {EVAL_COM0_GPIO_PORT, EVAL_COM1_GPIO_PORT}; +static rcu_periph_enum COM_GPIO_CLK[COMn] = {EVAL_COM0_GPIO_CLK, EVAL_COM1_GPIO_CLK}; + +static rcu_periph_enum GPIO_CLK[LEDn] = {LED_GPIO_CLK}; + +static uint32_t KEY_PORT[KEYn] = {F1_KEY_GPIO_PORT, F2_KEY_GPIO_PORT}; +static uint32_t KEY_PIN[KEYn] = {F1_KEY_PIN, F2_KEY_PIN}; +static rcu_periph_enum KEY_CLK[KEYn] = {F1_KEY_GPIO_CLK, F2_KEY_GPIO_CLK}; +static exti_line_enum KEY_EXTI_LINE[KEYn] = {F1_KEY_EXTI_LINE, F2_KEY_EXTI_LINE}; +static uint8_t KEY_PORT_SOURCE[KEYn] = {F1_KEY_EXTI_PORT_SOURCE, F2_KEY_EXTI_PORT_SOURCE}; +static uint8_t KEY_PIN_SOURCE[KEYn] = {F1_KEY_EXTI_PIN_SOURCE, F2_KEY_EXTI_PIN_SOURCE}; +static uint8_t KEY_IRQn[KEYn] = {F1_KEY_EXTI_IRQn, F2_KEY_EXTI_IRQn}; + +/*! + \brief configure led GPIO + \param[in] lednum: specify the led to be configured + \arg LED + \param[out] none + \retval none +*/ +void gd_eval_led_init(led_typedef_enum lednum) +{ + /* enable the led clock */ + rcu_periph_clock_enable(GPIO_CLK[lednum]); + /* configure led GPIO port */ + gpio_init(GPIO_PORT[lednum], GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, GPIO_PIN[lednum]); + + GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; +} + +/*! + \brief turn on selected led + \param[in] lednum: specify the led to be turned on + \arg LED + \param[out] none + \retval none +*/ +void gd_eval_led_on(led_typedef_enum lednum) { GPIO_BOP(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; } + +/*! + \brief turn off selected led + \param[in] lednum: specify the led to be turned off + \arg LED + \param[out] none + \retval none +*/ +void gd_eval_led_off(led_typedef_enum lednum) { GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; } + +/*! + \brief toggle selected led + \param[in] lednum: specify the led to be toggled + \arg LED + \param[out] none + \retval none +*/ +void gd_eval_led_toggle(led_typedef_enum lednum) +{ + gpio_bit_write(GPIO_PORT[lednum], GPIO_PIN[lednum], (bit_status)(1 - gpio_input_bit_get(GPIO_PORT[lednum], GPIO_PIN[lednum]))); +} + +/*! + \brief configure key + \param[in] key_num: specify the key to be configured + \arg F1_KEY + \arg F2_KEY + \param[in] key_mode: specify button mode + \arg KEY_MODE_GPIO: key will be used as simple IO + \arg KEY_MODE_EXTI: key will be connected to EXTI line with interrupt + \param[out] none + \retval none +*/ +void gd_eval_key_init(key_typedef_enum keynum, keymode_typedef_enum keymode) +{ + /* enable the key clock */ + rcu_periph_clock_enable(KEY_CLK[keynum]); + rcu_periph_clock_enable(RCU_AF); + + /* configure button pin as input */ + gpio_init(KEY_PORT[keynum], GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, KEY_PIN[keynum]); + + if (keymode == KEY_MODE_EXTI) { + /* enable and set key EXTI interrupt to the lowest priority */ + eclic_irq_enable(KEY_IRQn[keynum],1, 1); + + /* connect key EXTI line to key GPIO pin */ + gpio_exti_source_select(KEY_PORT_SOURCE[keynum], KEY_PIN_SOURCE[keynum]); + + /* configure key EXTI line */ + exti_init(KEY_EXTI_LINE[keynum], EXTI_INTERRUPT, EXTI_TRIG_FALLING); + exti_interrupt_flag_clear(KEY_EXTI_LINE[keynum]); + } +} + +/*! + \brief return the selected key state + \param[in] key: specify the key to be checked + \arg F1_KEY + \arg F2_KEY + \param[out] none + \retval the key's GPIO pin value +*/ +uint8_t gd_eval_key_state_get(key_typedef_enum key) { return gpio_input_bit_get(KEY_PORT[key], KEY_PIN[key]); } + +/*! + \brief configure COM port + \param[in] com: COM on the board + \arg EVAL_COM0: COM0 on the board + \arg EVAL_COM1: COM1 on the board + \param[out] none + \retval none +*/ +void gd_eval_com_init(uint32_t com) +{ + uint32_t com_id = 0U; + if (EVAL_COM0 == com) + { + com_id = 0U; + } + else if (EVAL_COM1 == com) + { + com_id = 1U; + } + + /* enable GPIO clock */ + rcu_periph_clock_enable(COM_GPIO_CLK[com_id]); + + /* enable USART clock */ + rcu_periph_clock_enable(COM_CLK[com_id]); + + /* connect port to USARTx_Tx */ + gpio_init(COM_GPIO_PORT[com_id], GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, COM_TX_PIN[com_id]); + + /* connect port to USARTx_Rx */ + gpio_init(COM_GPIO_PORT[com_id], GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, COM_RX_PIN[com_id]); + + /* USART configure */ + usart_deinit(com); + if (EVAL_COM0 == com) + { + usart_baudrate_set(com, 115200U); + } + else if (EVAL_COM1 == com) + { + usart_baudrate_set(com, 9600U); + } + usart_receive_config(com, USART_RECEIVE_ENABLE); + usart_transmit_config(com, USART_TRANSMIT_ENABLE); + usart_enable(com); +} + +/* retarget the C library printf function to the USART */ +/*int _put_char(int ch) +{ + usart_data_transmit(EVAL_COM0, (uint8_t) ch ); + while ( usart_flag_get(EVAL_COM0, USART_FLAG_TBE)== RESET){ + } + + return ch; +}*/ + diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Src/gd32vf103_it.c b/board/TencentOS_tiny_EVB_LX/BSP/Src/gd32vf103_it.c new file mode 100644 index 00000000..aa33583b --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/BSP/Src/gd32vf103_it.c @@ -0,0 +1,11 @@ +#include "tos.h" + +// systick handler +void eclic_mtip_handler() { + port_systick_config((uint32_t)k_cpu_cycle_per_tick); + if (tos_knl_is_running()) { + tos_knl_irq_enter(); + tos_tick_handler(); + tos_knl_irq_leave(); + } +} diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Src/mcu_init.c b/board/TencentOS_tiny_EVB_LX/BSP/Src/mcu_init.c new file mode 100644 index 00000000..c2bbf9f3 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/BSP/Src/mcu_init.c @@ -0,0 +1,28 @@ +#include "mcu_init.h" + +static void led_config(void) +{ + rcu_periph_clock_enable(LED_GPIO_CLK); + + + /* configure LED GPIO port */ + gpio_init(LED_GPIO_PORT, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, LED_PIN); + /* reset LED GPIO pin */ + gpio_bit_set(LED_GPIO_PORT, LED_PIN); +} + +void board_init() +{ + char *str = "Tencent"; + SystemInit(); + led_config(); + usart0_init(115200); + usart1_init(115200); + usart2_init(115200); + OLED_Init(); + OLED_Clear(); + OLED_ShowChinese(36,0,0); + OLED_ShowChinese(54,0,1); + OLED_ShowChinese(72,0,2); + OLED_ShowString(36,2,(uint8_t*)str,8); +} diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Src/oled.c b/board/TencentOS_tiny_EVB_LX/BSP/Src/oled.c new file mode 100644 index 00000000..0f687ee8 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/BSP/Src/oled.c @@ -0,0 +1,312 @@ +#include "oled.h" +#include "stdlib.h" +#include "oledfont.h" + +void delay(unsigned int t) +{ + for(int i = 0; i < 1000; i++) + for(int j = 0; j < t;j++); +} +void IIC_Start(void) +{ + OLED_SCLK_Set(); + OLED_SDIN_Set(); + OLED_SDIN_Clr(); + OLED_SCLK_Clr(); +} + +/********************************************** +//IIC Stop +**********************************************/ +void IIC_Stop(void) +{ + OLED_SCLK_Set(); + OLED_SDIN_Clr(); + OLED_SDIN_Set(); +} + +void IIC_Wait_Ack(void) +{ + OLED_SCLK_Set(); + OLED_SCLK_Clr(); +} +/********************************************** +// IIC Write byte +**********************************************/ + +void Write_IIC_Byte(unsigned char IIC_Byte) +{ + unsigned char i; + unsigned char m,da; + da=IIC_Byte; + OLED_SCLK_Clr(); + for(i=0;i<8;i++) + { + m=da; + m=m&0x80; + if(m==0x80) + { + OLED_SDIN_Set(); + } + else + OLED_SDIN_Clr(); + da=da<<1; + OLED_SCLK_Set(); + OLED_SCLK_Clr(); + } +} +/********************************************** +// IIC Write Command +**********************************************/ +void Write_IIC_Command(unsigned char IIC_Command) +{ + IIC_Start(); + Write_IIC_Byte(0x78); //Slave address,SA0=0 + IIC_Wait_Ack(); + Write_IIC_Byte(0x00); //write command + IIC_Wait_Ack(); + Write_IIC_Byte(IIC_Command); + IIC_Wait_Ack(); + IIC_Stop(); +} +/********************************************** +// IIC Write Data +**********************************************/ +void Write_IIC_Data(unsigned char IIC_Data) +{ + IIC_Start(); + Write_IIC_Byte(0x78); //D/C#=0; R/W#=0 + IIC_Wait_Ack(); + Write_IIC_Byte(0x40); //write data + IIC_Wait_Ack(); + Write_IIC_Byte(IIC_Data); + IIC_Wait_Ack(); + IIC_Stop(); +} +void OLED_WR_Byte(unsigned dat,unsigned cmd) +{ + if(cmd) + { + Write_IIC_Data(dat); + } + else + { + Write_IIC_Command(dat); + } +} + + +/******************************************** +// fill_Picture +********************************************/ +void fill_picture(unsigned char fill_Data) +{ + unsigned char m,n; + for(m=0;m<8;m++) + { + OLED_WR_Byte(0xb0+m,0); //page0-page1 + OLED_WR_Byte(0x00,0); //low column start address + OLED_WR_Byte(0x10,0); //high column start address + for(n=0;n<128;n++) + { + OLED_WR_Byte(fill_Data,1); + } + } +} + + +void OLED_Set_Pos(unsigned char x, unsigned char y) +{ + OLED_WR_Byte(0xb0+y,OLED_CMD); + OLED_WR_Byte(((x&0xf0)>>4)|0x10,OLED_CMD); + OLED_WR_Byte((x&0x0f),OLED_CMD); +} + +void OLED_Display_On(void) +{ + OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC + OLED_WR_Byte(0X14,OLED_CMD); //DCDC ON + OLED_WR_Byte(0XAF,OLED_CMD); //DISPLAY ON +} + +void OLED_Display_Off(void) +{ + OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC + OLED_WR_Byte(0X10,OLED_CMD); //DCDC OFF + OLED_WR_Byte(0XAE,OLED_CMD); //DISPLAY OFF +} + +void OLED_Clear(void) +{ + uint8_t i,n; + for(i=0;i<8;i++) + { + OLED_WR_Byte (0xb0+i,OLED_CMD); + OLED_WR_Byte (0x00,OLED_CMD); + OLED_WR_Byte (0x10,OLED_CMD); + for(n=0;n<128;n++) + OLED_WR_Byte(0,OLED_DATA); + } +} +void OLED_On(void) +{ + uint8_t i,n; + for(i=0;i<8;i++) + { + OLED_WR_Byte (0xb0+i,OLED_CMD); + OLED_WR_Byte (0x00,OLED_CMD); + OLED_WR_Byte (0x10,OLED_CMD); + for(n=0;n<128;n++)OLED_WR_Byte(1,OLED_DATA); + } +} + +void OLED_ShowChar(uint8_t x,uint8_t y,uint8_t chr,uint8_t Char_Size) +{ + unsigned char c=0,i=0; + c=chr-' '; + if(x>Max_Column-1){x=0;y=y+2;} + if(Char_Size ==16) + { + OLED_Set_Pos(x,y); + for(i=0;i<8;i++) + { + OLED_WR_Byte(F8X16[c*16+i],OLED_DATA); + } + OLED_Set_Pos(x,y+1); + for(i=0;i<8;i++){ + OLED_WR_Byte(F8X16[c*16+i+8],OLED_DATA); + } + } + else + { + OLED_Set_Pos(x,y); + for(i=0;i<6;i++) + OLED_WR_Byte(F6x8[c][i],OLED_DATA); + } +} + + +uint32_t oled_pow(uint8_t m,uint8_t n) +{ + uint32_t result=1; + while(n--)result*=m; + return result; +} + +void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size2) +{ + uint8_t t,temp; + uint8_t enshow=0; + for(t=0;t120) + { + x=0;y+=2; + } + j++; + } +} + +void OLED_ShowChinese(uint8_t x,uint8_t y,uint8_t no) +{ + uint8_t t,adder=0; + OLED_Set_Pos(x,y); + for(t=0;t<16;t++) + { + OLED_WR_Byte(Hzk[2*no][t],OLED_DATA); + adder+=1; + } + OLED_Set_Pos(x,y+1); + for(t=0;t<16;t++) + { + OLED_WR_Byte(Hzk[2*no+1][t],OLED_DATA); + adder+=1; + } +} + +void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[]) +{ + unsigned int j=0; + unsigned char x,y; + + if(y1%8==0) y=y1/8; + else y=y1/8+1; + for(y=y0;y 0u) +#define TOS_CFG_MSG_EN 1u +#else +#define TOS_CFG_MSG_EN 0u +#endif + +// 配置TencentOS tiny消息队列大小 +#define TOS_CFG_MSG_POOL_SIZE 10u + +// 配置TencentOS tiny空闲任务栈大小 +#define TOS_CFG_IDLE_TASK_STK_SIZE 512u + +// 配置TencentOS tiny中断栈大小 +#define TOS_CFG_IRQ_STK_SIZE 128u + +// 配置TencentOS tiny的tick频率 +#define TOS_CFG_CPU_TICK_PER_SECOND 1000u + +// 配置TencentOS tiny CPU频率 +// 除4的原因是,Bumblebee内核通过core_clk_aon四分频来更新mtime寄存器 +// 具体信息参见《Bumblebee内核简明数据手册》 +#define TOS_CFG_CPU_CLOCK (SystemCoreClock/4) + +// 配置是否将TIMER配置成函数模式 +#define TOS_CFG_TIMER_AS_PROC 1u + +#define TOS_CFG_VFS_EN 1u + +#define TOS_CFG_MMBLK_EN 1u + + +#endif /* INC_TOS_CONFIG_H_ */ diff --git a/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/.cproject b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/.cproject new file mode 100644 index 00000000..28693a92 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/.cproject @@ -0,0 +1,438 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/.gitignore b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/.gitignore new file mode 100644 index 00000000..3df573fe --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/.gitignore @@ -0,0 +1 @@ +/Debug/ diff --git a/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/.project b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/.project new file mode 100644 index 00000000..c505a084 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/.project @@ -0,0 +1,94 @@ + + + hello_world + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + Application + 2 + virtual:/virtual + + + GD32VF103_Firmware_Library + 2 + $%7BPARENT-4-PROJECT_LOC%7D/platform/vendor_bsp/gd/GD32VF103_Firmware_Library + + + TencentOS_tiny + 2 + virtual:/virtual + + + Application/Inc + 2 + $%7BPARENT-2-PROJECT_LOC%7D/BSP/Inc + + + Application/Src + 2 + $%7BPARENT-2-PROJECT_LOC%7D/BSP/Src + + + Application/tos_config.h + 1 + $%7BPARENT-2-PROJECT_LOC%7D/TOS_CONFIG/tos_config.h + + + TencentOS_tiny/arch + 2 + virtual:/virtual + + + TencentOS_tiny/kernel + 2 + $%7BPARENT-4-PROJECT_LOC%7D/kernel + + + TencentOS_tiny/arch/risc-v + 2 + virtual:/virtual + + + TencentOS_tiny/arch/risc-v/bumblebee + 2 + TOP_DIR/arch/risc-v/bumblebee/gcc + + + TencentOS_tiny/arch/risc-v/common + 2 + $%7BPARENT-4-PROJECT_LOC%7D/arch/risc-v/common + + + TencentOS_tiny/arch/risc-v/rv32i + 2 + TOP_DIR/arch/risc-v/rv32i/gcc + + + + + TOP_DIR + $%7BPARENT-4-PROJECT_LOC%7D + + + diff --git a/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/gd32vf103_libopt.h b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/gd32vf103_libopt.h new file mode 100644 index 00000000..875ff748 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/gd32vf103_libopt.h @@ -0,0 +1,61 @@ +/*! + \file gd32vf103_libopt.h + \brief library optional for gd32vf103 + + \version 2019-6-5, V1.0.0, demo for GD32VF103 +*/ + +/* + Copyright (c) 2019, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#ifndef GD32VF103_LIBOPT_H +#define GD32VF103_LIBOPT_H + +#include "gd32vf103_adc.h" +#include "gd32vf103_bkp.h" +#include "gd32vf103_can.h" +#include "gd32vf103_crc.h" +#include "gd32vf103_dac.h" +#include "gd32vf103_dma.h" +#include "gd32vf103_eclic.h" +#include "gd32vf103_exmc.h" +#include "gd32vf103_exti.h" +#include "gd32vf103_fmc.h" +#include "gd32vf103_gpio.h" +#include "gd32vf103_i2c.h" +#include "gd32vf103_fwdgt.h" +#include "gd32vf103_dbg.h" +#include "gd32vf103_pmu.h" +#include "gd32vf103_rcu.h" +#include "gd32vf103_rtc.h" +#include "gd32vf103_spi.h" +#include "gd32vf103_timer.h" +#include "gd32vf103_usart.h" +#include "gd32vf103_wwdgt.h" +#include "n200_func.h" + +#endif /* GD32VF103_LIBOPT_H */ diff --git a/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/link.lds b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/link.lds new file mode 100644 index 00000000..1c32e640 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/link.lds @@ -0,0 +1,175 @@ +OUTPUT_ARCH( "riscv" ) + +ENTRY( _start ) + +MEMORY +{ + /* Run in FLASH */ + flash (rxai!w) : ORIGIN = 0x08000000, LENGTH = 128k + ram (wxa!ri) : ORIGIN = 0x20000000, LENGTH = 32K + + /* Run in RAM */ +/* flash (rxai!w) : ORIGIN = 0x20000000, LENGTH = 24k + ram (wxa!ri) : ORIGIN = 0x20006000, LENGTH = 8K +*/ +} + + +SECTIONS +{ + __stack_size = DEFINED(__stack_size) ? __stack_size : 2K; + + + .init : + { + KEEP (*(SORT_NONE(.init))) + } >flash AT>flash + + .ilalign : + { + . = ALIGN(4); + PROVIDE( _ilm_lma = . ); + } >flash AT>flash + + .ialign : + { + PROVIDE( _ilm = . ); + } >flash AT>flash + + .text : + { + *(.rodata .rodata.*) + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >flash AT>flash + + .fini : + { + KEEP (*(SORT_NONE(.fini))) + } >flash AT>flash + + . = ALIGN(4); + + PROVIDE (__etext = .); + PROVIDE (_etext = .);/*0x80022c8*/ + PROVIDE (etext = .);/*0x80022c8*/ + PROVIDE( _eilm = . ); + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >flash AT>flash + + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) + KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) + PROVIDE_HIDDEN (__init_array_end = .); + } >flash AT>flash + + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) + KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >flash AT>flash + + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*crtbegin?.o(.ctors)) + /* We don't want to include the .ctor section from + the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } >flash AT>flash + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*crtbegin?.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } >flash AT>flash + + . = ALIGN(4); + PROVIDE( _eilm = . ); + + .lalign : + { + . = ALIGN(4); + PROVIDE( _data_lma = . ); + } >flash AT>flash + + .dalign : + { + . = ALIGN(4); + PROVIDE( _data = . ); + } >ram AT>flash + + + .data : + { + *(.rdata) + + *(.gnu.linkonce.r.*) + *(.data .data.*) + *(.gnu.linkonce.d.*) + . = ALIGN(8); + PROVIDE( __global_pointer$ = . + 0x800); + *(.sdata .sdata.*) + *(.gnu.linkonce.s.*) + . = ALIGN(8); + *(.srodata.cst16) + *(.srodata.cst8) + *(.srodata.cst4) + *(.srodata.cst2) + *(.srodata .srodata.*) + } >ram AT>flash + + . = ALIGN(4); + PROVIDE( _edata = . ); + PROVIDE( edata = . ); + + PROVIDE( _fbss = . ); /*0X200052A0 0X200002A0*/ + PROVIDE( __bss_start = . ); + .bss : + { + *(.sbss*) + *(.gnu.linkonce.sb.*) + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + . = ALIGN(4); + } >ram AT>ram + + . = ALIGN(8); + PROVIDE( _end = . ); /*0X2000,0340*/ + PROVIDE( end = . ); + + .stack ORIGIN(ram) + LENGTH(ram) - __stack_size : + { + PROVIDE( _heap_end = . ); + . = __stack_size; + PROVIDE( _sp = . ); + } >ram AT>ram +} diff --git a/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/main.c b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/main.c new file mode 100644 index 00000000..3541a26f --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/main.c @@ -0,0 +1,57 @@ +#include "mcu_init.h" +#include "tos.h" + +#define TASK_SIZE 1024 +k_task_t k_task_task1; +k_task_t k_task_task2; +uint8_t k_task1_stk[TASK_SIZE]; +uint8_t k_task2_stk[TASK_SIZE]; + +void task1(void *pdata) +{ + int task_cnt1 = 0; + while (1) { + printf("hello world from %s cnt: %d\n", __func__, task_cnt1++); + if (task_cnt1 % 2 == 0) + { + gpio_bit_write(LED_GPIO_PORT, LED_PIN,SET); + } + else + { + gpio_bit_write(LED_GPIO_PORT, LED_PIN,RESET); + } + tos_task_delay(1000); + } +} + +void task2(void *pdata) +{ + int task_cnt2 = 0; + while (1) { + printf("hello world from %s cnt: %d\n", __func__, task_cnt2++); + if (task_cnt2 %2 == 0) + { + gpio_bit_write(GPIOE, GPIO_PIN_0,SET); + gpio_bit_write(GPIOE, GPIO_PIN_1,SET); + } + else + { + gpio_bit_write(GPIOE, GPIO_PIN_0,RESET); + gpio_bit_write(GPIOE, GPIO_PIN_1,RESET); + } + tos_task_delay(500); + } +} + + +void main(void) { + board_init(); + + tos_knl_init(); + + tos_task_create(&k_task_task1, "task1", task1, NULL, 3, k_task1_stk, TASK_SIZE, 0); + tos_task_create(&k_task_task2, "task2", task2, NULL, 3, k_task2_stk, TASK_SIZE, 0); + + tos_knl_start(); + +} diff --git a/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/openocd_gdlink.cfg b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/openocd_gdlink.cfg new file mode 100644 index 00000000..3ec85d42 --- /dev/null +++ b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/openocd_gdlink.cfg @@ -0,0 +1,45 @@ +adapter_khz 1000 +reset_config srst_only +adapter_nsrst_assert_width 100 + + + +interface cmsis-dap + +transport select jtag + +#autoexit true + +set _CHIPNAME riscv +jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x1000563d + +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME riscv -chain-position $_TARGETNAME +$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 20480 -work-area-backup 0 + + +# Work-area is a space in RAM used for flash programming +if { [info exists WORKAREASIZE] } { + set _WORKAREASIZE $WORKAREASIZE +} else { + set _WORKAREASIZE 0x5000 +} + +# Allow overriding the Flash bank size +if { [info exists FLASH_SIZE] } { + set _FLASH_SIZE $FLASH_SIZE +} else { + # autodetect size + set _FLASH_SIZE 0 +} + +# flash size will be probed +set _FLASHNAME $_CHIPNAME.flash + +flash bank $_FLASHNAME gd32vf103 0x08000000 0 0 0 $_TARGETNAME +riscv set_reset_timeout_sec 1 +init + +halt + + diff --git a/board/TencentOS_tiny_EVB_MX/KEIL/sensor_e53_ia1_e2e_demo/TencentOS_tiny.uvoptx b/board/TencentOS_tiny_EVB_MX/KEIL/sensor_e53_ia1_e2e_demo/TencentOS_tiny.uvoptx new file mode 100644 index 00000000..119cf92a --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX/KEIL/sensor_e53_ia1_e2e_demo/TencentOS_tiny.uvoptx @@ -0,0 +1,1432 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + TencentOS_tiny + 0x4 + ARM-ADS + + 80000000 + + 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 + 11 + + + + + + + + + + + STLink\ST-LINKIII-KEIL_SWO.dll + + + + 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 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256 -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM)) + + + 0 + ST-LINKIII-KEIL_SWO + -U303030303030303030303031 -O10446 -S1 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM) + + + + + + 0 + 1 + tos_next_task + + + 1 + 1 + tos_rdyq.highest_prio + + + 2 + 1 + task_list + + + 3 + 1 + 0x20000280 + + + 4 + 1 + tos_rdyq.highest_prio + + + 5 + 1 + owner + + + 6 + 1 + tos_curr_task + + + 7 + 1 + highest_pending_prio + + + 8 + 1 + task + + + + + 1 + 0 + 0xE000ED88 + 0 + + + + 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 + + 1 + 0 + 2 + 10000000 + + + + + + Application/MDK-ARM + 0 + 0 + 0 + 0 + + 1 + 1 + 2 + 0 + 0 + 0 + startup_stm32l431xx.s + startup_stm32l431xx.s + 0 + 0 + + + + + Application/User + 0 + 0 + 0 + 0 + + 2 + 2 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\gpio.c + gpio.c + 0 + 0 + + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\main.c + main.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\mcu_init.c + mcu_init.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + stm32l4xx_hal_msp.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\usart.c + usart.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\adc.c + adc.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\dac.c + dac.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\i2c.c + i2c.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\spi.c + spi.c + 0 + 0 + + + 2 + 11 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_it_module.c + stm32l4xx_it_module.c + 0 + 0 + + + + + examples + 1 + 0 + 0 + 0 + + 3 + 12 + 1 + 0 + 0 + 0 + ..\..\..\..\examples\sensor_e53_ia1_e2e_demo\e53_ia1_e2e_demo.c + e53_ia1_e2e_demo.c + 0 + 0 + + + + + Drivers/STM32L4xx_HAL_Driver + 0 + 0 + 0 + 0 + + 4 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + stm32l4xx_hal_tim.c + 0 + 0 + + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + stm32l4xx_hal_tim_ex.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + stm32l4xx_hal_uart.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + stm32l4xx_hal_uart_ex.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + stm32l4xx_hal.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + stm32l4xx_hal_i2c.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + stm32l4xx_hal_i2c_ex.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + stm32l4xx_hal_rcc.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + stm32l4xx_hal_rcc_ex.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + stm32l4xx_hal_flash.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + stm32l4xx_hal_flash_ex.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + stm32l4xx_hal_flash_ramfunc.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + stm32l4xx_hal_gpio.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + stm32l4xx_hal_dma.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + stm32l4xx_hal_dma_ex.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + stm32l4xx_hal_pwr.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + stm32l4xx_hal_pwr_ex.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + stm32l4xx_hal_cortex.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + stm32l4xx_hal_adc_ex.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + stm32l4xx_hal_adc.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + stm32l4xx_hal_dac.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + stm32l4xx_hal_dac_ex.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + stm32l4xx_hal_spi.c + 0 + 0 + + + 4 + 36 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + stm32l4xx_hal_spi_ex.c + 0 + 0 + + + + + Drivers/CMSIS + 0 + 0 + 0 + 0 + + 5 + 37 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\system_stm32l4xx.c + system_stm32l4xx.c + 0 + 0 + + + + + Hardware + 0 + 0 + 0 + 0 + + 6 + 38 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\DHT11\DHT11_BUS.c + DHT11_BUS.c + 0 + 0 + + + 6 + 39 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\OLED\oled.c + oled.c + 0 + 0 + + + 6 + 40 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\E53_IA1\E53_IA1.c + E53_IA1.c + 0 + 0 + + + + + kernel + 0 + 0 + 0 + 0 + + 7 + 41 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_binary_heap.c + tos_binary_heap.c + 0 + 0 + + + 7 + 42 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_char_fifo.c + tos_char_fifo.c + 0 + 0 + + + 7 + 43 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_completion.c + tos_completion.c + 0 + 0 + + + 7 + 44 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_countdownlatch.c + tos_countdownlatch.c + 0 + 0 + + + 7 + 45 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_event.c + tos_event.c + 0 + 0 + + + 7 + 46 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_global.c + tos_global.c + 0 + 0 + + + 7 + 47 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mail_queue.c + tos_mail_queue.c + 0 + 0 + + + 7 + 48 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_message_queue.c + tos_message_queue.c + 0 + 0 + + + 7 + 49 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmblk.c + tos_mmblk.c + 0 + 0 + + + 7 + 50 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmheap.c + tos_mmheap.c + 0 + 0 + + + 7 + 51 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mutex.c + tos_mutex.c + 0 + 0 + + + 7 + 52 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_pend.c + tos_pend.c + 0 + 0 + + + 7 + 53 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + tos_priority_mail_queue.c + 0 + 0 + + + 7 + 54 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + tos_priority_message_queue.c + 0 + 0 + + + 7 + 55 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_queue.c + tos_priority_queue.c + 0 + 0 + + + 7 + 56 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_ring_queue.c + tos_ring_queue.c + 0 + 0 + + + 7 + 57 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_robin.c + tos_robin.c + 0 + 0 + + + 7 + 58 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sched.c + tos_sched.c + 0 + 0 + + + 7 + 59 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sem.c + tos_sem.c + 0 + 0 + + + 7 + 60 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sys.c + tos_sys.c + 0 + 0 + + + 7 + 61 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_task.c + tos_task.c + 0 + 0 + + + 7 + 62 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_tick.c + tos_tick.c + 0 + 0 + + + 7 + 63 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_time.c + tos_time.c + 0 + 0 + + + 7 + 64 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_timer.c + tos_timer.c + 0 + 0 + + + + + cpu + 0 + 0 + 0 + 0 + + 8 + 65 + 2 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + port_s.S + 0 + 0 + + + 8 + 66 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + tos_cpu.c + 0 + 0 + + + 8 + 67 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + port_c.c + 0 + 0 + + + + + cmsis + 0 + 0 + 0 + 0 + + 9 + 68 + 1 + 0 + 0 + 0 + ..\..\..\..\osal\cmsis_os\cmsis_os.c + cmsis_os.c + 0 + 0 + + + + + config + 1 + 0 + 0 + 0 + + 10 + 69 + 5 + 0 + 0 + 0 + ..\..\TOS-CONFIG\tos_config.h + tos_config.h + 0 + 0 + + + + + devices + 0 + 0 + 0 + 0 + + 11 + 70 + 1 + 0 + 0 + 0 + ..\..\..\..\devices\bc35_28_95\bc35_28_95.c + bc35_28_95.c + 0 + 0 + + + 11 + 71 + 1 + 0 + 0 + 0 + ..\..\..\..\devices\esp8266\esp8266.c + esp8266.c + 0 + 0 + + + + + hal + 0 + 0 + 0 + 0 + + 12 + 72 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_uart.c + tos_hal_uart.c + 0 + 0 + + + + + at + 0 + 0 + 0 + 0 + + 13 + 73 + 1 + 0 + 0 + 0 + ..\..\..\..\net\at\src\tos_at.c + tos_at.c + 0 + 0 + + + 13 + 74 + 1 + 0 + 0 + 0 + ..\..\..\..\net\at\src\tos_at_utils.c + tos_at_utils.c + 0 + 0 + + + 13 + 75 + 1 + 0 + 0 + 0 + ..\..\..\..\net\sal_module_wrapper\sal_module_wrapper.c + sal_module_wrapper.c + 0 + 0 + + + + + mqtt + 0 + 0 + 0 + 0 + + 14 + 76 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\wrapper\src\mqtt_wrapper.c + mqtt_wrapper.c + 0 + 0 + + + 14 + 77 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\wrapper\src\transport_wrapper.c + transport_wrapper.c + 0 + 0 + + + 14 + 78 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTConnectClient.c + MQTTConnectClient.c + 0 + 0 + + + 14 + 79 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTConnectServer.c + MQTTConnectServer.c + 0 + 0 + + + 14 + 80 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTDeserializePublish.c + MQTTDeserializePublish.c + 0 + 0 + + + 14 + 81 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTFormat.c + MQTTFormat.c + 0 + 0 + + + 14 + 82 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTPacket.c + MQTTPacket.c + 0 + 0 + + + 14 + 83 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTSerializePublish.c + MQTTSerializePublish.c + 0 + 0 + + + 14 + 84 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTSubscribeClient.c + MQTTSubscribeClient.c + 0 + 0 + + + 14 + 85 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTSubscribeServer.c + MQTTSubscribeServer.c + 0 + 0 + + + 14 + 86 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTUnsubscribeClient.c + MQTTUnsubscribeClient.c + 0 + 0 + + + 14 + 87 + 1 + 0 + 0 + 0 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTUnsubscribeServer.c + MQTTUnsubscribeServer.c + 0 + 0 + + + + + components + 1 + 0 + 0 + 0 + + 15 + 88 + 1 + 0 + 0 + 0 + ..\..\..\..\components\utils\JSON\src\cJSON.c + cJSON.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/board/TencentOS_tiny_EVB_MX/KEIL/sensor_e53_ia1_e2e_demo/TencentOS_tiny.uvprojx b/board/TencentOS_tiny_EVB_MX/KEIL/sensor_e53_ia1_e2e_demo/TencentOS_tiny.uvprojx new file mode 100644 index 00000000..4fe0987a --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX/KEIL/sensor_e53_ia1_e2e_demo/TencentOS_tiny.uvprojx @@ -0,0 +1,910 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + TencentOS_tiny + 0x4 + ARM-ADS + 5060061::V5.06 update 1 (build 61)::ARMCC + + + STM32L431RCTx + STMicroelectronics + Keil.STM32L4xx_DFP.2.2.0 + http://www.keil.com/pack + IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4") + + + + + + + + + + + + + + + $$Device:STM32L431RCTx$CMSIS\SVD\STM32L4x1.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\obj\ + TencentOS_tiny + 1 + 0 + 1 + 1 + 0 + .\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 + 4103 + + 1 + STLink\ST-LINKIII-KEIL_SWO.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 + 2 + 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 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 1 + + + USE_HAL_DRIVER,STM32L431xx + + ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\BSP\Hardware\DHT11;..\..\BSP\Hardware\BH1750;..\..\BSP\Hardware\OLED;..\..\..\..\net\at\include;..\..\..\..\kernel\hal\include;..\..\..\..\net\sal_module_wrapper;..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\wrapper\include;..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\include;..\..\..\..\devices\bc35_28_95;..\..\..\..\devices\esp8266;..\..\..\..\devices\m26;..\..\..\..\components\utils\JSON\include;..\..\BSP\Hardware\E53_IA1;..\..\..\..\examples\sensor_e53_ia1_e2e_demo + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + + + + + + + + + Application/MDK-ARM + + + startup_stm32l431xx.s + 2 + startup_stm32l431xx.s + + + + + Application/User + + + gpio.c + 1 + ..\..\BSP\Src\gpio.c + + + main.c + 1 + ..\..\BSP\Src\main.c + + + mcu_init.c + 1 + ..\..\BSP\Src\mcu_init.c + + + stm32l4xx_hal_msp.c + 1 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + + + usart.c + 1 + ..\..\BSP\Src\usart.c + + + adc.c + 1 + ..\..\BSP\Src\adc.c + + + dac.c + 1 + ..\..\BSP\Src\dac.c + + + i2c.c + 1 + ..\..\BSP\Src\i2c.c + + + spi.c + 1 + ..\..\BSP\Src\spi.c + + + stm32l4xx_it_module.c + 1 + ..\..\BSP\Src\stm32l4xx_it_module.c + + + + + examples + + + e53_ia1_e2e_demo.c + 1 + ..\..\..\..\examples\sensor_e53_ia1_e2e_demo\e53_ia1_e2e_demo.c + + + + + Drivers/STM32L4xx_HAL_Driver + + + stm32l4xx_hal_tim.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + + + stm32l4xx_hal_tim_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + + + stm32l4xx_hal_uart.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + + + stm32l4xx_hal_uart_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + + + stm32l4xx_hal.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + + + stm32l4xx_hal_i2c.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + + + stm32l4xx_hal_i2c_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + + + stm32l4xx_hal_rcc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + + + stm32l4xx_hal_rcc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + + + stm32l4xx_hal_flash.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + + + stm32l4xx_hal_flash_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + + + stm32l4xx_hal_flash_ramfunc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + + + stm32l4xx_hal_gpio.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + + + stm32l4xx_hal_dma.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + + + stm32l4xx_hal_dma_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + + + stm32l4xx_hal_pwr.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + + + stm32l4xx_hal_pwr_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + + + stm32l4xx_hal_cortex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + + + stm32l4xx_hal_adc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + + + stm32l4xx_hal_adc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + + + stm32l4xx_hal_dac.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + + + stm32l4xx_hal_dac_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + + + stm32l4xx_hal_spi.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + + + stm32l4xx_hal_spi_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + + + + + Drivers/CMSIS + + + system_stm32l4xx.c + 1 + ..\..\BSP\Src\system_stm32l4xx.c + + + + + Hardware + + + DHT11_BUS.c + 1 + ..\..\BSP\Hardware\DHT11\DHT11_BUS.c + + + oled.c + 1 + ..\..\BSP\Hardware\OLED\oled.c + + + E53_IA1.c + 1 + ..\..\BSP\Hardware\E53_IA1\E53_IA1.c + + + + + kernel + + + tos_binary_heap.c + 1 + ..\..\..\..\kernel\core\tos_binary_heap.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_sched.c + 1 + ..\..\..\..\kernel\core\tos_sched.c + + + tos_sem.c + 1 + ..\..\..\..\kernel\core\tos_sem.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 + + + + + cpu + + + port_s.S + 2 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + + + 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 + + + + + cmsis + + + cmsis_os.c + 1 + ..\..\..\..\osal\cmsis_os\cmsis_os.c + + + + + config + + + tos_config.h + 5 + ..\..\TOS-CONFIG\tos_config.h + + + + + devices + + + bc35_28_95.c + 1 + ..\..\..\..\devices\bc35_28_95\bc35_28_95.c + + + esp8266.c + 1 + ..\..\..\..\devices\esp8266\esp8266.c + + + + + hal + + + tos_hal_uart.c + 1 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_uart.c + + + + + at + + + tos_at.c + 1 + ..\..\..\..\net\at\src\tos_at.c + + + tos_at_utils.c + 1 + ..\..\..\..\net\at\src\tos_at_utils.c + + + sal_module_wrapper.c + 1 + ..\..\..\..\net\sal_module_wrapper\sal_module_wrapper.c + + + + + mqtt + + + mqtt_wrapper.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\wrapper\src\mqtt_wrapper.c + + + transport_wrapper.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\wrapper\src\transport_wrapper.c + + + MQTTConnectClient.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTConnectClient.c + + + MQTTConnectServer.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTConnectServer.c + + + MQTTDeserializePublish.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTDeserializePublish.c + + + MQTTFormat.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTFormat.c + + + MQTTPacket.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTPacket.c + + + MQTTSerializePublish.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTSerializePublish.c + + + MQTTSubscribeClient.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTSubscribeClient.c + + + MQTTSubscribeServer.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTSubscribeServer.c + + + MQTTUnsubscribeClient.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTUnsubscribeClient.c + + + MQTTUnsubscribeServer.c + 1 + ..\..\..\..\components\connectivity\Eclipse-Paho-MQTT\3rdparty\src\MQTTUnsubscribeServer.c + + + + + components + + + cJSON.c + 1 + ..\..\..\..\components\utils\JSON\src\cJSON.c + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/board/TencentOS_tiny_EVB_MX/KEIL/sensor_e53_ia1_e2e_demo/startup_stm32l431xx.s b/board/TencentOS_tiny_EVB_MX/KEIL/sensor_e53_ia1_e2e_demo/startup_stm32l431xx.s new file mode 100644 index 00000000..05d40343 --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX/KEIL/sensor_e53_ia1_e2e_demo/startup_stm32l431xx.s @@ -0,0 +1,404 @@ +;********************** COPYRIGHT(c) 2017 STMicroelectronics ****************** +;* File Name : startup_stm32l431xx.s +;* Author : MCD Application Team +;* Description : STM32L431xx Ultra Low Power 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 Cortex-M4 processor is in Thread mode, +;* priority is Privileged, and the Stack is set to Main. +;* <<< Use Configuration Wizard in Context Menu >>> +;******************************************************************************* +;* +;* Redistribution and use in source and binary forms, with or without modification, +;* are permitted provided that the following conditions are met: +;* 1. Redistributions of source code must retain the above copyright notice, +;* this list of conditions and the following disclaimer. +;* 2. Redistributions in binary form must reproduce the above copyright notice, +;* this list of conditions and the following disclaimer in the documentation +;* and/or other materials provided with the distribution. +;* 3. Neither the name of STMicroelectronics nor the names of its contributors +;* may be used to endorse or promote products derived from this software +;* without specific prior written permission. +;* +;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;* +;******************************************************************************* +; +; 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 0x400 + + 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 0x100 + + 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/PVM1/PVM2/PVM3/PVM4 through EXTI Line detection + DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line + DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line + DCD FLASH_IRQHandler ; FLASH + DCD RCC_IRQHandler ; RCC + DCD EXTI0_IRQHandler ; EXTI Line0 + DCD EXTI1_IRQHandler ; EXTI Line1 + DCD EXTI2_IRQHandler ; EXTI Line2 + DCD EXTI3_IRQHandler ; EXTI Line3 + DCD EXTI4_IRQHandler ; EXTI Line4 + DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 + DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 + DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 + DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 + DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 + DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 + DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 + DCD ADC1_IRQHandler ; ADC1 + DCD CAN1_TX_IRQHandler ; CAN1 TX + DCD CAN1_RX0_IRQHandler ; CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; CAN1 RX1 + DCD CAN1_SCE_IRQHandler ; CAN1 SCE + DCD EXTI9_5_IRQHandler ; External Line[9:5]s + DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15 + DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 + DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation + DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare + DCD TIM2_IRQHandler ; TIM2 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD I2C1_EV_IRQHandler ; I2C1 Event + DCD I2C1_ER_IRQHandler ; I2C1 Error + DCD I2C2_EV_IRQHandler ; I2C2 Event + DCD I2C2_ER_IRQHandler ; I2C2 Error + DCD SPI1_IRQHandler ; SPI1 + DCD SPI2_IRQHandler ; SPI2 + DCD USART1_IRQHandler ; USART1 + DCD USART2_IRQHandler ; USART2 + DCD USART3_IRQHandler ; USART3 + DCD EXTI15_10_IRQHandler ; External Line[15:10] + DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SDMMC1_IRQHandler ; SDMMC1 + DCD 0 ; Reserved + DCD SPI3_IRQHandler ; SPI3 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors + DCD TIM7_IRQHandler ; TIM7 + DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 + DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 + DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 + DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 + DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD COMP_IRQHandler ; COMP Interrupt + DCD LPTIM1_IRQHandler ; LP TIM1 interrupt + DCD LPTIM2_IRQHandler ; LP TIM2 interrupt + DCD 0 ; Reserved + DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 + DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 + DCD LPUART1_IRQHandler ; LP UART1 interrupt + DCD QUADSPI_IRQHandler ; Quad SPI global interrupt + DCD I2C3_EV_IRQHandler ; I2C3 event + DCD I2C3_ER_IRQHandler ; I2C3 error + DCD SAI1_IRQHandler ; Serial Audio Interface 1 global interrupt + DCD 0 ; Reserved + DCD SWPMI1_IRQHandler ; Serial Wire Interface 1 global interrupt + DCD TSC_IRQHandler ; Touch Sense Controller global interrupt + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD RNG_IRQHandler ; RNG global interrupt + DCD FPU_IRQHandler ; FPU + DCD CRS_IRQHandler ; CRS 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_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 CAN1_TX_IRQHandler [WEAK] + EXPORT CAN1_RX0_IRQHandler [WEAK] + EXPORT CAN1_RX1_IRQHandler [WEAK] + EXPORT CAN1_SCE_IRQHandler [WEAK] + EXPORT EXTI9_5_IRQHandler [WEAK] + EXPORT TIM1_BRK_TIM15_IRQHandler [WEAK] + EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] + EXPORT TIM1_TRG_COM_IRQHandler [WEAK] + EXPORT TIM1_CC_IRQHandler [WEAK] + EXPORT TIM2_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 USART3_IRQHandler [WEAK] + EXPORT EXTI15_10_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT SDMMC1_IRQHandler [WEAK] + EXPORT SPI3_IRQHandler [WEAK] + EXPORT TIM6_DAC_IRQHandler [WEAK] + EXPORT TIM7_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 COMP_IRQHandler [WEAK] + EXPORT LPTIM1_IRQHandler [WEAK] + EXPORT LPTIM2_IRQHandler [WEAK] + EXPORT DMA2_Channel6_IRQHandler [WEAK] + EXPORT DMA2_Channel7_IRQHandler [WEAK] + EXPORT LPUART1_IRQHandler [WEAK] + EXPORT QUADSPI_IRQHandler [WEAK] + EXPORT I2C3_EV_IRQHandler [WEAK] + EXPORT I2C3_ER_IRQHandler [WEAK] + EXPORT SAI1_IRQHandler [WEAK] + EXPORT SWPMI1_IRQHandler [WEAK] + EXPORT TSC_IRQHandler [WEAK] + EXPORT RNG_IRQHandler [WEAK] + EXPORT FPU_IRQHandler [WEAK] + EXPORT CRS_IRQHandler [WEAK] + +WWDG_IRQHandler +PVD_PVM_IRQHandler +TAMP_STAMP_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 +CAN1_TX_IRQHandler +CAN1_RX0_IRQHandler +CAN1_RX1_IRQHandler +CAN1_SCE_IRQHandler +EXTI9_5_IRQHandler +TIM1_BRK_TIM15_IRQHandler +TIM1_UP_TIM16_IRQHandler +TIM1_TRG_COM_IRQHandler +TIM1_CC_IRQHandler +TIM2_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +I2C2_EV_IRQHandler +I2C2_ER_IRQHandler +SPI1_IRQHandler +SPI2_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +USART3_IRQHandler +EXTI15_10_IRQHandler +RTC_Alarm_IRQHandler +SDMMC1_IRQHandler +SPI3_IRQHandler +TIM6_DAC_IRQHandler +TIM7_IRQHandler +DMA2_Channel1_IRQHandler +DMA2_Channel2_IRQHandler +DMA2_Channel3_IRQHandler +DMA2_Channel4_IRQHandler +DMA2_Channel5_IRQHandler +COMP_IRQHandler +LPTIM1_IRQHandler +LPTIM2_IRQHandler +DMA2_Channel6_IRQHandler +DMA2_Channel7_IRQHandler +LPUART1_IRQHandler +QUADSPI_IRQHandler +I2C3_EV_IRQHandler +I2C3_ER_IRQHandler +SAI1_IRQHandler +SWPMI1_IRQHandler +TSC_IRQHandler +RNG_IRQHandler +FPU_IRQHandler +CRS_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***** diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/ONCHIP_FLASH/onchip_flash.c b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/ONCHIP_FLASH/onchip_flash.c new file mode 100644 index 00000000..1e3327ff --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/ONCHIP_FLASH/onchip_flash.c @@ -0,0 +1,78 @@ +#include "tos_kv.h" +#include "stm32l4xx.h" + +#define ONCHIP_FLASH_ADDR_START 0x08000000 // start address for onchip flash for stm32l431RCTX +#define ONCHIP_FLASH_ADDR_MAX 0x0803FFFF // 256K flash addr for stm32l431RCTX + +#define SECTOR_SIZE 2048 // sector size for stm32l431RCTX +#define SECTOR_SIZE_LOG2 11 // 2 ^ 11 = 2048 + +#define FOR_KV_FLASH_SIZE (2 * SECTOR_SIZE) // storage for kv +#define FOR_KV_FLASH_START 0x803d000 + +int stm32l4_norflash_onchip_read(uint32_t addr, void *buf, size_t len) +{ + memcpy(buf, (void *)addr, len); + return 0; +} + +int stm32l4_norflash_onchip_write(uint32_t addr, const void *buf, size_t len) +{ + int i = 0; + uint8_t *array = (uint8_t *)buf; + HAL_StatusTypeDef hal_status; + + HAL_FLASH_Unlock(); + tos_cpu_int_disable(); + + for (i = 0; i < len; i += 8) { + hal_status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, + addr + i, + *(uint64_t *)&array[i]); + if (hal_status != HAL_OK) { + return -1; + } + } + + HAL_FLASH_Lock(); + tos_cpu_int_enable(); + + return 0; +} + +int stm32l4_norflash_onchip_erase(uint32_t addr, size_t size) +{ + uint32_t page_err = 0; + HAL_StatusTypeDef hal_status; + FLASH_EraseInitTypeDef erase_para; + + erase_para.TypeErase = FLASH_TYPEERASE_PAGES; + erase_para.Banks = FLASH_BANK_1; + erase_para.Page = addr / SECTOR_SIZE; + erase_para.NbPages = size / SECTOR_SIZE; + HAL_FLASH_Unlock(); + tos_cpu_int_disable(); + hal_status = HAL_FLASHEx_Erase(&erase_para, &page_err); + HAL_FLASH_Lock(); + tos_cpu_int_enable(); + + if (hal_status != HAL_OK) { + return -1; + } + + return 0; +} + +kv_flash_drv_t stm32l4_norflash_onchip_drv = { + .write = stm32l4_norflash_onchip_write, + .read = stm32l4_norflash_onchip_read, + .erase = stm32l4_norflash_onchip_erase, +}; + +kv_flash_prop_t stm32l4_norflash_onchip_prop = { + .sector_size_log2 = SECTOR_SIZE_LOG2, + .pgm_type = KV_FLASH_PROGRAM_TYPE_DOUBLEWORD, + .flash_start = FOR_KV_FLASH_START, + .flash_size = FOR_KV_FLASH_SIZE, +}; + diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/QSPI_FLASH/hal_qspi_flash.c b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/QSPI_FLASH/hal_qspi_flash.c new file mode 100644 index 00000000..d3f7a3a9 --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/QSPI_FLASH/hal_qspi_flash.c @@ -0,0 +1,407 @@ +#include "hal_qspi_flash.h" +#include "stm32l4xx.h" + +#ifdef HAL_QSPI_MODULE_ENABLED + +#define QSPI_FLASH_PAGESIZE 256 +#define QSPI_FLASH_SECTOR 4096 +#define QSPI_FLASH_ID 0xEF4017 +#define QSPI_FLASH_TOTAL_SIZE 0x7FFFFF + +#define QSPI_FLASH_WriteEnable 0x06 +#define QSPI_FLASH_WriteDisable 0x04 +#define QSPI_FLASH_ReadStatusReg 0x05 +#define QSPI_FLASH_WriteStatusReg 0x01 +#define QSPI_FLASH_ReadData 0x03 +#define QSPI_FLASH_FastReadData 0x0B +#define QSPI_FLASH_FastReadDual 0x3B +#define QSPI_FLASH_PageProgram 0x02 +#define QSPI_FLASH_BlockErase 0xD8 +#define QSPI_FLASH_SectorErase 0x20 +#define QSPI_FLASH_ChipErase 0xC7 +#define QSPI_FLASH_PowerDown 0xB9 +#define QSPI_FLASH_ReleasePowerDown 0xAB +#define QSPI_FLASH_DeviceID 0xAB +#define QSPI_FLASH_ManufactDeviceID 0x90 +#define QSPI_FLASH_JedecDeviceID 0x9F +#define QSPI_FLASH_WIP_FLAG 0x01 +#define QSPI_FLASH_DUMMY_BYTE 0xFF + +#define CHOOSE_BIT_16 16 +#define CHOOSE_BIT_8 8 + + +#define CHECK_RET_RETURN(ret) \ + do \ + { \ + if ((ret) < 0) \ + { \ + return ret; \ + } \ + } while (0) + +extern QSPI_HandleTypeDef hqspi; + +/* This function is called by inner-HAL lib */ +static void HAL_QSPI_MspInit(QSPI_HandleTypeDef* qspiHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct; + if(qspiHandle->Instance==QUADSPI) + { + /* USER CODE BEGIN QUADSPI_MspInit 0 */ + + /* USER CODE END QUADSPI_MspInit 0 */ + /* QUADSPI clock enable */ + __HAL_RCC_QSPI_CLK_ENABLE(); + + /**QUADSPI GPIO Configuration + PB0 ------> QUADSPI_BK1_IO1 + PB1 ------> QUADSPI_BK1_IO0 + PB10 ------> QUADSPI_CLK + PB11 ------> QUADSPI_BK1_NCS + */ + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_10|GPIO_PIN_11; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN QUADSPI_MspInit 1 */ + + /* USER CODE END QUADSPI_MspInit 1 */ + } +} + +/* This function is called by inner-HAL lib */ +static void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef* qspiHandle) +{ + + if(qspiHandle->Instance==QUADSPI) + { + /* USER CODE BEGIN QUADSPI_MspDeInit 0 */ + + /* USER CODE END QUADSPI_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_QSPI_CLK_DISABLE(); + + /**QUADSPI GPIO Configuration + PB0 ------> QUADSPI_BK1_IO1 + PB1 ------> QUADSPI_BK1_IO0 + PB10 ------> QUADSPI_CLK + PB11 ------> QUADSPI_BK1_NCS + */ + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_10|GPIO_PIN_11); + + /* USER CODE BEGIN QUADSPI_MspDeInit 1 */ + + /* USER CODE END QUADSPI_MspDeInit 1 */ + } +} + + +/** + * @brief QSPI + * + * @param instruction Ҫ͵ָ + * @param address ͵Ŀĵַ + * @param dummyCycles ָ + * @param instructionMode ָģʽ;QSPI_INSTRUCTION_NONE,QSPI_INSTRUCTION_1_LINE,QSPI_INSTRUCTION_2_LINE,QSPI_INSTRUCTION_4_LINE + * @param addressMode ַģʽ; QSPI_ADDRESS_NONE,QSPI_ADDRESS_1_LINE,QSPI_ADDRESS_2_LINE,QSPI_ADDRESS_4_LINE + * @param addressSize ַ;QSPI_ADDRESS_8_BITS,QSPI_ADDRESS_16_BITS,QSPI_ADDRESS_24_BITS,QSPI_ADDRESS_32_BITS + * @param dataMode ģʽ; QSPI_DATA_NONE,QSPI_DATA_1_LINE,QSPI_DATA_2_LINE,QSPI_DATA_4_LINE + * + * @return void + */ +uint32_t QSPI_Send_CMD(uint32_t instruction, uint32_t address, uint32_t dummyCycles, uint32_t instructionMode, uint32_t addressMode, uint32_t addressSize, uint32_t dataMode) +{ + QSPI_CommandTypeDef s_command; + + s_command.Instruction = instruction; //ָ + s_command.Address = address; //ַ + s_command.DummyCycles = dummyCycles; //ÿָ + s_command.InstructionMode = instructionMode; //ָģʽ + s_command.AddressMode = addressMode; //ַģʽ + s_command.AddressSize = addressSize; //ַ + s_command.DataMode = dataMode; //ģʽ + s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD; //ÿζָ + s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE; //޽ֽ + s_command.DdrMode = QSPI_DDR_MODE_DISABLE; //رDDRģʽ + s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY; + + return HAL_QSPI_Command(&hqspi, &s_command, 5000); +} + +uint8_t QSPI_Receive(const uint8_t * buf, uint32_t datalen) +{ + hqspi.Instance->DLR = datalen - 1; //Configuration data length + if(HAL_QSPI_Receive(&hqspi, (uint8_t * )buf, 5000) == HAL_OK) return 0; //receive data + + else return 1; +} + +uint8_t QSPI_Transmit(const int8_t * buf, uint32_t datalen) +{ + hqspi.Instance->DLR = datalen - 1; //Configuration data length + if(HAL_QSPI_Transmit(&hqspi, (uint8_t * )buf, 5000) == HAL_OK) return 0; //send data + + else return 1; +} + +static void prv_spi_flash_write_enable(void) +{ + QSPI_Send_CMD(QSPI_FLASH_WriteEnable, 0, 0, QSPI_INSTRUCTION_1_LINE, QSPI_ADDRESS_NONE, QSPI_ADDRESS_8_BITS, QSPI_DATA_NONE); +} + +static void prv_spi_flash_wait_write_end(void) +{ + uint8_t status = 0; + + + /* Loop as long as the memory is busy with a write cycle */ + do + { + /* Send a dummy byte to generate the clock needed by the FLASH + and put the value of the status register in status variable */ + QSPI_Send_CMD(QSPI_FLASH_ReadStatusReg, 0, 0, QSPI_INSTRUCTION_1_LINE, QSPI_ADDRESS_NONE, QSPI_ADDRESS_8_BITS, QSPI_DATA_1_LINE); + QSPI_Receive(&status, 1); + + } while ((status & QSPI_FLASH_WIP_FLAG) == SET); /* Write in progress */ + +} + +static int prv_spi_flash_write_page(const uint8_t* buf, uint32_t addr, int32_t len) +{ + int ret = 0; + + if(0 == len) + { + return 0; + } + + prv_spi_flash_write_enable(); //Write enable + + QSPI_Send_CMD(QSPI_FLASH_PageProgram, addr, 0, QSPI_INSTRUCTION_1_LINE, QSPI_ADDRESS_1_LINE, QSPI_ADDRESS_24_BITS, QSPI_DATA_1_LINE); + QSPI_Transmit((const int8_t *)buf, len); + + prv_spi_flash_wait_write_end(); //Waiting for Writing to End + + return ret; +} + + int prv_spi_flash_erase_sector(uint32_t addr) +{ + //printf("fe:%x\r\n",addr); //flash, + int ret = 0; + prv_spi_flash_write_enable(); //Write enable + prv_spi_flash_wait_write_end(); + + ret=QSPI_Send_CMD(QSPI_FLASH_SectorErase, addr, 0, QSPI_INSTRUCTION_1_LINE, QSPI_ADDRESS_1_LINE, QSPI_ADDRESS_24_BITS, QSPI_DATA_NONE); + + prv_spi_flash_wait_write_end(); //Waiting for Writing to End + + return ret; +} + +void hal_spi_flash_config(void) +{ + hqspi.Instance = QUADSPI; + hqspi.Init.ClockPrescaler = 0; + hqspi.Init.FifoThreshold = 4; + hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE; + hqspi.Init.FlashSize = POSITION_VAL(0x1000000) - 1; + hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_4_CYCLE; + hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0; + hqspi.Init.FlashID = QSPI_FLASH_ID_1; + hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE; + if (HAL_QSPI_Init(&hqspi) != HAL_OK) + { + Error_Handler(); + } + +} + +int hal_spi_flash_erase(uint32_t addr, int32_t len) +{ + uint32_t begin; + uint32_t end; + int i; + + if (len < 0 + || addr > QSPI_FLASH_TOTAL_SIZE + || addr + len > QSPI_FLASH_TOTAL_SIZE) + { + return -1; + } + + begin = addr / QSPI_FLASH_SECTOR * QSPI_FLASH_SECTOR; + end = (addr + len - 1) / QSPI_FLASH_SECTOR * QSPI_FLASH_SECTOR; + + for (i = begin; i <= end; i += QSPI_FLASH_SECTOR) + { + if (prv_spi_flash_erase_sector(i) == -1) + { + return -1; + } + } + + return 0; +} + +int hal_spi_flash_write(const void* buf, int32_t len, uint32_t* location) +{ + const uint8_t* pbuf = (const uint8_t*)buf; + int page_cnt = 0; + int remain_cnt = 0; + int temp = 0; + uint32_t loc_addr; + uint8_t addr = 0; + uint8_t count = 0; + int i; + int ret = 0; + + if (NULL == pbuf + || NULL == location + || len < 0 + || *location > QSPI_FLASH_TOTAL_SIZE + || len + *location > QSPI_FLASH_TOTAL_SIZE) + { + return -1; + } + + loc_addr = *location; + addr = loc_addr % QSPI_FLASH_PAGESIZE; + count = QSPI_FLASH_PAGESIZE - addr; + page_cnt = len / QSPI_FLASH_PAGESIZE; + remain_cnt = len % QSPI_FLASH_PAGESIZE; + + if (addr == 0) /* addr is aligned to SPI_FLASH_PAGESIZE */ + { + if (page_cnt == 0) /* len < SPI_FLASH_PAGESIZE */ + { + ret = prv_spi_flash_write_page(pbuf, loc_addr, len); + CHECK_RET_RETURN(ret); + } + else /* len > SPI_FLASH_PAGESIZE */ + { + for (i = 0; i < page_cnt; ++i) + { + ret = prv_spi_flash_write_page(pbuf + i * QSPI_FLASH_PAGESIZE, loc_addr, QSPI_FLASH_PAGESIZE); + CHECK_RET_RETURN(ret); + loc_addr += QSPI_FLASH_PAGESIZE; + } + + ret = prv_spi_flash_write_page(pbuf + page_cnt * QSPI_FLASH_PAGESIZE, loc_addr, remain_cnt); + CHECK_RET_RETURN(ret); + } + } + else /* addr is not aligned to SPI_FLASH_PAGESIZE */ + { + if (page_cnt == 0) /* len < SPI_FLASH_PAGESIZE */ + { + if (remain_cnt > count) /* (len + loc_addr) > SPI_FLASH_PAGESIZE */ + { + temp = remain_cnt - count; + + ret = prv_spi_flash_write_page(pbuf, loc_addr, count); + CHECK_RET_RETURN(ret); + + ret = prv_spi_flash_write_page(pbuf + count, loc_addr + count, temp); + CHECK_RET_RETURN(ret); + } + else + { + ret = prv_spi_flash_write_page(pbuf, loc_addr, len); + CHECK_RET_RETURN(ret); + } + } + else /* len > SPI_FLASH_PAGESIZE */ + { + len -= count; + page_cnt = len / QSPI_FLASH_PAGESIZE; + remain_cnt = len % QSPI_FLASH_PAGESIZE; + + ret = prv_spi_flash_write_page(pbuf, loc_addr, count); + CHECK_RET_RETURN(ret); + loc_addr += count; + + for (i = 0; i < page_cnt; ++i) + { + ret = prv_spi_flash_write_page(pbuf + count + i * QSPI_FLASH_PAGESIZE, loc_addr, QSPI_FLASH_PAGESIZE); + CHECK_RET_RETURN(ret); + loc_addr += QSPI_FLASH_PAGESIZE; + } + + if (remain_cnt != 0) + { + ret = prv_spi_flash_write_page(pbuf + count + page_cnt * QSPI_FLASH_PAGESIZE, loc_addr, remain_cnt); + CHECK_RET_RETURN(ret); + } + } + } + + *location += len; + return ret; + +} + +int hal_spi_flash_erase_write(const void* buf, int32_t len, uint32_t location) +{ + int ret = 0; + + ret = hal_spi_flash_erase(location, len); + CHECK_RET_RETURN(ret); + ret = hal_spi_flash_write(buf, len, &location); + + return ret; +} + +int hal_spi_flash_read(void* buf, int32_t len, uint32_t location) +{ + int ret = 0; + uint8_t* pbuf = (uint8_t*)buf; + + if (NULL == pbuf + || len < 0 + || location > QSPI_FLASH_TOTAL_SIZE + || len + location > QSPI_FLASH_TOTAL_SIZE) + { + return -1; + } + + QSPI_Send_CMD(QSPI_FLASH_FastReadData, location, 8, QSPI_INSTRUCTION_1_LINE, QSPI_ADDRESS_1_LINE, QSPI_ADDRESS_24_BITS, QSPI_DATA_1_LINE); + QSPI_Receive(buf, len); + + return ret; + +} + +int hal_spi_flash_get_id(void) +{ + QSPI_CommandTypeDef s_command; + uint8_t temp[3]; + uint32_t deviceid; + + s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE; + s_command.Instruction = QSPI_FLASH_JedecDeviceID; + s_command.AddressMode = QSPI_ADDRESS_1_LINE; + s_command.AddressSize = QSPI_ADDRESS_24_BITS; + s_command.DataMode = QSPI_DATA_1_LINE; + s_command.AddressMode = QSPI_ADDRESS_NONE; + s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE; + s_command.DummyCycles = 0; + s_command.NbData = 3; + s_command.DdrMode = QSPI_DDR_MODE_DISABLE; + s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY; + s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD; + + HAL_QSPI_Command(&hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE); + + QSPI_Receive(temp, 3); + deviceid = (temp[1]<<8)|( temp[0]<<16)|(temp[2]); + return deviceid; +} + + +#endif /* HAL_QSPI_MODULE_ENABLED */ diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/QSPI_FLASH/hal_qspi_flash.h b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/QSPI_FLASH/hal_qspi_flash.h new file mode 100644 index 00000000..9cd2639f --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/QSPI_FLASH/hal_qspi_flash.h @@ -0,0 +1,23 @@ +#ifndef __HAL_SPI_FLASH_H__ +#define __HAL_SPI_FLASH_H__ + +#include + +void hal_spi_flash_config(void); + +int hal_spi_flash_erase(uint32_t addr, int32_t len); + +int hal_spi_flash_write(const void* buf, int32_t len, uint32_t* location); + +int hal_spi_flash_erase_write(const void* buf, int32_t len, uint32_t location); + +int hal_spi_flash_read(void* buf, int32_t len, uint32_t location); + +int hal_spi_flash_get_id(void); + +void hal_spi_flash_power_down(void); + +void hal_spi_flash_wake_up(void); + +#endif /* _HAL_SPI_FLASH_H_ */ + diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/QSPI_FLASH/qspi_flash_kv.c b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/QSPI_FLASH/qspi_flash_kv.c new file mode 100644 index 00000000..9968c8ee --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Hardware/QSPI_FLASH/qspi_flash_kv.c @@ -0,0 +1,40 @@ +#include "tos_kv.h" +#include "hal_qspi_flash.h" + +#define SECTOR_SIZE 4096 // sector size for qspiflash +#define SECTOR_SIZE_LOG2 12 // 2 ^ 12 = 4096 + +#define FOR_KV_FLASH_SIZE (2 * SECTOR_SIZE) +#define FOR_KV_FLASH_START 0x0 + +int stm32l4_qspiflash_read(uint32_t addr, void *buf, size_t len) +{ + return hal_spi_flash_read(buf, len, addr); +} + +int stm32l4_qspiflash_write(uint32_t addr, const void *buf, size_t len) +{ + uint32_t location = addr; + + return hal_spi_flash_write(buf, len, &location); +} + +int stm32l4_qspiflash_erase(uint32_t addr, size_t size) +{ + return hal_spi_flash_erase(addr, size); +} + +kv_flash_drv_t stm32l4_qspiflash_drv = { + .write = stm32l4_qspiflash_write, + .read = stm32l4_qspiflash_read, + .erase = stm32l4_qspiflash_erase, +}; + +kv_flash_prop_t stm32l4_qspiflash_prop = { + .sector_size_log2 = SECTOR_SIZE_LOG2, + .pgm_type = KV_FLASH_PROGRAM_TYPE_BYTE, + .flash_start = FOR_KV_FLASH_START, + .flash_size = FOR_KV_FLASH_SIZE, +}; + + diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/quadspi.h b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/quadspi.h new file mode 100644 index 00000000..27e5be59 --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/quadspi.h @@ -0,0 +1,79 @@ +/** + ****************************************************************************** + * File Name : QUADSPI.h + * Description : This file provides code for the configuration + * of the QUADSPI instances. + ****************************************************************************** + ** This notice applies to any and all portions of this file + * that are not between comment pairs USER CODE BEGIN and + * USER CODE END. Other portions of this file, whether + * inserted by the user or by software development tools + * are owned by their respective copyright owners. + * + * COPYRIGHT(c) 2019 STMicroelectronics + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __quadspi_H +#define __quadspi_H +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32l4xx_hal.h" +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern QSPI_HandleTypeDef hqspi; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_QUADSPI_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif +#endif /*__ quadspi_H */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/stm32l4xx_hal_conf.h b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/stm32l4xx_hal_conf.h index b877f4ad..8c41790a 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/stm32l4xx_hal_conf.h +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/stm32l4xx_hal_conf.h @@ -78,7 +78,7 @@ /*#define HAL_OSPI_MODULE_ENABLED */ /*#define HAL_PCD_MODULE_ENABLED */ /*#define HAL_QSPI_MODULE_ENABLED */ -/*#define HAL_QSPI_MODULE_ENABLED */ +#define HAL_QSPI_MODULE_ENABLED /*#define HAL_RNG_MODULE_ENABLED */ #define HAL_RTC_MODULE_ENABLED /*#define HAL_SAI_MODULE_ENABLED */ diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/quadspi.c b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/quadspi.c new file mode 100644 index 00000000..9e4a004f --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/quadspi.c @@ -0,0 +1,139 @@ +/** + ****************************************************************************** + * File Name : QUADSPI.c + * Description : This file provides code for the configuration + * of the QUADSPI instances. + ****************************************************************************** + ** This notice applies to any and all portions of this file + * that are not between comment pairs USER CODE BEGIN and + * USER CODE END. Other portions of this file, whether + * inserted by the user or by software development tools + * are owned by their respective copyright owners. + * + * COPYRIGHT(c) 2019 STMicroelectronics + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "quadspi.h" + +#include "gpio.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +QSPI_HandleTypeDef hqspi; + +/* QUADSPI init function */ +void MX_QUADSPI_Init(void) +{ + + hqspi.Instance = QUADSPI; + hqspi.Init.ClockPrescaler = 0; + hqspi.Init.FifoThreshold = 4; + hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE; + hqspi.Init.FlashSize = 25; + hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_4_CYCLE; + hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0; + hqspi.Init.FlashID = QSPI_FLASH_ID_1; + hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE; + if (HAL_QSPI_Init(&hqspi) != HAL_OK) + { + return; + } + +} + +void HAL_QSPI_MspInit(QSPI_HandleTypeDef* qspiHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct; + if(qspiHandle->Instance==QUADSPI) + { + /* USER CODE BEGIN QUADSPI_MspInit 0 */ + + /* USER CODE END QUADSPI_MspInit 0 */ + /* QUADSPI clock enable */ + __HAL_RCC_QSPI_CLK_ENABLE(); + + /**QUADSPI GPIO Configuration + PB0 ------> QUADSPI_BK1_IO1 + PB1 ------> QUADSPI_BK1_IO0 + PB10 ------> QUADSPI_CLK + PB11 ------> QUADSPI_BK1_NCS + */ + GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_10|GPIO_PIN_11; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN QUADSPI_MspInit 1 */ + + /* USER CODE END QUADSPI_MspInit 1 */ + } +} + +void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef* qspiHandle) +{ + + if(qspiHandle->Instance==QUADSPI) + { + /* USER CODE BEGIN QUADSPI_MspDeInit 0 */ + + /* USER CODE END QUADSPI_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_QSPI_CLK_DISABLE(); + + /**QUADSPI GPIO Configuration + PB0 ------> QUADSPI_BK1_IO1 + PB1 ------> QUADSPI_BK1_IO0 + PB10 ------> QUADSPI_CLK + PB11 ------> QUADSPI_BK1_NCS + */ + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_10|GPIO_PIN_11); + + /* USER CODE BEGIN QUADSPI_MspDeInit 1 */ + + /* USER CODE END QUADSPI_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/DebugConfig/TencentOS_tiny_STM32L431RCTx.dbgconf b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/DebugConfig/TencentOS_tiny_STM32L431RCTx.dbgconf new file mode 100644 index 00000000..c9811753 --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/DebugConfig/TencentOS_tiny_STM32L431RCTx.dbgconf @@ -0,0 +1,97 @@ +// File: STM32L43x_44x_45x_46x.dbgconf +// Version: 1.0.0 +// Note: refer to STM32L43xxx STM32L44xxx STM32L45xxx STM32L46xxx Reference manual (RM0394) +// refer to STM32L431xx, STM32L432xx, STM32L433xx, STM32L442xx, STM32L443xx, STM32L451xx, STM32L452xx, STM32L462xx datasheets + +// <<< Use Configuration Wizard in Context Menu >>> + +// Debug MCU configuration register (DBGMCU_CR) +// DBG_STANDBY +// Debug Standby mode +// 0: (FCLK=Off, HCLK=Off) The whole digital part is unpowered. +// 1: (FCLK=On, HCLK=On) The digital part is not unpowered and FCLK and HCLK are provided by the internal RC oscillator which remains active +// DBG_STOP +// Debug Stop mode +// 0: (FCLK=Off, HCLK=Off) In STOP mode, the clock controller disables all clocks (including HCLK and FCLK). +// 1: (FCLK=On, HCLK=On) When entering STOP mode, FCLK and HCLK are provided by the internal RC oscillator which remains active in STOP mode. +// DBG_SLEEP +// Debug Sleep mode +// 0: (FCLK=On, HCLK=Off) In Sleep mode, FCLK is clocked by the system clock as previously configured by the software while HCLK is disabled. +// 1: (FCLK=On, HCLK=On) When entering Sleep mode, HCLK is fed by the same clock that is provided to FCLK (system clock as previously configured by the software). +// +DbgMCU_CR = 0x00000007; + +// Debug MCU APB1 freeze register1 (DBGMCU_APB1FZR1) +// DBG_LPTIM1_STOP +// LPTIM1 counter stopped when core is halted +// 0: The counter clock of LPTIM1 is fed even if the core is halted +// 1: The counter clock of LPTIM1 is stopped when the core is halted +// DBG_CAN_STOP +// bxCAN1 stopped when core is halted +// 0: Same behavior as in normal mode +// 1: The bxCAN1 receive registers are frozen +// DBG_I2C3_STOP +// I2C3 SMBUS timeout counter stopped when core is halted +// 0: Same behavior as in normal mode +// 1: The I2C3 SMBus timeout is frozen +// DBG_I2C2_STOP +// I2C2 SMBUS timeout counter stopped when core is halted +// 0: Same behavior as in normal mode +// 1: The I2C2 SMBus timeout is frozen +// DBG_I2C1_STOP +// I2C1 SMBUS timeout counter stopped when core is halted +// 0: Same behavior as in normal mode +// 1: The I2C1 SMBus timeout is frozen +// DBG_IWDG_STOP +// Independent watchdog counter stopped when core is halted +// 0: The independent watchdog counter clock continues even if the core is halted +// 1: The independent watchdog counter clock is stopped when the core is halted +// DBG_WWDG_STOP +// Window watchdog counter stopped when core is halted +// 0: The window watchdog counter clock continues even if the core is halted +// 1: The window watchdog counter clock is stopped when the core is halted +// DBG_RTC_STOP +// RTC counter stopped when core is halted +// 0: The clock of the RTC counter is fed even if the core is halted +// 1: The clock of the RTC counter is stopped when the core is halted +// DBG_TIM7_STOP +// TIM7 counter stopped when core is halted +// 0: The counter clock of TIM7 is fed even if the core is halted +// 1: The counter clock of TIM7 is stopped when the core is halted +// DBG_TIM6_STOP +// TIM6 counter stopped when core is halted +// 0: The counter clock of TIM6 is fed even if the core is halted +// 1: The counter clock of TIM6 is stopped when the core is halted +// DBG_TIM2_STOP +// TIM2 counter stopped when core is halted +// 0: The counter clock of TIM2 is fed even if the core is halted +// 1: The counter clock of TIM2 is stopped when the core is halted +// +DbgMCU_APB1_Fz1 = 0x00000000; + +// Debug MCU APB1 freeze register 2 (DBGMCU_APB1FZR2) +// DBG_LPTIM2_STOP +// LPTIM2 counter stopped when core is halted +// 0: The counter clock of LPTIM2 is fed even if the core is halted +// 1: The counter clock of LPTIM2 is stopped when the core is halted +// +DbgMCU_APB1_Fz2 = 0x00000000; + +// Debug MCU APB2 freeze register (DBGMCU_APB2FZR) +// DBG_TIM16_STOP +// TIM16 counter stopped when core is halted +// 0: The clock of the TIM16 counter is fed even if the core is halted +// 1: The clock of the TIM16 counter is stopped when the core is halted +// DBG_TIM15_STOP +// TIM15 counter stopped when core is halted +// 0: The clock of the TIM15 counter is fed even if the core is halted +// 1: The clock of the TIM15 counter is stopped when the core is halted +// DBG_TIM1_STOP +// TIM1 counter stopped when core is halted +// 0: The clock of the TIM1 counter is fed even if the core is halted +// 1: The clock of the TIM1 counter is stopped when the core is halted +// +DbgMCU_APB2_Fz = 0x00000000; +// + +// <<< end of configuration section >>> \ No newline at end of file diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/EventRecorderStub.scvd b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/EventRecorderStub.scvd new file mode 100644 index 00000000..2956b296 --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/EventRecorderStub.scvd @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/board/NUCLEO_STM32L073RZ/KEIL/lorawan/RTE/_TencentOS_tiny/RTE_Components.h b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/RTE/_TencentOS_tiny/RTE_Components.h similarity index 87% rename from board/NUCLEO_STM32L073RZ/KEIL/lorawan/RTE/_TencentOS_tiny/RTE_Components.h rename to board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/RTE/_TencentOS_tiny/RTE_Components.h index 4b2a0396..45b7722b 100644 --- a/board/NUCLEO_STM32L073RZ/KEIL/lorawan/RTE/_TencentOS_tiny/RTE_Components.h +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/RTE/_TencentOS_tiny/RTE_Components.h @@ -14,7 +14,7 @@ /* * Define the Device Header File: */ -#define CMSIS_device_header "stm32l0xx.h" +#define CMSIS_device_header "stm32l4xx.h" #endif /* RTE_COMPONENTS_H */ diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/TencentOS_tiny.uvoptx b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/TencentOS_tiny.uvoptx new file mode 100644 index 00000000..6257b01e --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/TencentOS_tiny.uvoptx @@ -0,0 +1,1252 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + TencentOS_tiny + 0x4 + ARM-ADS + + 80000000 + + 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 + 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 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256 -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM)) + + + 0 + ST-LINKIII-KEIL_SWO + -U303030303030303030303031 -O10446 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM) + + + + + 0 + 0 + 1037 + 1 +
134238752
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\..\..\..\components\fs\kv\tos_kv.c + + \\TencentOS_tiny\../../../../components/fs/kv/tos_kv.c\1037 +
+ + 1 + 0 + 770 + 1 +
134234982
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\..\..\..\components\fs\kv\tos_kv.c + + \\TencentOS_tiny\../../../../components/fs/kv/tos_kv.c\770 +
+
+ + + 0 + 1 + item_hdr + + + + + 1 + 0 + 0x803d000 + 0 + + + + + 2 + 0 + 0x803d000 + 2048 + 0 + + + + + 3 + 0 + 0x803d000 + 2048 * 2 + 0 + + + + 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 + + + + + + + + + + 1 + 1 + 0 + 2 + 10000000 + +
+
+ + + Application/MDK-ARM + 0 + 0 + 0 + 0 + + 1 + 1 + 2 + 0 + 0 + 0 + startup_stm32l431xx.s + startup_stm32l431xx.s + 0 + 0 + + + + + Application/User + 0 + 0 + 0 + 0 + + 2 + 2 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\gpio.c + gpio.c + 0 + 0 + + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\main.c + main.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\mcu_init.c + mcu_init.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + stm32l4xx_hal_msp.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_it.c + stm32l4xx_it.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\usart.c + usart.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\adc.c + adc.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\dac.c + dac.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\i2c.c + i2c.c + 0 + 0 + + + 2 + 11 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\spi.c + spi.c + 0 + 0 + + + 2 + 12 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\quadspi.c + quadspi.c + 0 + 0 + + + + + examples + 0 + 0 + 0 + 0 + + 3 + 13 + 1 + 0 + 0 + 0 + ..\..\..\..\examples\kv\kv_sample.c + kv_sample.c + 0 + 0 + + + + + Drivers/STM32L4xx_HAL_Driver + 0 + 0 + 0 + 0 + + 4 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + stm32l4xx_hal_tim.c + 0 + 0 + + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + stm32l4xx_hal_tim_ex.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + stm32l4xx_hal_uart.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + stm32l4xx_hal_uart_ex.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + stm32l4xx_hal.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + stm32l4xx_hal_i2c.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + stm32l4xx_hal_i2c_ex.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + stm32l4xx_hal_rcc.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + stm32l4xx_hal_rcc_ex.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + stm32l4xx_hal_flash.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + stm32l4xx_hal_flash_ex.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + stm32l4xx_hal_flash_ramfunc.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + stm32l4xx_hal_gpio.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + stm32l4xx_hal_dma.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + stm32l4xx_hal_dma_ex.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + stm32l4xx_hal_pwr.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + stm32l4xx_hal_pwr_ex.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + stm32l4xx_hal_cortex.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + stm32l4xx_hal_adc_ex.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + stm32l4xx_hal_adc.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + stm32l4xx_hal_dac.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + stm32l4xx_hal_dac_ex.c + 0 + 0 + + + 4 + 36 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + stm32l4xx_hal_spi.c + 0 + 0 + + + 4 + 37 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + stm32l4xx_hal_spi_ex.c + 0 + 0 + + + 4 + 38 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_qspi.c + stm32l4xx_hal_qspi.c + 0 + 0 + + + + + Drivers/CMSIS + 0 + 0 + 0 + 0 + + 5 + 39 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\system_stm32l4xx.c + system_stm32l4xx.c + 0 + 0 + + + + + Hardware + 0 + 0 + 0 + 0 + + 6 + 40 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\ONCHIP_FLASH\onchip_flash.c + onchip_flash.c + 0 + 0 + + + 6 + 41 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\QSPI_FLASH\hal_qspi_flash.c + hal_qspi_flash.c + 0 + 0 + + + 6 + 42 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\DHT11\DHT11_BUS.c + DHT11_BUS.c + 0 + 0 + + + 6 + 43 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\OLED\oled.c + oled.c + 0 + 0 + + + 6 + 44 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\QSPI_FLASH\qspi_flash_kv.c + qspi_flash_kv.c + 0 + 0 + + + + + kernel + 0 + 0 + 0 + 0 + + 7 + 45 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_binary_heap.c + tos_binary_heap.c + 0 + 0 + + + 7 + 46 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_char_fifo.c + tos_char_fifo.c + 0 + 0 + + + 7 + 47 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_completion.c + tos_completion.c + 0 + 0 + + + 7 + 48 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_countdownlatch.c + tos_countdownlatch.c + 0 + 0 + + + 7 + 49 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_event.c + tos_event.c + 0 + 0 + + + 7 + 50 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_global.c + tos_global.c + 0 + 0 + + + 7 + 51 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mail_queue.c + tos_mail_queue.c + 0 + 0 + + + 7 + 52 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_message_queue.c + tos_message_queue.c + 0 + 0 + + + 7 + 53 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmblk.c + tos_mmblk.c + 0 + 0 + + + 7 + 54 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmheap.c + tos_mmheap.c + 0 + 0 + + + 7 + 55 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mutex.c + tos_mutex.c + 0 + 0 + + + 7 + 56 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_pend.c + tos_pend.c + 0 + 0 + + + 7 + 57 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + tos_priority_mail_queue.c + 0 + 0 + + + 7 + 58 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + tos_priority_message_queue.c + 0 + 0 + + + 7 + 59 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_queue.c + tos_priority_queue.c + 0 + 0 + + + 7 + 60 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_ring_queue.c + tos_ring_queue.c + 0 + 0 + + + 7 + 61 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_robin.c + tos_robin.c + 0 + 0 + + + 7 + 62 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sched.c + tos_sched.c + 0 + 0 + + + 7 + 63 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sem.c + tos_sem.c + 0 + 0 + + + 7 + 64 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sys.c + tos_sys.c + 0 + 0 + + + 7 + 65 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_task.c + tos_task.c + 0 + 0 + + + 7 + 66 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_tick.c + tos_tick.c + 0 + 0 + + + 7 + 67 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_time.c + tos_time.c + 0 + 0 + + + 7 + 68 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_timer.c + tos_timer.c + 0 + 0 + + + + + cpu + 0 + 0 + 0 + 0 + + 8 + 69 + 2 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + port_s.S + 0 + 0 + + + 8 + 70 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + tos_cpu.c + 0 + 0 + + + 8 + 71 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + port_c.c + 0 + 0 + + + + + cmsis + 0 + 0 + 0 + 0 + + 9 + 72 + 1 + 0 + 0 + 0 + ..\..\..\..\osal\cmsis_os\cmsis_os.c + cmsis_os.c + 0 + 0 + + + + + config + 0 + 0 + 0 + 0 + + 10 + 73 + 5 + 0 + 0 + 0 + ..\..\TOS-CONFIG\tos_config.h + tos_config.h + 0 + 0 + + + + + kv + 0 + 0 + 0 + 0 + + 11 + 74 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\kv\tos_kv.c + tos_kv.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/TencentOS_tiny.uvprojx b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/TencentOS_tiny.uvprojx new file mode 100644 index 00000000..91f4f1c5 --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/TencentOS_tiny.uvprojx @@ -0,0 +1,827 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + TencentOS_tiny + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + STM32L431RCTx + STMicroelectronics + Keil.STM32L4xx_DFP.2.0.0 + http://www.keil.com/pack + IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4") + + + + + + + + + + + + + + + $$Device:STM32L431RCTx$CMSIS\SVD\STM32L4x1.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\obj\ + TencentOS_tiny + 1 + 0 + 1 + 1 + 0 + .\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 + STLink\ST-LINKIII-KEIL_SWO.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 + 2 + 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 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + + USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER,USE_ESP8266 + + ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\BSP\Hardware\DHT11;..\..\BSP\Hardware\OLED;..\..\BSP\Hardware\BH1750;..\..\..\..\components\fs\kv\include + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + + + + + + + + + Application/MDK-ARM + + + startup_stm32l431xx.s + 2 + startup_stm32l431xx.s + + + + + Application/User + + + gpio.c + 1 + ..\..\BSP\Src\gpio.c + + + main.c + 1 + ..\..\BSP\Src\main.c + + + mcu_init.c + 1 + ..\..\BSP\Src\mcu_init.c + + + stm32l4xx_hal_msp.c + 1 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + + + stm32l4xx_it.c + 1 + ..\..\BSP\Src\stm32l4xx_it.c + + + usart.c + 1 + ..\..\BSP\Src\usart.c + + + adc.c + 1 + ..\..\BSP\Src\adc.c + + + dac.c + 1 + ..\..\BSP\Src\dac.c + + + i2c.c + 1 + ..\..\BSP\Src\i2c.c + + + spi.c + 1 + ..\..\BSP\Src\spi.c + + + quadspi.c + 1 + ..\..\BSP\Src\quadspi.c + + + + + examples + + + kv_sample.c + 1 + ..\..\..\..\examples\kv\kv_sample.c + + + + + Drivers/STM32L4xx_HAL_Driver + + + stm32l4xx_hal_tim.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + + + stm32l4xx_hal_tim_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + + + stm32l4xx_hal_uart.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + + + stm32l4xx_hal_uart_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + + + stm32l4xx_hal.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + + + stm32l4xx_hal_i2c.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + + + stm32l4xx_hal_i2c_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + + + stm32l4xx_hal_rcc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + + + stm32l4xx_hal_rcc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + + + stm32l4xx_hal_flash.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + + + stm32l4xx_hal_flash_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + + + stm32l4xx_hal_flash_ramfunc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + + + stm32l4xx_hal_gpio.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + + + stm32l4xx_hal_dma.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + + + stm32l4xx_hal_dma_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + + + stm32l4xx_hal_pwr.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + + + stm32l4xx_hal_pwr_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + + + stm32l4xx_hal_cortex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + + + stm32l4xx_hal_adc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + + + stm32l4xx_hal_adc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + + + stm32l4xx_hal_dac.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + + + stm32l4xx_hal_dac_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + + + stm32l4xx_hal_spi.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + + + stm32l4xx_hal_spi_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + + + stm32l4xx_hal_qspi.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_qspi.c + + + + + Drivers/CMSIS + + + system_stm32l4xx.c + 1 + ..\..\BSP\Src\system_stm32l4xx.c + + + + + Hardware + + + onchip_flash.c + 1 + ..\..\BSP\Hardware\ONCHIP_FLASH\onchip_flash.c + + + hal_qspi_flash.c + 1 + ..\..\BSP\Hardware\QSPI_FLASH\hal_qspi_flash.c + + + DHT11_BUS.c + 1 + ..\..\BSP\Hardware\DHT11\DHT11_BUS.c + + + oled.c + 1 + ..\..\BSP\Hardware\OLED\oled.c + + + qspi_flash_kv.c + 1 + ..\..\BSP\Hardware\QSPI_FLASH\qspi_flash_kv.c + + + + + kernel + + + tos_binary_heap.c + 1 + ..\..\..\..\kernel\core\tos_binary_heap.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_sched.c + 1 + ..\..\..\..\kernel\core\tos_sched.c + + + tos_sem.c + 1 + ..\..\..\..\kernel\core\tos_sem.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 + + + + + cpu + + + port_s.S + 2 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + + + 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 + + + + + cmsis + + + cmsis_os.c + 1 + ..\..\..\..\osal\cmsis_os\cmsis_os.c + + + + + config + + + tos_config.h + 5 + ..\..\TOS-CONFIG\tos_config.h + + + + + kv + + + tos_kv.c + 1 + ..\..\..\..\components\fs\kv\tos_kv.c + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/obj/TencentOS_tiny.htm b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/obj/TencentOS_tiny.htm new file mode 100644 index 00000000..654fb924 --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/obj/TencentOS_tiny.htm @@ -0,0 +1,3389 @@ + + +Static Call Graph - [.\obj\TencentOS_tiny.axf] +
+

Static Call Graph for image .\obj\TencentOS_tiny.axf


+

#<CALLGRAPH># ARM Linker, 5060750: Last Updated: Thu Dec 19 15:57:53 2019 +

+

Maximum Stack Usage = 392 bytes + Unknown(Functions without stacksize, Cycles, Untraceable Function Pointers)

+Call chain for Maximum Stack Depth:

+task ⇒ tos_kv_set ⇒ kv_item_update ⇒ kv_item_save ⇒ kv_blk_search_suitable ⇒ kv_gc ⇒ kv_mgr_blk_index_rebuild ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +

+

+Functions with no stack information +

+ +

+

+Mutually Recursive functions +

  • ADC1_IRQHandler   ⇒   ADC1_IRQHandler
    + +

    +

    +Function Pointers +

      +
    • ADC1_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • BusFault_Handler from stm32l4xx_it.o(i.BusFault_Handler) referenced from startup_stm32l431xx.o(RESET) +
    • CAN1_RX0_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • CAN1_RX1_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • CAN1_SCE_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • CAN1_TX_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • COMP_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • CRS_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA1_Channel1_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA1_Channel2_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA1_Channel3_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA1_Channel4_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA1_Channel5_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA1_Channel6_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA1_Channel7_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA2_Channel1_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA2_Channel2_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA2_Channel3_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA2_Channel4_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA2_Channel5_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA2_Channel6_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DMA2_Channel7_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • DebugMon_Handler from stm32l4xx_it.o(i.DebugMon_Handler) referenced from startup_stm32l431xx.o(RESET) +
    • EXTI0_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • EXTI15_10_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • EXTI1_IRQHandler from stm32l4xx_it.o(i.EXTI1_IRQHandler) referenced from startup_stm32l431xx.o(RESET) +
    • EXTI2_IRQHandler from stm32l4xx_it.o(i.EXTI2_IRQHandler) referenced from startup_stm32l431xx.o(RESET) +
    • EXTI3_IRQHandler from stm32l4xx_it.o(i.EXTI3_IRQHandler) referenced from startup_stm32l431xx.o(RESET) +
    • EXTI4_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • EXTI9_5_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • FLASH_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • FPU_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • HardFault_Handler from stm32l4xx_it.o(i.HardFault_Handler) referenced from startup_stm32l431xx.o(RESET) +
    • I2C1_ER_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • I2C1_EV_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • I2C2_ER_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • I2C2_EV_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • I2C3_ER_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • I2C3_EV_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • LPTIM1_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • LPTIM2_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • LPUART1_IRQHandler from stm32l4xx_it.o(i.LPUART1_IRQHandler) referenced from startup_stm32l431xx.o(RESET) +
    • MemManage_Handler from stm32l4xx_it.o(i.MemManage_Handler) referenced from startup_stm32l431xx.o(RESET) +
    • NMI_Handler from stm32l4xx_it.o(i.NMI_Handler) referenced from startup_stm32l431xx.o(RESET) +
    • PVD_PVM_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • PendSV_Handler from port_s.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • QUADSPI_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • RCC_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • RNG_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • RTC_Alarm_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • RTC_WKUP_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • Reset_Handler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • SAI1_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • SDMMC1_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • SPI1_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • SPI2_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • SPI3_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • SVC_Handler from stm32l4xx_it.o(i.SVC_Handler) referenced from startup_stm32l431xx.o(RESET) +
    • SWPMI1_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • SysTick_Handler from stm32l4xx_it.o(i.SysTick_Handler) referenced from startup_stm32l431xx.o(RESET) +
    • SystemInit from system_stm32l4xx.o(i.SystemInit) referenced from startup_stm32l431xx.o(.text) +
    • TAMP_STAMP_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • TIM1_BRK_TIM15_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • TIM1_CC_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • TIM1_TRG_COM_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • TIM1_UP_TIM16_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • TIM2_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • TIM6_DAC_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • TIM7_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • TSC_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • UART_DMAAbortOnError from stm32l4xx_hal_uart.o(i.UART_DMAAbortOnError) referenced from stm32l4xx_hal_uart.o(i.HAL_UART_IRQHandler) +
    • USART1_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • USART2_IRQHandler from stm32l4xx_it.o(i.USART2_IRQHandler) referenced from startup_stm32l431xx.o(RESET) +
    • USART3_IRQHandler from stm32l4xx_it.o(i.USART3_IRQHandler) referenced from startup_stm32l431xx.o(RESET) +
    • UsageFault_Handler from stm32l4xx_it.o(i.UsageFault_Handler) referenced from startup_stm32l431xx.o(RESET) +
    • WWDG_IRQHandler from startup_stm32l431xx.o(.text) referenced from startup_stm32l431xx.o(RESET) +
    • __main from entry.o(.ARM.Collect$$$$00000000) referenced from startup_stm32l431xx.o(.text) +
    • application_entry from kv_sample.o(i.application_entry) referenced from main.o(.constdata) +
    • fputc from mcu_init.o(i.fputc) referenced from printf5.o(i.__0printf$5) +
    • knl_idle_entry from tos_sys.o(i.knl_idle_entry) referenced from tos_sys.o(i.knl_idle_init) +
    • kv_item_do_fetch from tos_kv.o(i.kv_item_do_fetch) referenced from tos_kv.o(i.kv_item_do_find) +
    • kv_item_do_fetch_new_copy from tos_kv.o(i.kv_item_do_fetch_new_copy) referenced from tos_kv.o(i.kv_item_do_find_new_copy) +
    • kv_item_do_gc from tos_kv.o(i.kv_item_do_gc) referenced from tos_kv.o(i.kv_do_gc) +
    • kv_item_do_recovery from tos_kv.o(i.kv_item_do_recovery) referenced from tos_kv.o(i.kv_mgr_index_build) +
    • main from main.o(i.main) referenced from entry9a.o(.ARM.Collect$$$$0000000B) +
    • stm32l4_qspiflash_erase from qspi_flash_kv.o(i.stm32l4_qspiflash_erase) referenced 2 times from qspi_flash_kv.o(.data) +
    • stm32l4_qspiflash_read from qspi_flash_kv.o(i.stm32l4_qspiflash_read) referenced 2 times from qspi_flash_kv.o(.data) +
    • stm32l4_qspiflash_write from qspi_flash_kv.o(i.stm32l4_qspiflash_write) referenced 2 times from qspi_flash_kv.o(.data) +
    • task from kv_sample.o(i.task) referenced from kv_sample.o(.constdata) +
    • task_exit from tos_task.o(i.task_exit) referenced from tos_task.o(i.tos_task_create) +
    +

    +

    +Global Symbols +

    +

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

    • startup_stm32l431xx.o(.text) +
    +

    _main_stk (Thumb, 0 bytes, Stack size unknown bytes, entry2.o(.ARM.Collect$$$$00000001)) + +

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

    [Calls]

    • >>   __scatterload +
    + +

    __main_after_scatterload (Thumb, 0 bytes, Stack size unknown bytes, entry5.o(.ARM.Collect$$$$00000004)) +

    [Called By]

    • >>   __scatterload +
    + +

    _main_clock (Thumb, 0 bytes, Stack size unknown bytes, entry7b.o(.ARM.Collect$$$$00000008)) + +

    _main_cpp_init (Thumb, 0 bytes, Stack size unknown bytes, entry8b.o(.ARM.Collect$$$$0000000A)) + +

    _main_init (Thumb, 0 bytes, Stack size unknown bytes, entry9a.o(.ARM.Collect$$$$0000000B)) + +

    __rt_final_cpp (Thumb, 0 bytes, Stack size unknown bytes, entry10a.o(.ARM.Collect$$$$0000000D)) + +

    __rt_final_exit (Thumb, 0 bytes, Stack size unknown bytes, entry11a.o(.ARM.Collect$$$$0000000F)) + +

    Reset_Handler (Thumb, 8 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    ADC1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +

    [Calls]

    • >>   ADC1_IRQHandler +
    +
    [Called By]
    • >>   ADC1_IRQHandler +
    +
    [Address Reference Count : 1]
    • startup_stm32l431xx.o(RESET) +
    +

    CAN1_RX0_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    CAN1_RX1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    CAN1_SCE_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    CAN1_TX_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    COMP_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    CRS_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA1_Channel1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA1_Channel2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA1_Channel3_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA1_Channel4_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA1_Channel5_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA1_Channel6_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA1_Channel7_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA2_Channel1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA2_Channel2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA2_Channel3_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA2_Channel4_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA2_Channel5_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA2_Channel6_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DMA2_Channel7_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    EXTI0_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    EXTI15_10_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    EXTI4_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    EXTI9_5_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    FLASH_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    FPU_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    I2C1_ER_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    I2C1_EV_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    I2C2_ER_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    I2C2_EV_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    I2C3_ER_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    I2C3_EV_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    LPTIM1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    LPTIM2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    PVD_PVM_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    QUADSPI_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    RCC_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    RNG_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    RTC_Alarm_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    RTC_WKUP_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    SAI1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    SDMMC1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    SPI1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    SPI2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    SPI3_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    SWPMI1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    TAMP_STAMP_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    TIM1_BRK_TIM15_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    TIM1_CC_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    TIM1_TRG_COM_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    TIM1_UP_TIM16_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    TIM2_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    TIM6_DAC_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    TIM7_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    TSC_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    USART1_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    WWDG_IRQHandler (Thumb, 0 bytes, Stack size 0 bytes, startup_stm32l431xx.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    port_int_disable (Thumb, 0 bytes, Stack size unknown bytes, port_s.o(.text), UNUSED) + +

    port_int_enable (Thumb, 0 bytes, Stack size unknown bytes, port_s.o(.text), UNUSED) + +

    port_cpsr_save (Thumb, 0 bytes, Stack size unknown bytes, port_s.o(.text)) +

    [Called By]

    • >>   tos_cpu_cpsr_save +
    + +

    port_cpsr_restore (Thumb, 0 bytes, Stack size unknown bytes, port_s.o(.text)) +

    [Called By]

    • >>   tos_cpu_cpsr_restore +
    + +

    port_clz (Thumb, 0 bytes, Stack size unknown bytes, port_s.o(.text)) +

    [Called By]

    • >>   tos_cpu_clz +
    + +

    port_sched_start (Thumb, 0 bytes, Stack size unknown bytes, port_s.o(.text)) +

    [Called By]

    • >>   cpu_sched_start +
    + +

    port_context_switch (Thumb, 0 bytes, Stack size unknown bytes, port_s.o(.text)) +

    [Called By]

    • >>   cpu_context_switch +
    + +

    port_irq_context_switch (Thumb, 0 bytes, Stack size unknown bytes, port_s.o(.text)) +

    [Called By]

    • >>   cpu_irq_context_switch +
    + +

    PendSV_Handler (Thumb, 0 bytes, Stack size unknown bytes, port_s.o(.text)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    __aeabi_uldivmod (Thumb, 98 bytes, Stack size 40 bytes, uldiv.o(.text)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = __aeabi_uldivmod +
    +
    [Calls]
    • >>   __aeabi_llsr +
    • >>   __aeabi_llsl +
    +
    [Called By]
    • >>   UART_SetConfig +
    • >>   cpu_init +
    • >>   _printf_core +
    + +

    __aeabi_memcpy (Thumb, 36 bytes, Stack size 0 bytes, memcpya.o(.text)) +

    [Called By]

    • >>   tos_kv_get +
    • >>   kv_item_do_save +
    + +

    __aeabi_memcpy4 (Thumb, 0 bytes, Stack size 0 bytes, memcpya.o(.text), UNUSED) + +

    __aeabi_memcpy8 (Thumb, 0 bytes, Stack size 0 bytes, memcpya.o(.text), UNUSED) + +

    __aeabi_memset (Thumb, 14 bytes, Stack size 0 bytes, memseta.o(.text)) +

    [Called By]

    • >>   _memset$wrapper +
    • >>   __aeabi_memclr +
    + +

    __aeabi_memset4 (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED) + +

    __aeabi_memset8 (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED) + +

    __aeabi_memclr (Thumb, 4 bytes, Stack size 0 bytes, memseta.o(.text)) +

    [Calls]

    • >>   __aeabi_memset +
    +
    [Called By]
    • >>   kv_item_do_save +
    + +

    __aeabi_memclr4 (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text)) +

    [Called By]

    • >>   HAL_UART_MspInit +
    • >>   SystemClock_Config +
    • >>   MX_GPIO_Init +
    • >>   tos_kv_init +
    • >>   kv_mgr_ctl_init +
    + +

    __aeabi_memclr8 (Thumb, 0 bytes, Stack size 0 bytes, memseta.o(.text), UNUSED) + +

    _memset$wrapper (Thumb, 18 bytes, Stack size 8 bytes, memseta.o(.text), UNUSED) +

    [Calls]

    • >>   __aeabi_memset +
    + +

    strlen (Thumb, 14 bytes, Stack size 0 bytes, strlen.o(.text)) +

    [Called By]

    • >>   tos_kv_set +
    • >>   tos_kv_has_key +
    • >>   tos_kv_get +
    • >>   tos_kv_del +
    • >>   kv_item_save +
    • >>   kv_item_do_save +
    • >>   kv_item_do_fetch +
    + +

    memcmp (Thumb, 26 bytes, Stack size 12 bytes, memcmp.o(.text)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = memcmp +
    +
    [Called By]
    • >>   kv_item_value_is_match +
    • >>   kv_item_try_delete +
    • >>   kv_item_is_moved +
    • >>   kv_item_do_fetch_new_copy +
    • >>   kv_item_do_fetch +
    + +

    __aeabi_llsl (Thumb, 30 bytes, Stack size 0 bytes, llshl.o(.text)) +

    [Called By]

    • >>   __aeabi_uldivmod +
    + +

    _ll_shift_l (Thumb, 0 bytes, Stack size 0 bytes, llshl.o(.text), UNUSED) + +

    __aeabi_llsr (Thumb, 32 bytes, Stack size 0 bytes, llushr.o(.text)) +

    [Called By]

    • >>   __aeabi_uldivmod +
    + +

    _ll_ushift_r (Thumb, 0 bytes, Stack size 0 bytes, llushr.o(.text), UNUSED) + +

    __scatterload (Thumb, 28 bytes, Stack size 0 bytes, init.o(.text)) +

    [Calls]

    • >>   __main_after_scatterload +
    +
    [Called By]
    • >>   _main_scatterload +
    + +

    __scatterload_rt2 (Thumb, 0 bytes, Stack size 0 bytes, init.o(.text), UNUSED) + +

    __decompress (Thumb, 0 bytes, Stack size unknown bytes, __dczerorl2.o(.text), UNUSED) + +

    __decompress1 (Thumb, 86 bytes, Stack size unknown bytes, __dczerorl2.o(.text), UNUSED) + +

    BusFault_Handler (Thumb, 4 bytes, Stack size 0 bytes, stm32l4xx_it.o(i.BusFault_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    DHT11_Init (Thumb, 48 bytes, Stack size 8 bytes, dht11_bus.o(i.DHT11_Init)) +

    [Stack]

    • Max Depth = 52
    • Call Chain = DHT11_Init ⇒ DHT11_Mode_Out_PP ⇒ HAL_GPIO_Init +
    +
    [Calls]
    • >>   HAL_GPIO_WritePin +
    • >>   DHT11_Mode_Out_PP +
    +
    [Called By]
    • >>   board_init +
    + +

    DebugMon_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32l4xx_it.o(i.DebugMon_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    EXTI1_IRQHandler (Thumb, 10 bytes, Stack size 8 bytes, stm32l4xx_it.o(i.EXTI1_IRQHandler)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = EXTI1_IRQHandler ⇒ HAL_GPIO_EXTI_IRQHandler +
    +
    [Calls]
    • >>   HAL_GPIO_EXTI_IRQHandler +
    +
    [Address Reference Count : 1]
    • startup_stm32l431xx.o(RESET) +
    +

    EXTI2_IRQHandler (Thumb, 10 bytes, Stack size 8 bytes, stm32l4xx_it.o(i.EXTI2_IRQHandler)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = EXTI2_IRQHandler ⇒ HAL_GPIO_EXTI_IRQHandler +
    +
    [Calls]
    • >>   HAL_GPIO_EXTI_IRQHandler +
    +
    [Address Reference Count : 1]
    • startup_stm32l431xx.o(RESET) +
    +

    EXTI3_IRQHandler (Thumb, 10 bytes, Stack size 8 bytes, stm32l4xx_it.o(i.EXTI3_IRQHandler)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = EXTI3_IRQHandler ⇒ HAL_GPIO_EXTI_IRQHandler +
    +
    [Calls]
    • >>   HAL_GPIO_EXTI_IRQHandler +
    +
    [Address Reference Count : 1]
    • startup_stm32l431xx.o(RESET) +
    +

    Error_Handler (Thumb, 2 bytes, Stack size 0 bytes, mcu_init.o(i.Error_Handler)) +

    [Called By]

    • >>   MX_USART3_UART_Init +
    • >>   MX_USART2_UART_Init +
    • >>   SystemClock_Config +
    + +

    HAL_DMA_Abort_IT (Thumb, 92 bytes, Stack size 16 bytes, stm32l4xx_hal_dma.o(i.HAL_DMA_Abort_IT)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = HAL_DMA_Abort_IT +
    +
    [Called By]
    • >>   HAL_UART_IRQHandler +
    + +

    HAL_Delay (Thumb, 32 bytes, Stack size 16 bytes, stm32l4xx_hal.o(i.HAL_Delay)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = HAL_Delay +
    +
    [Calls]
    • >>   HAL_GetTick +
    +
    [Called By]
    • >>   OLED_Init +
    + +

    HAL_GPIO_EXTI_Callback (Thumb, 2 bytes, Stack size 0 bytes, stm32l4xx_hal_gpio.o(i.HAL_GPIO_EXTI_Callback)) +

    [Called By]

    • >>   HAL_GPIO_EXTI_IRQHandler +
    + +

    HAL_GPIO_EXTI_IRQHandler (Thumb, 24 bytes, Stack size 8 bytes, stm32l4xx_hal_gpio.o(i.HAL_GPIO_EXTI_IRQHandler)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = HAL_GPIO_EXTI_IRQHandler +
    +
    [Calls]
    • >>   HAL_GPIO_EXTI_Callback +
    +
    [Called By]
    • >>   EXTI3_IRQHandler +
    • >>   EXTI2_IRQHandler +
    • >>   EXTI1_IRQHandler +
    + +

    HAL_GPIO_Init (Thumb, 428 bytes, Stack size 20 bytes, stm32l4xx_hal_gpio.o(i.HAL_GPIO_Init)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = HAL_GPIO_Init +
    +
    [Called By]
    • >>   HAL_UART_MspInit +
    • >>   MX_GPIO_Init +
    • >>   HAL_QSPI_MspInit +
    • >>   DHT11_Mode_Out_PP +
    + +

    HAL_GPIO_WritePin (Thumb, 10 bytes, Stack size 0 bytes, stm32l4xx_hal_gpio.o(i.HAL_GPIO_WritePin)) +

    [Called By]

    • >>   DHT11_Init +
    • >>   MX_GPIO_Init +
    • >>   Write_IIC_Byte +
    • >>   IIC_Wait_Ack +
    • >>   IIC_Stop +
    • >>   IIC_Start +
    + +

    HAL_GetTick (Thumb, 6 bytes, Stack size 0 bytes, stm32l4xx_hal.o(i.HAL_GetTick)) +

    [Called By]

    • >>   HAL_UART_Transmit +
    • >>   HAL_RCC_OscConfig +
    • >>   HAL_RCC_ClockConfig +
    • >>   HAL_RCCEx_PeriphCLKConfig +
    • >>   HAL_Delay +
    • >>   HAL_QSPI_Init +
    • >>   UART_WaitOnFlagUntilTimeout +
    • >>   UART_CheckIdleState +
    • >>   RCCEx_PLLSAI1_Config +
    • >>   HAL_QSPI_Transmit +
    • >>   HAL_QSPI_Receive +
    • >>   HAL_QSPI_Command +
    • >>   QSPI_WaitFlagStateUntilTimeout +
    + +

    HAL_IncTick (Thumb, 12 bytes, Stack size 0 bytes, stm32l4xx_hal.o(i.HAL_IncTick)) +

    [Called By]

    • >>   SysTick_Handler +
    + +

    HAL_Init (Thumb, 30 bytes, Stack size 8 bytes, stm32l4xx_hal.o(i.HAL_Init)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = HAL_Init ⇒ HAL_InitTick ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   HAL_MspInit +
    • >>   HAL_InitTick +
    • >>   HAL_NVIC_SetPriorityGrouping +
    +
    [Called By]
    • >>   board_init +
    + +

    HAL_InitTick (Thumb, 44 bytes, Stack size 16 bytes, stm32l4xx_hal.o(i.HAL_InitTick)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = HAL_InitTick ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   HAL_NVIC_SetPriority +
    • >>   HAL_SYSTICK_Config +
    +
    [Called By]
    • >>   HAL_RCC_OscConfig +
    • >>   HAL_RCC_ClockConfig +
    • >>   HAL_Init +
    + +

    HAL_MspInit (Thumb, 58 bytes, Stack size 8 bytes, stm32l4xx_hal_msp.o(i.HAL_MspInit)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = HAL_MspInit +
    +
    [Called By]
    • >>   HAL_Init +
    + +

    HAL_NVIC_EnableIRQ (Thumb, 32 bytes, Stack size 0 bytes, stm32l4xx_hal_cortex.o(i.HAL_NVIC_EnableIRQ)) +

    [Called By]

    • >>   HAL_UART_MspInit +
    • >>   MX_GPIO_Init +
    + +

    HAL_NVIC_SetPriority (Thumb, 124 bytes, Stack size 40 bytes, stm32l4xx_hal_cortex.o(i.HAL_NVIC_SetPriority)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   __NVIC_SetPriority +
    • >>   __NVIC_GetPriorityGrouping +
    +
    [Called By]
    • >>   HAL_UART_MspInit +
    • >>   MX_GPIO_Init +
    • >>   HAL_InitTick +
    + +

    HAL_NVIC_SetPriorityGrouping (Thumb, 32 bytes, Stack size 0 bytes, stm32l4xx_hal_cortex.o(i.HAL_NVIC_SetPriorityGrouping)) +

    [Called By]

    • >>   HAL_Init +
    + +

    HAL_PWREx_ControlVoltageScaling (Thumb, 128 bytes, Stack size 0 bytes, stm32l4xx_hal_pwr_ex.o(i.HAL_PWREx_ControlVoltageScaling)) +

    [Called By]

    • >>   SystemClock_Config +
    + +

    HAL_PWREx_GetVoltageRange (Thumb, 10 bytes, Stack size 0 bytes, stm32l4xx_hal_pwr_ex.o(i.HAL_PWREx_GetVoltageRange)) +

    [Called By]

    • >>   RCC_SetFlashLatencyFromMSIRange +
    + +

    HAL_PWR_EnableBkUpAccess (Thumb, 14 bytes, Stack size 0 bytes, stm32l4xx_hal_pwr.o(i.HAL_PWR_EnableBkUpAccess)) +

    [Called By]

    • >>   SystemClock_Config +
    + +

    HAL_QSPI_Command (Thumb, 164 bytes, Stack size 32 bytes, stm32l4xx_hal_qspi.o(i.HAL_QSPI_Command)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   HAL_GetTick +
    • >>   QSPI_WaitFlagStateUntilTimeout +
    • >>   QSPI_Config +
    +
    [Called By]
    • >>   QSPI_Send_CMD +
    + +

    HAL_QSPI_Init (Thumb, 206 bytes, Stack size 24 bytes, stm32l4xx_hal_qspi.o(i.HAL_QSPI_Init)) +

    [Stack]

    • Max Depth = 76
    • Call Chain = HAL_QSPI_Init ⇒ HAL_QSPI_MspInit ⇒ HAL_GPIO_Init +
    +
    [Calls]
    • >>   HAL_QSPI_MspInit +
    • >>   HAL_GetTick +
    • >>   HAL_QSPI_SetTimeout +
    • >>   QSPI_WaitFlagStateUntilTimeout +
    +
    [Called By]
    • >>   MX_QUADSPI_Init +
    + +

    HAL_QSPI_MspInit (Thumb, 76 bytes, Stack size 32 bytes, quadspi.o(i.HAL_QSPI_MspInit)) +

    [Stack]

    • Max Depth = 52
    • Call Chain = HAL_QSPI_MspInit ⇒ HAL_GPIO_Init +
    +
    [Calls]
    • >>   HAL_GPIO_Init +
    +
    [Called By]
    • >>   HAL_QSPI_Init +
    + +

    HAL_QSPI_Receive (Thumb, 228 bytes, Stack size 40 bytes, stm32l4xx_hal_qspi.o(i.HAL_QSPI_Receive)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = HAL_QSPI_Receive ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   HAL_GetTick +
    • >>   QSPI_WaitFlagStateUntilTimeout +
    +
    [Called By]
    • >>   QSPI_Receive +
    + +

    HAL_QSPI_SetTimeout (Thumb, 4 bytes, Stack size 0 bytes, stm32l4xx_hal_qspi.o(i.HAL_QSPI_SetTimeout)) +

    [Called By]

    • >>   HAL_QSPI_Init +
    + +

    HAL_QSPI_Transmit (Thumb, 212 bytes, Stack size 32 bytes, stm32l4xx_hal_qspi.o(i.HAL_QSPI_Transmit)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = HAL_QSPI_Transmit ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   HAL_GetTick +
    • >>   QSPI_WaitFlagStateUntilTimeout +
    +
    [Called By]
    • >>   QSPI_Transmit +
    + +

    HAL_RCCEx_EnableMSIPLLMode (Thumb, 14 bytes, Stack size 0 bytes, stm32l4xx_hal_rcc_ex.o(i.HAL_RCCEx_EnableMSIPLLMode)) +

    [Called By]

    • >>   SystemClock_Config +
    + +

    HAL_RCCEx_PeriphCLKConfig (Thumb, 894 bytes, Stack size 32 bytes, stm32l4xx_hal_rcc_ex.o(i.HAL_RCCEx_PeriphCLKConfig)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = HAL_RCCEx_PeriphCLKConfig ⇒ RCCEx_PLLSAI1_Config +
    +
    [Calls]
    • >>   HAL_GetTick +
    • >>   RCCEx_PLLSAI1_Config +
    +
    [Called By]
    • >>   SystemClock_Config +
    + +

    HAL_RCC_ClockConfig (Thumb, 358 bytes, Stack size 24 bytes, stm32l4xx_hal_rcc.o(i.HAL_RCC_ClockConfig)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = HAL_RCC_ClockConfig ⇒ HAL_InitTick ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   HAL_RCC_GetSysClockFreq +
    • >>   HAL_GetTick +
    • >>   HAL_InitTick +
    +
    [Called By]
    • >>   SystemClock_Config +
    + +

    HAL_RCC_GetHCLKFreq (Thumb, 6 bytes, Stack size 0 bytes, stm32l4xx_hal_rcc.o(i.HAL_RCC_GetHCLKFreq)) +

    [Called By]

    • >>   HAL_RCC_GetPCLK2Freq +
    • >>   HAL_RCC_GetPCLK1Freq +
    + +

    HAL_RCC_GetPCLK1Freq (Thumb, 26 bytes, Stack size 4 bytes, stm32l4xx_hal_rcc.o(i.HAL_RCC_GetPCLK1Freq)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = HAL_RCC_GetPCLK1Freq +
    +
    [Calls]
    • >>   HAL_RCC_GetHCLKFreq +
    +
    [Called By]
    • >>   UART_SetConfig +
    + +

    HAL_RCC_GetPCLK2Freq (Thumb, 26 bytes, Stack size 4 bytes, stm32l4xx_hal_rcc.o(i.HAL_RCC_GetPCLK2Freq)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = HAL_RCC_GetPCLK2Freq +
    +
    [Calls]
    • >>   HAL_RCC_GetHCLKFreq +
    +
    [Called By]
    • >>   UART_SetConfig +
    + +

    HAL_RCC_GetSysClockFreq (Thumb, 266 bytes, Stack size 24 bytes, stm32l4xx_hal_rcc.o(i.HAL_RCC_GetSysClockFreq)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = HAL_RCC_GetSysClockFreq +
    +
    [Called By]
    • >>   HAL_RCC_OscConfig +
    • >>   HAL_RCC_ClockConfig +
    • >>   UART_SetConfig +
    + +

    HAL_RCC_OscConfig (Thumb, 1660 bytes, Stack size 32 bytes, stm32l4xx_hal_rcc.o(i.HAL_RCC_OscConfig)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = HAL_RCC_OscConfig ⇒ HAL_InitTick ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   HAL_RCC_GetSysClockFreq +
    • >>   HAL_GetTick +
    • >>   RCC_SetFlashLatencyFromMSIRange +
    • >>   HAL_InitTick +
    +
    [Called By]
    • >>   SystemClock_Config +
    + +

    HAL_SYSTICK_Config (Thumb, 52 bytes, Stack size 16 bytes, stm32l4xx_hal_cortex.o(i.HAL_SYSTICK_Config)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = HAL_SYSTICK_Config ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   __NVIC_SetPriority +
    +
    [Called By]
    • >>   HAL_InitTick +
    + +

    HAL_UARTEx_WakeupCallback (Thumb, 2 bytes, Stack size 0 bytes, stm32l4xx_hal_uart_ex.o(i.HAL_UARTEx_WakeupCallback)) +

    [Called By]

    • >>   HAL_UART_IRQHandler +
    + +

    HAL_UART_ErrorCallback (Thumb, 2 bytes, Stack size 0 bytes, stm32l4xx_hal_uart.o(i.HAL_UART_ErrorCallback)) +

    [Called By]

    • >>   HAL_UART_IRQHandler +
    • >>   UART_DMAAbortOnError +
    + +

    HAL_UART_IRQHandler (Thumb, 392 bytes, Stack size 24 bytes, stm32l4xx_hal_uart.o(i.HAL_UART_IRQHandler)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = HAL_UART_IRQHandler ⇒ HAL_DMA_Abort_IT +
    +
    [Calls]
    • >>   HAL_UART_ErrorCallback +
    • >>   HAL_UARTEx_WakeupCallback +
    • >>   HAL_DMA_Abort_IT +
    • >>   UART_EndTransmit_IT +
    • >>   UART_EndRxTransfer +
    +
    [Called By]
    • >>   USART3_IRQHandler +
    • >>   USART2_IRQHandler +
    • >>   LPUART1_IRQHandler +
    + +

    HAL_UART_Init (Thumb, 120 bytes, Stack size 8 bytes, stm32l4xx_hal_uart.o(i.HAL_UART_Init)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = HAL_UART_Init ⇒ HAL_UART_MspInit ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   HAL_UART_MspInit +
    • >>   UART_SetConfig +
    • >>   UART_CheckIdleState +
    • >>   UART_AdvFeatureConfig +
    +
    [Called By]
    • >>   MX_USART3_UART_Init +
    • >>   MX_USART2_UART_Init +
    + +

    HAL_UART_MspInit (Thumb, 342 bytes, Stack size 32 bytes, usart.o(i.HAL_UART_MspInit)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = HAL_UART_MspInit ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   HAL_NVIC_SetPriority +
    • >>   HAL_NVIC_EnableIRQ +
    • >>   HAL_GPIO_Init +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   HAL_UART_Init +
    + +

    HAL_UART_Transmit (Thumb, 200 bytes, Stack size 32 bytes, stm32l4xx_hal_uart.o(i.HAL_UART_Transmit)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = HAL_UART_Transmit ⇒ UART_WaitOnFlagUntilTimeout +
    +
    [Calls]
    • >>   HAL_GetTick +
    • >>   UART_WaitOnFlagUntilTimeout +
    +
    [Called By]
    • >>   fputc +
    + +

    HAL_UART_TxCpltCallback (Thumb, 2 bytes, Stack size 0 bytes, stm32l4xx_hal_uart.o(i.HAL_UART_TxCpltCallback)) +

    [Called By]

    • >>   UART_EndTransmit_IT +
    + +

    HardFault_Handler (Thumb, 4 bytes, Stack size 0 bytes, stm32l4xx_it.o(i.HardFault_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    IIC_Start (Thumb, 48 bytes, Stack size 8 bytes, oled.o(i.IIC_Start)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = IIC_Start +
    +
    [Calls]
    • >>   HAL_GPIO_WritePin +
    +
    [Called By]
    • >>   Write_IIC_Data +
    • >>   Write_IIC_Command +
    + +

    IIC_Stop (Thumb, 36 bytes, Stack size 8 bytes, oled.o(i.IIC_Stop)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = IIC_Stop +
    +
    [Calls]
    • >>   HAL_GPIO_WritePin +
    +
    [Called By]
    • >>   Write_IIC_Data +
    • >>   Write_IIC_Command +
    + +

    IIC_Wait_Ack (Thumb, 28 bytes, Stack size 8 bytes, oled.o(i.IIC_Wait_Ack)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = IIC_Wait_Ack +
    +
    [Calls]
    • >>   HAL_GPIO_WritePin +
    +
    [Called By]
    • >>   Write_IIC_Data +
    • >>   Write_IIC_Command +
    + +

    LPUART1_IRQHandler (Thumb, 10 bytes, Stack size 8 bytes, stm32l4xx_it.o(i.LPUART1_IRQHandler)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = LPUART1_IRQHandler ⇒ HAL_UART_IRQHandler ⇒ HAL_DMA_Abort_IT +
    +
    [Calls]
    • >>   HAL_UART_IRQHandler +
    +
    [Address Reference Count : 1]
    • startup_stm32l431xx.o(RESET) +
    +

    MX_GPIO_Init (Thumb, 316 bytes, Stack size 32 bytes, gpio.o(i.MX_GPIO_Init)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = MX_GPIO_Init ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   HAL_NVIC_SetPriority +
    • >>   HAL_NVIC_EnableIRQ +
    • >>   HAL_GPIO_WritePin +
    • >>   HAL_GPIO_Init +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   board_init +
    + +

    MX_QUADSPI_Init (Thumb, 52 bytes, Stack size 8 bytes, quadspi.o(i.MX_QUADSPI_Init)) +

    [Stack]

    • Max Depth = 84
    • Call Chain = MX_QUADSPI_Init ⇒ HAL_QSPI_Init ⇒ HAL_QSPI_MspInit ⇒ HAL_GPIO_Init +
    +
    [Calls]
    • >>   HAL_QSPI_Init +
    +
    [Called By]
    • >>   task +
    + +

    MX_USART2_UART_Init (Thumb, 56 bytes, Stack size 8 bytes, usart.o(i.MX_USART2_UART_Init)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = MX_USART2_UART_Init ⇒ HAL_UART_Init ⇒ HAL_UART_MspInit ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   HAL_UART_Init +
    • >>   Error_Handler +
    +
    [Called By]
    • >>   board_init +
    + +

    MX_USART3_UART_Init (Thumb, 56 bytes, Stack size 8 bytes, usart.o(i.MX_USART3_UART_Init)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = MX_USART3_UART_Init ⇒ HAL_UART_Init ⇒ HAL_UART_MspInit ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   HAL_UART_Init +
    • >>   Error_Handler +
    +
    [Called By]
    • >>   board_init +
    + +

    MemManage_Handler (Thumb, 4 bytes, Stack size 0 bytes, stm32l4xx_it.o(i.MemManage_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    NMI_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32l4xx_it.o(i.NMI_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    OLED_Clear (Thumb, 62 bytes, Stack size 16 bytes, oled.o(i.OLED_Clear)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = OLED_Clear ⇒ OLED_WR_Byte ⇒ Write_IIC_Data ⇒ Write_IIC_Byte +
    +
    [Calls]
    • >>   OLED_WR_Byte +
    +
    [Called By]
    • >>   OLED_Init +
    • >>   board_init +
    + +

    OLED_Init (Thumb, 198 bytes, Stack size 8 bytes, oled.o(i.OLED_Init)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = OLED_Init ⇒ OLED_Clear ⇒ OLED_WR_Byte ⇒ Write_IIC_Data ⇒ Write_IIC_Byte +
    +
    [Calls]
    • >>   OLED_Clear +
    • >>   HAL_Delay +
    • >>   OLED_WR_Byte +
    +
    [Called By]
    • >>   board_init +
    + +

    OLED_Set_Pos (Thumb, 40 bytes, Stack size 16 bytes, oled.o(i.OLED_Set_Pos)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = OLED_Set_Pos ⇒ OLED_WR_Byte ⇒ Write_IIC_Data ⇒ Write_IIC_Byte +
    +
    [Calls]
    • >>   OLED_WR_Byte +
    +
    [Called By]
    • >>   OLED_ShowChinese +
    • >>   OLED_ShowChar +
    + +

    OLED_ShowChar (Thumb, 154 bytes, Stack size 32 bytes, oled.o(i.OLED_ShowChar)) +

    [Stack]

    • Max Depth = 96
    • Call Chain = OLED_ShowChar ⇒ OLED_Set_Pos ⇒ OLED_WR_Byte ⇒ Write_IIC_Data ⇒ Write_IIC_Byte +
    +
    [Calls]
    • >>   OLED_WR_Byte +
    • >>   OLED_Set_Pos +
    +
    [Called By]
    • >>   OLED_ShowString +
    + +

    OLED_ShowChinese (Thumb, 98 bytes, Stack size 24 bytes, oled.o(i.OLED_ShowChinese)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = OLED_ShowChinese ⇒ OLED_Set_Pos ⇒ OLED_WR_Byte ⇒ Write_IIC_Data ⇒ Write_IIC_Byte +
    +
    [Calls]
    • >>   OLED_WR_Byte +
    • >>   OLED_Set_Pos +
    +
    [Called By]
    • >>   board_init +
    + +

    OLED_ShowString (Thumb, 58 bytes, Stack size 24 bytes, oled.o(i.OLED_ShowString)) +

    [Stack]

    • Max Depth = 120
    • Call Chain = OLED_ShowString ⇒ OLED_ShowChar ⇒ OLED_Set_Pos ⇒ OLED_WR_Byte ⇒ Write_IIC_Data ⇒ Write_IIC_Byte +
    +
    [Calls]
    • >>   OLED_ShowChar +
    +
    [Called By]
    • >>   board_init +
    + +

    OLED_WR_Byte (Thumb, 24 bytes, Stack size 16 bytes, oled.o(i.OLED_WR_Byte)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = OLED_WR_Byte ⇒ Write_IIC_Data ⇒ Write_IIC_Byte +
    +
    [Calls]
    • >>   Write_IIC_Data +
    • >>   Write_IIC_Command +
    +
    [Called By]
    • >>   OLED_ShowChinese +
    • >>   OLED_Init +
    • >>   OLED_Clear +
    • >>   OLED_ShowChar +
    • >>   OLED_Set_Pos +
    + +

    QSPI_Receive (Thumb, 36 bytes, Stack size 16 bytes, hal_qspi_flash_1.o(i.QSPI_Receive)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = QSPI_Receive ⇒ HAL_QSPI_Receive ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   HAL_QSPI_Receive +
    +
    [Called By]
    • >>   hal_spi_flash_read +
    • >>   prv_spi_flash_wait_write_end +
    + +

    QSPI_Send_CMD (Thumb, 70 bytes, Stack size 88 bytes, hal_qspi_flash_1.o(i.QSPI_Send_CMD)) +

    [Stack]

    • Max Depth = 144
    • Call Chain = QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   HAL_QSPI_Command +
    +
    [Called By]
    • >>   prv_spi_flash_erase_sector +
    • >>   hal_spi_flash_read +
    • >>   prv_spi_flash_write_page +
    • >>   prv_spi_flash_write_enable +
    • >>   prv_spi_flash_wait_write_end +
    + +

    QSPI_Transmit (Thumb, 36 bytes, Stack size 16 bytes, hal_qspi_flash_1.o(i.QSPI_Transmit)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = QSPI_Transmit ⇒ HAL_QSPI_Transmit ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   HAL_QSPI_Transmit +
    +
    [Called By]
    • >>   prv_spi_flash_write_page +
    + +

    SVC_Handler (Thumb, 2 bytes, Stack size 0 bytes, stm32l4xx_it.o(i.SVC_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    SysTick_Handler (Thumb, 26 bytes, Stack size 8 bytes, stm32l4xx_it.o(i.SysTick_Handler)) +

    [Stack]

    • Max Depth = 104 + Unknown Stack Size +
    • Call Chain = SysTick_Handler ⇒ tos_tick_handler ⇒ tick_update ⇒ pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   tos_tick_handler +
    • >>   tos_knl_is_running +
    • >>   tos_knl_irq_leave +
    • >>   tos_knl_irq_enter +
    • >>   HAL_IncTick +
    +
    [Address Reference Count : 1]
    • startup_stm32l431xx.o(RESET) +
    +

    SystemClock_Config (Thumb, 214 bytes, Stack size 184 bytes, mcu_init.o(i.SystemClock_Config)) +

    [Stack]

    • Max Depth = 280
    • Call Chain = SystemClock_Config ⇒ HAL_RCC_OscConfig ⇒ HAL_InitTick ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   HAL_RCC_OscConfig +
    • >>   HAL_RCC_ClockConfig +
    • >>   HAL_RCCEx_PeriphCLKConfig +
    • >>   HAL_RCCEx_EnableMSIPLLMode +
    • >>   HAL_PWR_EnableBkUpAccess +
    • >>   HAL_PWREx_ControlVoltageScaling +
    • >>   Error_Handler +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   board_init +
    + +

    SystemInit (Thumb, 68 bytes, Stack size 0 bytes, system_stm32l4xx.o(i.SystemInit)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(.text) +
    +

    UART_AdvFeatureConfig (Thumb, 248 bytes, Stack size 0 bytes, stm32l4xx_hal_uart.o(i.UART_AdvFeatureConfig)) +

    [Called By]

    • >>   HAL_UART_Init +
    + +

    UART_CheckIdleState (Thumb, 116 bytes, Stack size 16 bytes, stm32l4xx_hal_uart.o(i.UART_CheckIdleState)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = UART_CheckIdleState ⇒ UART_WaitOnFlagUntilTimeout +
    +
    [Calls]
    • >>   HAL_GetTick +
    • >>   UART_WaitOnFlagUntilTimeout +
    +
    [Called By]
    • >>   HAL_UART_Init +
    + +

    UART_SetConfig (Thumb, 1000 bytes, Stack size 40 bytes, stm32l4xx_hal_uart.o(i.UART_SetConfig)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = UART_SetConfig ⇒ __aeabi_uldivmod +
    +
    [Calls]
    • >>   HAL_RCC_GetSysClockFreq +
    • >>   HAL_RCC_GetPCLK2Freq +
    • >>   HAL_RCC_GetPCLK1Freq +
    • >>   __aeabi_uldivmod +
    +
    [Called By]
    • >>   HAL_UART_Init +
    + +

    UART_WaitOnFlagUntilTimeout (Thumb, 108 bytes, Stack size 24 bytes, stm32l4xx_hal_uart.o(i.UART_WaitOnFlagUntilTimeout)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = UART_WaitOnFlagUntilTimeout +
    +
    [Calls]
    • >>   HAL_GetTick +
    +
    [Called By]
    • >>   HAL_UART_Transmit +
    • >>   UART_CheckIdleState +
    + +

    USART2_IRQHandler (Thumb, 10 bytes, Stack size 8 bytes, stm32l4xx_it.o(i.USART2_IRQHandler)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = USART2_IRQHandler ⇒ HAL_UART_IRQHandler ⇒ HAL_DMA_Abort_IT +
    +
    [Calls]
    • >>   HAL_UART_IRQHandler +
    +
    [Address Reference Count : 1]
    • startup_stm32l431xx.o(RESET) +
    +

    USART3_IRQHandler (Thumb, 10 bytes, Stack size 8 bytes, stm32l4xx_it.o(i.USART3_IRQHandler)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = USART3_IRQHandler ⇒ HAL_UART_IRQHandler ⇒ HAL_DMA_Abort_IT +
    +
    [Calls]
    • >>   HAL_UART_IRQHandler +
    +
    [Address Reference Count : 1]
    • startup_stm32l431xx.o(RESET) +
    +

    UsageFault_Handler (Thumb, 4 bytes, Stack size 0 bytes, stm32l4xx_it.o(i.UsageFault_Handler)) +
    [Address Reference Count : 1]

    • startup_stm32l431xx.o(RESET) +
    +

    Write_IIC_Byte (Thumb, 96 bytes, Stack size 24 bytes, oled.o(i.Write_IIC_Byte)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = Write_IIC_Byte +
    +
    [Calls]
    • >>   HAL_GPIO_WritePin +
    +
    [Called By]
    • >>   Write_IIC_Data +
    • >>   Write_IIC_Command +
    + +

    Write_IIC_Command (Thumb, 44 bytes, Stack size 8 bytes, oled.o(i.Write_IIC_Command)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = Write_IIC_Command ⇒ Write_IIC_Byte +
    +
    [Calls]
    • >>   Write_IIC_Byte +
    • >>   IIC_Wait_Ack +
    • >>   IIC_Stop +
    • >>   IIC_Start +
    +
    [Called By]
    • >>   OLED_WR_Byte +
    + +

    Write_IIC_Data (Thumb, 44 bytes, Stack size 8 bytes, oled.o(i.Write_IIC_Data)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = Write_IIC_Data ⇒ Write_IIC_Byte +
    +
    [Calls]
    • >>   Write_IIC_Byte +
    • >>   IIC_Wait_Ack +
    • >>   IIC_Stop +
    • >>   IIC_Start +
    +
    [Called By]
    • >>   OLED_WR_Byte +
    + +

    __0printf$5 (Thumb, 22 bytes, Stack size 24 bytes, printf5.o(i.__0printf$5), UNUSED) +

    [Calls]

    • >>   _printf_core +
    + +

    __1printf$5 (Thumb, 0 bytes, Stack size 24 bytes, printf5.o(i.__0printf$5), UNUSED) + +

    __2printf (Thumb, 0 bytes, Stack size 24 bytes, printf5.o(i.__0printf$5)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = __2printf +
    +
    [Called By]
    • >>   main +
    • >>   tos_kv_walkthru +
    • >>   tos_kv_init +
    • >>   task +
    • >>   disp_value +
    • >>   kv_u8_disp +
    • >>   kv_block_walkthru +
    + +

    __scatterload_copy (Thumb, 14 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_copy), UNUSED) + +

    __scatterload_null (Thumb, 2 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_null), UNUSED) + +

    __scatterload_zeroinit (Thumb, 14 bytes, Stack size unknown bytes, handlers.o(i.__scatterload_zeroinit), UNUSED) + +

    application_entry (Thumb, 14 bytes, Stack size 8 bytes, kv_sample.o(i.application_entry)) +

    [Stack]

    • Max Depth = 120 + Unknown Stack Size +
    • Call Chain = application_entry ⇒ osThreadCreate ⇒ tos_task_create ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   osThreadCreate +
    +
    [Address Reference Count : 1]
    • main.o(.constdata) +
    +

    board_init (Thumb, 110 bytes, Stack size 8 bytes, mcu_init.o(i.board_init)) +

    [Stack]

    • Max Depth = 288
    • Call Chain = board_init ⇒ SystemClock_Config ⇒ HAL_RCC_OscConfig ⇒ HAL_InitTick ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   OLED_ShowString +
    • >>   OLED_ShowChinese +
    • >>   OLED_Init +
    • >>   OLED_Clear +
    • >>   MX_USART3_UART_Init +
    • >>   MX_USART2_UART_Init +
    • >>   HAL_Init +
    • >>   DHT11_Init +
    • >>   SystemClock_Config +
    • >>   MX_GPIO_Init +
    +
    [Called By]
    • >>   main +
    + +

    cpu_context_switch (Thumb, 8 bytes, Stack size 8 bytes, tos_cpu.o(i.cpu_context_switch)) +

    [Stack]

    • Max Depth = 8 + Unknown Stack Size +
    • Call Chain = cpu_context_switch +
    +
    [Calls]
    • >>   port_context_switch +
    +
    [Called By]
    • >>   knl_sched +
    + +

    cpu_init (Thumb, 30 bytes, Stack size 8 bytes, tos_cpu.o(i.cpu_init)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = cpu_init ⇒ __aeabi_uldivmod +
    +
    [Calls]
    • >>   cpu_systick_init +
    • >>   __aeabi_uldivmod +
    +
    [Called By]
    • >>   tos_knl_init +
    + +

    cpu_irq_context_switch (Thumb, 8 bytes, Stack size 8 bytes, tos_cpu.o(i.cpu_irq_context_switch)) +

    [Stack]

    • Max Depth = 8 + Unknown Stack Size +
    • Call Chain = cpu_irq_context_switch +
    +
    [Calls]
    • >>   port_irq_context_switch +
    +
    [Called By]
    • >>   tos_knl_irq_leave +
    + +

    cpu_sched_start (Thumb, 4 bytes, Stack size 0 bytes, tos_cpu.o(i.cpu_sched_start)) +

    [Calls]

    • >>   port_sched_start +
    +
    [Called By]
    • >>   tos_knl_start +
    + +

    cpu_systick_init (Thumb, 18 bytes, Stack size 8 bytes, tos_cpu.o(i.cpu_systick_init)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = cpu_systick_init ⇒ port_systick_config ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   port_systick_priority_set +
    • >>   port_systick_config +
    +
    [Called By]
    • >>   cpu_init +
    + +

    cpu_task_stk_init (Thumb, 216 bytes, Stack size 20 bytes, tos_cpu.o(i.cpu_task_stk_init)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = cpu_task_stk_init +
    +
    [Called By]
    • >>   tos_task_create +
    + +

    disp_value (Thumb, 48 bytes, Stack size 16 bytes, kv_sample.o(i.disp_value)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = disp_value ⇒ __2printf +
    +
    [Calls]
    • >>   __2printf +
    +
    [Called By]
    • >>   task +
    + +

    fputc (Thumb, 42 bytes, Stack size 16 bytes, mcu_init.o(i.fputc)) +

    [Stack]

    • Max Depth = 72
    • Call Chain = fputc ⇒ HAL_UART_Transmit ⇒ UART_WaitOnFlagUntilTimeout +
    +
    [Calls]
    • >>   HAL_UART_Transmit +
    +
    [Address Reference Count : 1]
    • printf5.o(i.__0printf$5) +
    +

    hal_spi_flash_erase (Thumb, 80 bytes, Stack size 24 bytes, hal_qspi_flash_1.o(i.hal_spi_flash_erase)) +

    [Stack]

    • Max Depth = 216
    • Call Chain = hal_spi_flash_erase ⇒ prv_spi_flash_erase_sector ⇒ prv_spi_flash_wait_write_end ⇒ QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   prv_spi_flash_erase_sector +
    +
    [Called By]
    • >>   stm32l4_qspiflash_erase +
    + +

    hal_spi_flash_read (Thumb, 84 bytes, Stack size 40 bytes, hal_qspi_flash_1.o(i.hal_spi_flash_read)) +

    [Stack]

    • Max Depth = 184
    • Call Chain = hal_spi_flash_read ⇒ QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   QSPI_Send_CMD +
    • >>   QSPI_Receive +
    +
    [Called By]
    • >>   stm32l4_qspiflash_read +
    + +

    hal_spi_flash_write (Thumb, 466 bytes, Stack size 64 bytes, hal_qspi_flash_1.o(i.hal_spi_flash_write)) +

    [Stack]

    • Max Depth = 264
    • Call Chain = hal_spi_flash_write ⇒ prv_spi_flash_write_page ⇒ prv_spi_flash_wait_write_end ⇒ QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   prv_spi_flash_write_page +
    +
    [Called By]
    • >>   stm32l4_qspiflash_write +
    + +

    knl_idle_init (Thumb, 38 bytes, Stack size 24 bytes, tos_sys.o(i.knl_idle_init)) +

    [Stack]

    • Max Depth = 96 + Unknown Stack Size +
    • Call Chain = knl_idle_init ⇒ tos_task_create ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   tos_task_create +
    +
    [Called By]
    • >>   tos_knl_init +
    + +

    knl_is_idle (Thumb, 16 bytes, Stack size 0 bytes, tos_sys.o(i.knl_is_idle)) +

    [Called By]

    • >>   task_do_destroy +
    • >>   tos_task_create +
    + +

    knl_is_inirq (Thumb, 14 bytes, Stack size 0 bytes, tos_sys.o(i.knl_is_inirq)) +

    [Called By]

    • >>   tos_knl_irq_leave +
    • >>   knl_sched +
    • >>   tos_task_prio_change +
    • >>   tos_mutex_post +
    • >>   tos_mutex_pend_timed +
    • >>   tos_mutex_create +
    • >>   tos_task_destroy +
    • >>   tos_task_create +
    • >>   tos_knl_sched_unlock +
    • >>   tos_knl_sched_lock +
    + +

    knl_is_sched_locked (Thumb, 14 bytes, Stack size 0 bytes, tos_sys.o(i.knl_is_sched_locked)) +

    [Called By]

    • >>   tos_knl_irq_leave +
    • >>   knl_sched +
    • >>   tos_mutex_pend_timed +
    • >>   tos_task_destroy +
    • >>   tos_knl_sched_unlock +
    + +

    knl_is_self (Thumb, 18 bytes, Stack size 0 bytes, tos_sys.o(i.knl_is_self)) +

    [Called By]

    • >>   tos_knl_irq_leave +
    • >>   knl_sched +
    • >>   tos_task_prio_change +
    • >>   tos_mutex_post +
    • >>   tos_mutex_pend_timed +
    • >>   tos_task_destroy +
    + +

    knl_sched (Thumb, 94 bytes, Stack size 8 bytes, tos_sys.o(i.knl_sched)) +

    [Stack]

    • Max Depth = 16 + Unknown Stack Size +
    • Call Chain = knl_sched ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_knl_is_running +
    • >>   knl_is_sched_locked +
    • >>   knl_is_inirq +
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    • >>   knl_is_self +
    • >>   cpu_context_switch +
    • >>   readyqueue_highest_ready_task_get +
    +
    [Called By]
    • >>   tos_task_prio_change +
    • >>   tos_mutex_post +
    • >>   tos_mutex_pend_timed +
    • >>   task_do_destroy +
    • >>   tos_task_create +
    • >>   tos_knl_sched_unlock +
    + +

    main (Thumb, 32 bytes, Stack size 8 bytes, main.o(i.main)) +

    [Stack]

    • Max Depth = 296 + Unknown Stack Size +
    • Call Chain = main ⇒ board_init ⇒ SystemClock_Config ⇒ HAL_RCC_OscConfig ⇒ HAL_InitTick ⇒ HAL_NVIC_SetPriority ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   osThreadCreate +
    • >>   osKernelStart +
    • >>   osKernelInitialize +
    • >>   board_init +
    • >>   __2printf +
    +
    [Address Reference Count : 1]
    • entry9a.o(.ARM.Collect$$$$0000000B) +
    +

    mmheap_init_with_pool (Thumb, 20 bytes, Stack size 16 bytes, tos_mmheap.o(i.mmheap_init_with_pool)) +

    [Stack]

    • Max Depth = 112 + Unknown Stack Size +
    • Call Chain = mmheap_init_with_pool ⇒ tos_mmheap_pool_add ⇒ blk_insert ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   tos_mmheap_pool_add +
    • >>   mmheap_ctl_init +
    +
    [Called By]
    • >>   tos_knl_init +
    + +

    mutex_release (Thumb, 20 bytes, Stack size 8 bytes, tos_mutex.o(i.mutex_release)) +

    [Stack]

    • Max Depth = 88 + Unknown Stack Size +
    • Call Chain = mutex_release ⇒ pend_wakeup_all ⇒ pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   pend_wakeup_all +
    • >>   mutex_old_owner_release +
    +
    [Called By]
    • >>   task_mutex_release +
    + +

    osKernelInitialize (Thumb, 14 bytes, Stack size 8 bytes, cmsis_os.o(i.osKernelInitialize)) +

    [Stack]

    • Max Depth = 128 + Unknown Stack Size +
    • Call Chain = osKernelInitialize ⇒ tos_knl_init ⇒ mmheap_init_with_pool ⇒ tos_mmheap_pool_add ⇒ blk_insert ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   tos_knl_init +
    • >>   errno_knl2cmsis +
    +
    [Called By]
    • >>   main +
    + +

    osKernelStart (Thumb, 14 bytes, Stack size 8 bytes, cmsis_os.o(i.osKernelStart)) +

    [Stack]

    • Max Depth = 16 + Unknown Stack Size +
    • Call Chain = osKernelStart ⇒ tos_knl_start +
    +
    [Calls]
    • >>   tos_knl_start +
    • >>   errno_knl2cmsis +
    +
    [Called By]
    • >>   main +
    + +

    osThreadCreate (Thumb, 66 bytes, Stack size 40 bytes, cmsis_os.o(i.osThreadCreate)) +

    [Stack]

    • Max Depth = 112 + Unknown Stack Size +
    • Call Chain = osThreadCreate ⇒ tos_task_create ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   tos_task_create +
    • >>   priority_cmsis2knl +
    +
    [Called By]
    • >>   main +
    • >>   application_entry +
    + +

    pend_highest_pending_prio_get (Thumb, 32 bytes, Stack size 16 bytes, tos_pend.o(i.pend_highest_pending_prio_get)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = pend_highest_pending_prio_get +
    +
    [Calls]
    • >>   tos_list_empty +
    +
    [Called By]
    • >>   tos_mutex_post +
    • >>   task_highest_pending_prio_get +
    + +

    pend_highest_pending_task_get (Thumb, 8 bytes, Stack size 0 bytes, tos_pend.o(i.pend_highest_pending_task_get)) +

    [Called By]

    • >>   tos_mutex_post +
    + +

    pend_is_nopending (Thumb, 12 bytes, Stack size 8 bytes, tos_pend.o(i.pend_is_nopending)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = pend_is_nopending +
    +
    [Calls]
    • >>   tos_list_empty +
    +
    [Called By]
    • >>   tos_mutex_post +
    + +

    pend_list_adjust (Thumb, 22 bytes, Stack size 8 bytes, tos_pend.o(i.pend_list_adjust)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = pend_list_adjust ⇒ pend_list_add +
    +
    [Calls]
    • >>   tos_list_del +
    • >>   pend_list_add +
    +
    [Called By]
    • >>   tos_task_prio_change +
    + +

    pend_list_remove (Thumb, 30 bytes, Stack size 8 bytes, tos_pend.o(i.pend_list_remove)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = pend_list_remove +
    +
    [Calls]
    • >>   tos_list_del +
    +
    [Called By]
    • >>   pend_task_wakeup +
    • >>   task_do_destroy +
    + +

    pend_object_init (Thumb, 12 bytes, Stack size 8 bytes, tos_pend.o(i.pend_object_init)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = pend_object_init +
    +
    [Calls]
    • >>   tos_list_init +
    +
    [Called By]
    • >>   tos_mutex_create +
    + +

    pend_state2errno (Thumb, 46 bytes, Stack size 0 bytes, tos_pend.o(i.pend_state2errno)) +

    [Called By]

    • >>   tos_mutex_pend_timed +
    + +

    pend_task_block (Thumb, 60 bytes, Stack size 24 bytes, tos_pend.o(i.pend_task_block)) +

    [Stack]

    • Max Depth = 104 + Unknown Stack Size +
    • Call Chain = pend_task_block ⇒ tick_list_add ⇒ tick_task_place ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tick_list_add +
    • >>   readyqueue_remove +
    • >>   pend_list_add +
    +
    [Called By]
    • >>   tos_mutex_pend_timed +
    + +

    pend_task_wakeup (Thumb, 64 bytes, Stack size 16 bytes, tos_pend.o(i.pend_task_wakeup)) +

    [Stack]

    • Max Depth = 56 + Unknown Stack Size +
    • Call Chain = pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   tick_list_remove +
    • >>   readyqueue_add +
    • >>   pend_list_remove +
    +
    [Called By]
    • >>   pend_wakeup_all +
    • >>   pend_wakeup_one +
    • >>   tick_update +
    + +

    pend_wakeup_all (Thumb, 36 bytes, Stack size 24 bytes, tos_pend.o(i.pend_wakeup_all)) +

    [Stack]

    • Max Depth = 80 + Unknown Stack Size +
    • Call Chain = pend_wakeup_all ⇒ pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   pend_task_wakeup +
    +
    [Called By]
    • >>   mutex_release +
    + +

    pend_wakeup_one (Thumb, 20 bytes, Stack size 16 bytes, tos_pend.o(i.pend_wakeup_one)) +

    [Stack]

    • Max Depth = 72 + Unknown Stack Size +
    • Call Chain = pend_wakeup_one ⇒ pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   pend_task_wakeup +
    +
    [Called By]
    • >>   tos_mutex_post +
    + +

    port_systick_config (Thumb, 50 bytes, Stack size 16 bytes, port_c.o(i.port_systick_config)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = port_systick_config ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   __NVIC_SetPriority +
    +
    [Called By]
    • >>   cpu_systick_init +
    + +

    port_systick_priority_set (Thumb, 16 bytes, Stack size 8 bytes, port_c.o(i.port_systick_priority_set)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = port_systick_priority_set ⇒ __NVIC_SetPriority +
    +
    [Calls]
    • >>   __NVIC_SetPriority +
    +
    [Called By]
    • >>   cpu_systick_init +
    + +

    prv_spi_flash_erase_sector (Thumb, 50 bytes, Stack size 24 bytes, hal_qspi_flash_1.o(i.prv_spi_flash_erase_sector)) +

    [Stack]

    • Max Depth = 192
    • Call Chain = prv_spi_flash_erase_sector ⇒ prv_spi_flash_wait_write_end ⇒ QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   QSPI_Send_CMD +
    • >>   prv_spi_flash_write_enable +
    • >>   prv_spi_flash_wait_write_end +
    +
    [Called By]
    • >>   hal_spi_flash_erase +
    + +

    readyqueue_add (Thumb, 32 bytes, Stack size 8 bytes, tos_sched.o(i.readyqueue_add)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   readyqueue_add_tail +
    • >>   readyqueue_add_head +
    +
    [Called By]
    • >>   pend_task_wakeup +
    + +

    readyqueue_add_head (Thumb, 48 bytes, Stack size 24 bytes, tos_sched.o(i.readyqueue_add_head)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = readyqueue_add_head +
    +
    [Calls]
    • >>   tos_list_empty +
    • >>   readyqueue_prio_mark +
    • >>   _list_add +
    +
    [Called By]
    • >>   readyqueue_add +
    • >>   tos_task_prio_change +
    + +

    readyqueue_add_tail (Thumb, 38 bytes, Stack size 16 bytes, tos_sched.o(i.readyqueue_add_tail)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   tos_list_empty +
    • >>   tos_list_add_tail +
    • >>   readyqueue_prio_mark +
    +
    [Called By]
    • >>   readyqueue_add +
    • >>   tos_task_prio_change +
    • >>   tos_task_create +
    + +

    readyqueue_highest_ready_task_get (Thumb, 18 bytes, Stack size 0 bytes, tos_sched.o(i.readyqueue_highest_ready_task_get)) +

    [Called By]

    • >>   tos_knl_irq_leave +
    • >>   knl_sched +
    • >>   tos_knl_start +
    + +

    readyqueue_init (Thumb, 60 bytes, Stack size 0 bytes, tos_sched.o(i.readyqueue_init)) +

    [Called By]

    • >>   tos_knl_init +
    + +

    readyqueue_remove (Thumb, 94 bytes, Stack size 16 bytes, tos_sched.o(i.readyqueue_remove)) +

    [Stack]

    • Max Depth = 40 + Unknown Stack Size +
    • Call Chain = readyqueue_remove ⇒ readyqueue_prio_highest_get ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   tos_list_empty +
    • >>   readyqueue_prio_highest_get +
    • >>   _list_del +
    +
    [Called By]
    • >>   pend_task_block +
    • >>   tos_task_prio_change +
    • >>   task_do_destroy +
    + +

    stm32l4_qspiflash_erase (Thumb, 16 bytes, Stack size 16 bytes, qspi_flash_kv.o(i.stm32l4_qspiflash_erase)) +

    [Stack]

    • Max Depth = 232
    • Call Chain = stm32l4_qspiflash_erase ⇒ hal_spi_flash_erase ⇒ prv_spi_flash_erase_sector ⇒ prv_spi_flash_wait_write_end ⇒ QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   hal_spi_flash_erase +
    +
    [Address Reference Count : 1]
    • qspi_flash_kv.o(.data) +
    +

    stm32l4_qspiflash_read (Thumb, 20 bytes, Stack size 16 bytes, qspi_flash_kv.o(i.stm32l4_qspiflash_read)) +

    [Stack]

    • Max Depth = 200
    • Call Chain = stm32l4_qspiflash_read ⇒ hal_spi_flash_read ⇒ QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   hal_spi_flash_read +
    +
    [Address Reference Count : 1]
    • qspi_flash_kv.o(.data) +
    +

    stm32l4_qspiflash_write (Thumb, 22 bytes, Stack size 24 bytes, qspi_flash_kv.o(i.stm32l4_qspiflash_write)) +

    [Stack]

    • Max Depth = 288
    • Call Chain = stm32l4_qspiflash_write ⇒ hal_spi_flash_write ⇒ prv_spi_flash_write_page ⇒ prv_spi_flash_wait_write_end ⇒ QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   hal_spi_flash_write +
    +
    [Address Reference Count : 1]
    • qspi_flash_kv.o(.data) +
    +

    task (Thumb, 256 bytes, Stack size 64 bytes, kv_sample.o(i.task)) +

    [Stack]

    • Max Depth = 392 + Unknown Stack Size +
    • Call Chain = task ⇒ tos_kv_set ⇒ kv_item_update ⇒ kv_item_save ⇒ kv_blk_search_suitable ⇒ kv_gc ⇒ kv_mgr_blk_index_rebuild ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   tos_kv_walkthru +
    • >>   tos_kv_set +
    • >>   tos_kv_init +
    • >>   tos_kv_has_key +
    • >>   tos_kv_get +
    • >>   tos_kv_del +
    • >>   disp_value +
    • >>   MX_QUADSPI_Init +
    • >>   __2printf +
    +
    [Address Reference Count : 1]
    • kv_sample.o(.constdata) +
    +

    task_free_all (Thumb, 66 bytes, Stack size 24 bytes, tos_task.o(i.task_free_all)) +

    [Stack]

    • Max Depth = 136 + Unknown Stack Size +
    • Call Chain = task_free_all ⇒ task_free ⇒ tos_mmheap_free ⇒ blk_merge_prev ⇒ blk_remove ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    • >>   tos_list_del +
    • >>   task_free +
    +
    [Called By]
    • >>   knl_idle_entry +
    + +

    tick_list_add (Thumb, 32 bytes, Stack size 16 bytes, tos_tick.o(i.tick_list_add)) +

    [Stack]

    • Max Depth = 80 + Unknown Stack Size +
    • Call Chain = tick_list_add ⇒ tick_task_place ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tick_task_place +
    +
    [Called By]
    • >>   pend_task_block +
    + +

    tick_list_remove (Thumb, 24 bytes, Stack size 8 bytes, tos_tick.o(i.tick_list_remove)) +

    [Stack]

    • Max Depth = 32 + Unknown Stack Size +
    • Call Chain = tick_list_remove ⇒ tick_task_takeoff ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tick_task_takeoff +
    +
    [Called By]
    • >>   pend_task_wakeup +
    • >>   task_do_destroy +
    + +

    tick_update (Thumb, 180 bytes, Stack size 32 bytes, tos_tick.o(i.tick_update)) +

    [Stack]

    • Max Depth = 88 + Unknown Stack Size +
    • Call Chain = tick_update ⇒ pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   pend_task_wakeup +
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    • >>   tos_list_empty +
    +
    [Called By]
    • >>   tos_tick_handler +
    + +

    timer_init (Thumb, 4 bytes, Stack size 0 bytes, tos_timer.o(i.timer_init)) +

    [Called By]

    • >>   tos_knl_init +
    + +

    timer_update (Thumb, 118 bytes, Stack size 16 bytes, tos_timer.o(i.timer_update)) +

    [Stack]

    • Max Depth = 48 + Unknown Stack Size +
    • Call Chain = timer_update ⇒ timer_takeoff ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_knl_sched_unlock +
    • >>   tos_knl_sched_lock +
    • >>   timer_takeoff +
    • >>   timer_place +
    +
    [Called By]
    • >>   tos_tick_handler +
    + +

    tos_cpu_clz (Thumb, 12 bytes, Stack size 8 bytes, tos_cpu.o(i.tos_cpu_clz)) +

    [Stack]

    • Max Depth = 8 + Unknown Stack Size +
    • Call Chain = tos_cpu_clz +
    +
    [Calls]
    • >>   port_clz +
    +
    [Called By]
    • >>   generic_fls +
    • >>   readyqueue_prio_highest_get +
    + +

    tos_cpu_cpsr_restore (Thumb, 12 bytes, Stack size 8 bytes, tos_cpu.o(i.tos_cpu_cpsr_restore)) +

    [Stack]

    • Max Depth = 8 + Unknown Stack Size +
    • Call Chain = tos_cpu_cpsr_restore +
    +
    [Calls]
    • >>   port_cpsr_restore +
    +
    [Called By]
    • >>   tos_knl_irq_leave +
    • >>   knl_sched +
    • >>   tos_task_prio_change +
    • >>   tos_mutex_post +
    • >>   tos_mutex_pend_timed +
    • >>   tick_task_takeoff +
    • >>   tick_task_place +
    • >>   task_do_destroy +
    • >>   tos_task_create +
    • >>   task_free_all +
    • >>   tos_knl_sched_unlock +
    • >>   tos_knl_sched_lock +
    • >>   timer_takeoff +
    • >>   timer_place +
    • >>   tick_update +
    + +

    tos_cpu_cpsr_save (Thumb, 8 bytes, Stack size 8 bytes, tos_cpu.o(i.tos_cpu_cpsr_save)) +

    [Stack]

    • Max Depth = 8 + Unknown Stack Size +
    • Call Chain = tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   port_cpsr_save +
    +
    [Called By]
    • >>   tos_knl_irq_leave +
    • >>   knl_sched +
    • >>   tos_task_prio_change +
    • >>   tos_mutex_post +
    • >>   tos_mutex_pend_timed +
    • >>   tick_task_takeoff +
    • >>   tick_task_place +
    • >>   task_do_destroy +
    • >>   tos_task_create +
    • >>   task_free_all +
    • >>   tos_knl_sched_unlock +
    • >>   tos_knl_sched_lock +
    • >>   timer_takeoff +
    • >>   timer_place +
    • >>   tick_update +
    + +

    tos_knl_init (Thumb, 56 bytes, Stack size 8 bytes, tos_sys.o(i.tos_knl_init)) +

    [Stack]

    • Max Depth = 120 + Unknown Stack Size +
    • Call Chain = tos_knl_init ⇒ mmheap_init_with_pool ⇒ tos_mmheap_pool_add ⇒ blk_insert ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   mmheap_init_with_pool +
    • >>   timer_init +
    • >>   cpu_init +
    • >>   knl_idle_init +
    • >>   readyqueue_init +
    +
    [Called By]
    • >>   osKernelInitialize +
    + +

    tos_knl_irq_enter (Thumb, 42 bytes, Stack size 4 bytes, tos_sys.o(i.tos_knl_irq_enter)) +

    [Stack]

    • Max Depth = 4
    • Call Chain = tos_knl_irq_enter +
    +
    [Calls]
    • >>   tos_knl_is_running +
    +
    [Called By]
    • >>   SysTick_Handler +
    + +

    tos_knl_irq_leave (Thumb, 134 bytes, Stack size 8 bytes, tos_sys.o(i.tos_knl_irq_leave)) +

    [Stack]

    • Max Depth = 16 + Unknown Stack Size +
    • Call Chain = tos_knl_irq_leave ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_knl_is_running +
    • >>   knl_is_sched_locked +
    • >>   knl_is_inirq +
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    • >>   knl_is_self +
    • >>   cpu_irq_context_switch +
    • >>   readyqueue_highest_ready_task_get +
    +
    [Called By]
    • >>   SysTick_Handler +
    + +

    tos_knl_is_running (Thumb, 14 bytes, Stack size 0 bytes, tos_sys.o(i.tos_knl_is_running)) +

    [Called By]

    • >>   tos_tick_handler +
    • >>   tos_knl_irq_leave +
    • >>   tos_knl_irq_enter +
    • >>   SysTick_Handler +
    • >>   knl_sched +
    • >>   tos_task_create +
    • >>   tos_knl_start +
    • >>   tos_knl_sched_unlock +
    • >>   tos_knl_sched_lock +
    • >>   kv_unlock +
    • >>   kv_lock +
    + +

    tos_knl_sched_lock (Thumb, 88 bytes, Stack size 8 bytes, tos_sys.o(i.tos_knl_sched_lock)) +

    [Stack]

    • Max Depth = 16 + Unknown Stack Size +
    • Call Chain = tos_knl_sched_lock ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_knl_is_running +
    • >>   knl_is_inirq +
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    +
    [Called By]
    • >>   timer_update +
    + +

    tos_knl_sched_unlock (Thumb, 90 bytes, Stack size 8 bytes, tos_sys.o(i.tos_knl_sched_unlock)) +

    [Stack]

    • Max Depth = 24 + Unknown Stack Size +
    • Call Chain = tos_knl_sched_unlock ⇒ knl_sched ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_knl_is_running +
    • >>   knl_sched +
    • >>   knl_is_sched_locked +
    • >>   knl_is_inirq +
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    +
    [Called By]
    • >>   timer_update +
    + +

    tos_knl_start (Thumb, 52 bytes, Stack size 8 bytes, tos_sys.o(i.tos_knl_start)) +

    [Stack]

    • Max Depth = 8 + Unknown Stack Size +
    • Call Chain = tos_knl_start +
    +
    [Calls]
    • >>   tos_knl_is_running +
    • >>   cpu_sched_start +
    • >>   readyqueue_highest_ready_task_get +
    +
    [Called By]
    • >>   osKernelStart +
    + +

    tos_kv_del (Thumb, 68 bytes, Stack size 16 bytes, tos_kv.o(i.tos_kv_del)) +

    [Stack]

    • Max Depth = 216 + Unknown Stack Size +
    • Call Chain = tos_kv_del ⇒ kv_item_find ⇒ kv_item_do_find ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_unlock +
    • >>   kv_lock +
    • >>   kv_item_free +
    • >>   kv_item_find +
    • >>   kv_item_delete +
    • >>   strlen +
    +
    [Called By]
    • >>   task +
    + +

    tos_kv_get (Thumb, 114 bytes, Stack size 32 bytes, tos_kv.o(i.tos_kv_get)) +

    [Stack]

    • Max Depth = 232 + Unknown Stack Size +
    • Call Chain = tos_kv_get ⇒ kv_item_find ⇒ kv_item_do_find ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_unlock +
    • >>   kv_lock +
    • >>   kv_item_free +
    • >>   kv_item_find +
    • >>   strlen +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   task +
    + +

    tos_kv_has_key (Thumb, 52 bytes, Stack size 16 bytes, tos_kv.o(i.tos_kv_has_key)) +

    [Stack]

    • Max Depth = 216 + Unknown Stack Size +
    • Call Chain = tos_kv_has_key ⇒ kv_item_find ⇒ kv_item_do_find ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_unlock +
    • >>   kv_lock +
    • >>   kv_item_find +
    • >>   strlen +
    +
    [Called By]
    • >>   task +
    + +

    tos_kv_init (Thumb, 98 bytes, Stack size 16 bytes, tos_kv.o(i.tos_kv_init)) +

    [Stack]

    • Max Depth = 216 + Unknown Stack Size +
    • Call Chain = tos_kv_init ⇒ kv_mgr_workspace_locate ⇒ kv_mgr_blk_index_rebuild ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_param_verify +
    • >>   kv_mgr_workspace_locate +
    • >>   kv_mgr_ctl_init +
    • >>   kv_mgr_ctl_build +
    • >>   kv_flash_ctl_init +
    • >>   __2printf +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   task +
    + +

    tos_kv_set (Thumb, 100 bytes, Stack size 24 bytes, tos_kv.o(i.tos_kv_set)) +

    [Stack]

    • Max Depth = 328 + Unknown Stack Size +
    • Call Chain = tos_kv_set ⇒ kv_item_update ⇒ kv_item_save ⇒ kv_blk_search_suitable ⇒ kv_gc ⇒ kv_mgr_blk_index_rebuild ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_unlock +
    • >>   kv_lock +
    • >>   kv_item_update +
    • >>   kv_item_save +
    • >>   kv_item_free +
    • >>   kv_item_find +
    • >>   strlen +
    +
    [Called By]
    • >>   task +
    + +

    tos_kv_walkthru (Thumb, 156 bytes, Stack size 24 bytes, tos_kv.o(i.tos_kv_walkthru)) +

    [Stack]

    • Max Depth = 208 + Unknown Stack Size +
    • Call Chain = tos_kv_walkthru ⇒ kv_block_walkthru ⇒ kv_item_body_read ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_block_walkthru +
    • >>   kv_blk_hdr_read +
    • >>   __2printf +
    +
    [Called By]
    • >>   task +
    + +

    tos_mmheap_alloc (Thumb, 38 bytes, Stack size 16 bytes, tos_mmheap.o(i.tos_mmheap_alloc)) +

    [Stack]

    • Max Depth = 128 + Unknown Stack Size +
    • Call Chain = tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   blk_prepare_used +
    • >>   blk_locate_free +
    • >>   adjust_request_size +
    +
    [Called By]
    • >>   kv_mgr_ctl_init +
    • >>   kv_item_walkthru +
    • >>   kv_item_try_delete +
    • >>   kv_item_do_save +
    • >>   kv_item_body_read +
    • >>   kv_block_walkthru +
    + +

    tos_mmheap_free (Thumb, 48 bytes, Stack size 16 bytes, tos_mmheap.o(i.tos_mmheap_free)) +

    [Stack]

    • Max Depth = 104 + Unknown Stack Size +
    • Call Chain = tos_mmheap_free ⇒ blk_merge_prev ⇒ blk_remove ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   blk_merge_prev +
    • >>   blk_merge_next +
    • >>   blk_mark_as_free +
    • >>   blk_insert +
    +
    [Called By]
    • >>   task_free +
    • >>   kv_item_try_delete +
    • >>   kv_item_is_moved +
    • >>   kv_item_free +
    • >>   kv_item_do_save +
    • >>   kv_item_body_read +
    + +

    tos_mmheap_pool_add (Thumb, 182 bytes, Stack size 24 bytes, tos_mmheap.o(i.tos_mmheap_pool_add)) +

    [Stack]

    • Max Depth = 96 + Unknown Stack Size +
    • Call Chain = tos_mmheap_pool_add ⇒ blk_insert ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   offset_to_blk +
    • >>   mmheap_pool_is_exist +
    • >>   blk_set_used +
    • >>   blk_set_size +
    • >>   blk_set_prev_used +
    • >>   blk_set_prev_free +
    • >>   blk_set_free +
    • >>   blk_link_next +
    • >>   blk_insert +
    +
    [Called By]
    • >>   mmheap_init_with_pool +
    + +

    tos_mutex_create (Thumb, 86 bytes, Stack size 8 bytes, tos_mutex.o(i.tos_mutex_create)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = tos_mutex_create ⇒ pend_object_init +
    +
    [Calls]
    • >>   pend_object_init +
    • >>   knl_is_inirq +
    +
    [Called By]
    • >>   kv_mgr_ctl_init +
    + +

    tos_mutex_pend (Thumb, 18 bytes, Stack size 8 bytes, tos_mutex.o(i.tos_mutex_pend)) +

    [Stack]

    • Max Depth = 136 + Unknown Stack Size +
    • Call Chain = tos_mutex_pend ⇒ tos_mutex_pend_timed ⇒ pend_task_block ⇒ tick_list_add ⇒ tick_task_place ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_mutex_pend_timed +
    +
    [Called By]
    • >>   kv_lock +
    + +

    tos_mutex_pend_timed (Thumb, 288 bytes, Stack size 24 bytes, tos_mutex.o(i.tos_mutex_pend_timed)) +

    [Stack]

    • Max Depth = 128 + Unknown Stack Size +
    • Call Chain = tos_mutex_pend_timed ⇒ pend_task_block ⇒ tick_list_add ⇒ tick_task_place ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   pend_task_block +
    • >>   pend_state2errno +
    • >>   knl_sched +
    • >>   knl_is_sched_locked +
    • >>   knl_is_inirq +
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    • >>   tos_task_prio_change +
    • >>   knl_is_self +
    • >>   mutex_fresh_owner_mark +
    • >>   knl_object_verify +
    +
    [Called By]
    • >>   tos_mutex_pend +
    + +

    tos_mutex_post (Thumb, 238 bytes, Stack size 32 bytes, tos_mutex.o(i.tos_mutex_post)) +

    [Stack]

    • Max Depth = 112 + Unknown Stack Size +
    • Call Chain = tos_mutex_post ⇒ mutex_old_owner_release ⇒ tos_task_prio_change ⇒ readyqueue_remove ⇒ readyqueue_prio_highest_get ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   pend_is_nopending +
    • >>   knl_sched +
    • >>   knl_is_inirq +
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    • >>   tos_task_prio_change +
    • >>   pend_wakeup_one +
    • >>   pend_highest_pending_task_get +
    • >>   pend_highest_pending_prio_get +
    • >>   knl_is_self +
    • >>   mutex_old_owner_release +
    • >>   mutex_fresh_owner_mark +
    • >>   knl_object_verify +
    +
    [Called By]
    • >>   kv_unlock +
    + +

    tos_task_create (Thumb, 294 bytes, Stack size 40 bytes, tos_task.o(i.tos_task_create)) +

    [Stack]

    • Max Depth = 72 + Unknown Stack Size +
    • Call Chain = tos_task_create ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   tos_knl_is_running +
    • >>   knl_sched +
    • >>   knl_is_inirq +
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    • >>   cpu_task_stk_init +
    • >>   tos_list_add +
    • >>   task_reset +
    • >>   knl_is_idle +
    • >>   readyqueue_add_tail +
    +
    [Called By]
    • >>   osThreadCreate +
    • >>   knl_idle_init +
    + +

    tos_task_destroy (Thumb, 112 bytes, Stack size 8 bytes, tos_task.o(i.tos_task_destroy)) +

    [Stack]

    • Max Depth = 128 + Unknown Stack Size +
    • Call Chain = tos_task_destroy ⇒ task_do_destroy ⇒ task_mutex_release ⇒ mutex_release ⇒ pend_wakeup_all ⇒ pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   knl_is_sched_locked +
    • >>   knl_is_inirq +
    • >>   knl_is_self +
    • >>   task_do_destroy +
    • >>   knl_object_verify +
    +
    [Called By]
    • >>   task_exit +
    + +

    tos_task_prio_change (Thumb, 248 bytes, Stack size 24 bytes, tos_task.o(i.tos_task_prio_change)) +

    [Stack]

    • Max Depth = 64 + Unknown Stack Size +
    • Call Chain = tos_task_prio_change ⇒ readyqueue_remove ⇒ readyqueue_prio_highest_get ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   knl_sched +
    • >>   knl_is_inirq +
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    • >>   readyqueue_remove +
    • >>   pend_list_adjust +
    • >>   knl_is_self +
    • >>   tos_list_empty +
    • >>   task_state_is_ready +
    • >>   task_highest_pending_prio_get +
    • >>   knl_object_verify +
    • >>   readyqueue_add_tail +
    • >>   readyqueue_add_head +
    +
    [Called By]
    • >>   tos_mutex_post +
    • >>   tos_mutex_pend_timed +
    • >>   mutex_old_owner_release +
    + +

    tos_tick_handler (Thumb, 34 bytes, Stack size 8 bytes, tos_tick.o(i.tos_tick_handler)) +

    [Stack]

    • Max Depth = 96 + Unknown Stack Size +
    • Call Chain = tos_tick_handler ⇒ tick_update ⇒ pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   tos_knl_is_running +
    • >>   timer_update +
    • >>   tick_update +
    +
    [Called By]
    • >>   SysTick_Handler +
    +

    +

    +Local Symbols +

    +

    UART_DMAAbortOnError (Thumb, 24 bytes, Stack size 16 bytes, stm32l4xx_hal_uart.o(i.UART_DMAAbortOnError)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = UART_DMAAbortOnError +
    +
    [Calls]
    • >>   HAL_UART_ErrorCallback +
    +
    [Address Reference Count : 1]
    • stm32l4xx_hal_uart.o(i.HAL_UART_IRQHandler) +
    +

    UART_EndRxTransfer (Thumb, 36 bytes, Stack size 0 bytes, stm32l4xx_hal_uart.o(i.UART_EndRxTransfer)) +

    [Called By]

    • >>   HAL_UART_IRQHandler +
    + +

    UART_EndTransmit_IT (Thumb, 34 bytes, Stack size 8 bytes, stm32l4xx_hal_uart.o(i.UART_EndTransmit_IT)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = UART_EndTransmit_IT +
    +
    [Calls]
    • >>   HAL_UART_TxCpltCallback +
    +
    [Called By]
    • >>   HAL_UART_IRQHandler +
    + +

    RCC_SetFlashLatencyFromMSIRange (Thumb, 148 bytes, Stack size 24 bytes, stm32l4xx_hal_rcc.o(i.RCC_SetFlashLatencyFromMSIRange)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = RCC_SetFlashLatencyFromMSIRange +
    +
    [Calls]
    • >>   HAL_PWREx_GetVoltageRange +
    +
    [Called By]
    • >>   HAL_RCC_OscConfig +
    + +

    RCCEx_PLLSAI1_Config (Thumb, 376 bytes, Stack size 24 bytes, stm32l4xx_hal_rcc_ex.o(i.RCCEx_PLLSAI1_Config)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = RCCEx_PLLSAI1_Config +
    +
    [Calls]
    • >>   HAL_GetTick +
    +
    [Called By]
    • >>   HAL_RCCEx_PeriphCLKConfig +
    + +

    __NVIC_GetPriorityGrouping (Thumb, 10 bytes, Stack size 0 bytes, stm32l4xx_hal_cortex.o(i.__NVIC_GetPriorityGrouping)) +

    [Called By]

    • >>   HAL_NVIC_SetPriority +
    + +

    __NVIC_SetPriority (Thumb, 32 bytes, Stack size 8 bytes, stm32l4xx_hal_cortex.o(i.__NVIC_SetPriority)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = __NVIC_SetPriority +
    +
    [Called By]
    • >>   HAL_NVIC_SetPriority +
    • >>   HAL_SYSTICK_Config +
    + +

    QSPI_Config (Thumb, 488 bytes, Stack size 8 bytes, stm32l4xx_hal_qspi.o(i.QSPI_Config)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = QSPI_Config +
    +
    [Called By]
    • >>   HAL_QSPI_Command +
    + +

    QSPI_WaitFlagStateUntilTimeout (Thumb, 76 bytes, Stack size 24 bytes, stm32l4xx_hal_qspi.o(i.QSPI_WaitFlagStateUntilTimeout)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   HAL_GetTick +
    +
    [Called By]
    • >>   HAL_QSPI_Init +
    • >>   HAL_QSPI_Transmit +
    • >>   HAL_QSPI_Receive +
    • >>   HAL_QSPI_Command +
    + +

    prv_spi_flash_wait_write_end (Thumb, 52 bytes, Stack size 24 bytes, hal_qspi_flash_1.o(i.prv_spi_flash_wait_write_end)) +

    [Stack]

    • Max Depth = 168
    • Call Chain = prv_spi_flash_wait_write_end ⇒ QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   QSPI_Send_CMD +
    • >>   QSPI_Receive +
    +
    [Called By]
    • >>   prv_spi_flash_erase_sector +
    • >>   prv_spi_flash_write_page +
    + +

    prv_spi_flash_write_enable (Thumb, 26 bytes, Stack size 16 bytes, hal_qspi_flash_1.o(i.prv_spi_flash_write_enable)) +

    [Stack]

    • Max Depth = 160
    • Call Chain = prv_spi_flash_write_enable ⇒ QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   QSPI_Send_CMD +
    +
    [Called By]
    • >>   prv_spi_flash_erase_sector +
    • >>   prv_spi_flash_write_page +
    + +

    prv_spi_flash_write_page (Thumb, 62 bytes, Stack size 32 bytes, hal_qspi_flash_1.o(i.prv_spi_flash_write_page)) +

    [Stack]

    • Max Depth = 200
    • Call Chain = prv_spi_flash_write_page ⇒ prv_spi_flash_wait_write_end ⇒ QSPI_Send_CMD ⇒ HAL_QSPI_Command ⇒ QSPI_WaitFlagStateUntilTimeout +
    +
    [Calls]
    • >>   QSPI_Transmit +
    • >>   QSPI_Send_CMD +
    • >>   prv_spi_flash_write_enable +
    • >>   prv_spi_flash_wait_write_end +
    +
    [Called By]
    • >>   hal_spi_flash_write +
    + +

    DHT11_Mode_Out_PP (Thumb, 30 bytes, Stack size 24 bytes, dht11_bus.o(i.DHT11_Mode_Out_PP)) +

    [Stack]

    • Max Depth = 44
    • Call Chain = DHT11_Mode_Out_PP ⇒ HAL_GPIO_Init +
    +
    [Calls]
    • >>   HAL_GPIO_Init +
    +
    [Called By]
    • >>   DHT11_Init +
    + +

    __ffs (Thumb, 20 bytes, Stack size 8 bytes, tos_mmheap.o(i.__ffs)) +

    [Stack]

    • Max Depth = 24 + Unknown Stack Size +
    • Call Chain = __ffs ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   generic_fls +
    +
    [Called By]
    • >>   blk_search_suitable +
    + +

    __fls (Thumb, 14 bytes, Stack size 8 bytes, tos_mmheap.o(i.__fls)) +

    [Stack]

    • Max Depth = 24 + Unknown Stack Size +
    • Call Chain = __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   generic_fls +
    +
    [Called By]
    • >>   mapping_search +
    • >>   mapping_insert +
    + +

    adjust_request_size (Thumb, 46 bytes, Stack size 8 bytes, tos_mmheap.o(i.adjust_request_size)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = adjust_request_size +
    +
    [Called By]
    • >>   tos_mmheap_alloc +
    + +

    blk_absorb (Thumb, 30 bytes, Stack size 16 bytes, tos_mmheap.o(i.blk_absorb)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = blk_absorb ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   blk_size +
    • >>   blk_link_next +
    +
    [Called By]
    • >>   blk_merge_prev +
    • >>   blk_merge_next +
    + +

    blk_can_split (Thumb, 28 bytes, Stack size 16 bytes, tos_mmheap.o(i.blk_can_split)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = blk_can_split +
    +
    [Calls]
    • >>   blk_size +
    +
    [Called By]
    • >>   blk_trim_free +
    + +

    blk_insert (Thumb, 32 bytes, Stack size 24 bytes, tos_mmheap.o(i.blk_insert)) +

    [Stack]

    • Max Depth = 72 + Unknown Stack Size +
    • Call Chain = blk_insert ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   mapping_insert +
    • >>   insert_free_block +
    • >>   blk_size +
    +
    [Called By]
    • >>   tos_mmheap_free +
    • >>   tos_mmheap_pool_add +
    • >>   blk_trim_free +
    + +

    blk_link_next (Thumb, 18 bytes, Stack size 16 bytes, tos_mmheap.o(i.blk_link_next)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   blk_next +
    +
    [Called By]
    • >>   tos_mmheap_pool_add +
    • >>   blk_trim_free +
    • >>   blk_mark_as_free +
    • >>   blk_absorb +
    + +

    blk_locate_free (Thumb, 58 bytes, Stack size 24 bytes, tos_mmheap.o(i.blk_locate_free)) +

    [Stack]

    • Max Depth = 96 + Unknown Stack Size +
    • Call Chain = blk_locate_free ⇒ mapping_search ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   remove_free_block +
    • >>   mapping_search +
    • >>   blk_search_suitable +
    +
    [Called By]
    • >>   tos_mmheap_alloc +
    + +

    blk_mark_as_free (Thumb, 26 bytes, Stack size 16 bytes, tos_mmheap.o(i.blk_mark_as_free)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   blk_set_prev_free +
    • >>   blk_set_free +
    • >>   blk_link_next +
    +
    [Called By]
    • >>   tos_mmheap_free +
    • >>   blk_split +
    + +

    blk_mark_as_used (Thumb, 26 bytes, Stack size 16 bytes, tos_mmheap.o(i.blk_mark_as_used)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = blk_mark_as_used ⇒ blk_next +
    +
    [Calls]
    • >>   blk_set_used +
    • >>   blk_set_prev_used +
    • >>   blk_next +
    +
    [Called By]
    • >>   blk_prepare_used +
    + +

    blk_merge_next (Thumb, 42 bytes, Stack size 16 bytes, tos_mmheap.o(i.blk_merge_next)) +

    [Stack]

    • Max Depth = 88 + Unknown Stack Size +
    • Call Chain = blk_merge_next ⇒ blk_remove ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   blk_remove +
    • >>   blk_next +
    • >>   blk_absorb +
    +
    [Called By]
    • >>   tos_mmheap_free +
    + +

    blk_merge_prev (Thumb, 40 bytes, Stack size 16 bytes, tos_mmheap.o(i.blk_merge_prev)) +

    [Stack]

    • Max Depth = 88 + Unknown Stack Size +
    • Call Chain = blk_merge_prev ⇒ blk_remove ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   blk_remove +
    • >>   blk_absorb +
    +
    [Called By]
    • >>   tos_mmheap_free +
    + +

    blk_next (Thumb, 36 bytes, Stack size 24 bytes, tos_mmheap.o(i.blk_next)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = blk_next +
    +
    [Calls]
    • >>   offset_to_blk +
    • >>   blk_to_ptr +
    • >>   blk_size +
    +
    [Called By]
    • >>   blk_merge_next +
    • >>   blk_mark_as_used +
    • >>   blk_link_next +
    + +

    blk_prepare_used (Thumb, 34 bytes, Stack size 16 bytes, tos_mmheap.o(i.blk_prepare_used)) +

    [Stack]

    • Max Depth = 112 + Unknown Stack Size +
    • Call Chain = blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   blk_trim_free +
    • >>   blk_to_ptr +
    • >>   blk_mark_as_used +
    +
    [Called By]
    • >>   tos_mmheap_alloc +
    + +

    blk_remove (Thumb, 32 bytes, Stack size 24 bytes, tos_mmheap.o(i.blk_remove)) +

    [Stack]

    • Max Depth = 72 + Unknown Stack Size +
    • Call Chain = blk_remove ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   remove_free_block +
    • >>   mapping_insert +
    • >>   blk_size +
    +
    [Called By]
    • >>   blk_merge_prev +
    • >>   blk_merge_next +
    + +

    blk_search_suitable (Thumb, 104 bytes, Stack size 32 bytes, tos_mmheap.o(i.blk_search_suitable)) +

    [Stack]

    • Max Depth = 56 + Unknown Stack Size +
    • Call Chain = blk_search_suitable ⇒ __ffs ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   __ffs +
    +
    [Called By]
    • >>   blk_locate_free +
    + +

    blk_set_free (Thumb, 10 bytes, Stack size 0 bytes, tos_mmheap.o(i.blk_set_free)) +

    [Called By]

    • >>   tos_mmheap_pool_add +
    • >>   blk_mark_as_free +
    + +

    blk_set_prev_free (Thumb, 10 bytes, Stack size 0 bytes, tos_mmheap.o(i.blk_set_prev_free)) +

    [Called By]

    • >>   tos_mmheap_pool_add +
    • >>   blk_trim_free +
    • >>   blk_mark_as_free +
    + +

    blk_set_prev_used (Thumb, 10 bytes, Stack size 0 bytes, tos_mmheap.o(i.blk_set_prev_used)) +

    [Called By]

    • >>   tos_mmheap_pool_add +
    • >>   blk_mark_as_used +
    + +

    blk_set_size (Thumb, 12 bytes, Stack size 0 bytes, tos_mmheap.o(i.blk_set_size)) +

    [Called By]

    • >>   tos_mmheap_pool_add +
    • >>   blk_split +
    + +

    blk_set_used (Thumb, 10 bytes, Stack size 0 bytes, tos_mmheap.o(i.blk_set_used)) +

    [Called By]

    • >>   tos_mmheap_pool_add +
    • >>   blk_mark_as_used +
    + +

    blk_size (Thumb, 10 bytes, Stack size 0 bytes, tos_mmheap.o(i.blk_size)) +

    [Called By]

    • >>   blk_split +
    • >>   blk_remove +
    • >>   blk_next +
    • >>   blk_insert +
    • >>   blk_can_split +
    • >>   blk_absorb +
    + +

    blk_split (Thumb, 62 bytes, Stack size 24 bytes, tos_mmheap.o(i.blk_split)) +

    [Stack]

    • Max Depth = 80
    • Call Chain = blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   offset_to_blk +
    • >>   blk_to_ptr +
    • >>   blk_size +
    • >>   blk_set_size +
    • >>   blk_mark_as_free +
    +
    [Called By]
    • >>   blk_trim_free +
    + +

    blk_to_ptr (Thumb, 8 bytes, Stack size 0 bytes, tos_mmheap.o(i.blk_to_ptr)) +

    [Called By]

    • >>   blk_split +
    • >>   blk_prepare_used +
    • >>   blk_next +
    + +

    blk_trim_free (Thumb, 46 bytes, Stack size 16 bytes, tos_mmheap.o(i.blk_trim_free)) +

    [Stack]

    • Max Depth = 96 + Unknown Stack Size +
    • Call Chain = blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   blk_split +
    • >>   blk_set_prev_free +
    • >>   blk_link_next +
    • >>   blk_insert +
    • >>   blk_can_split +
    +
    [Called By]
    • >>   blk_prepare_used +
    + +

    generic_fls (Thumb, 16 bytes, Stack size 8 bytes, tos_mmheap.o(i.generic_fls)) +

    [Stack]

    • Max Depth = 16 + Unknown Stack Size +
    • Call Chain = generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   tos_cpu_clz +
    +
    [Called By]
    • >>   __fls +
    • >>   __ffs +
    + +

    insert_free_block (Thumb, 74 bytes, Stack size 12 bytes, tos_mmheap.o(i.insert_free_block)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = insert_free_block +
    +
    [Called By]
    • >>   blk_insert +
    + +

    mapping_insert (Thumb, 58 bytes, Stack size 24 bytes, tos_mmheap.o(i.mapping_insert)) +

    [Stack]

    • Max Depth = 48 + Unknown Stack Size +
    • Call Chain = mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   __fls +
    +
    [Called By]
    • >>   mapping_search +
    • >>   blk_remove +
    • >>   blk_insert +
    + +

    mapping_search (Thumb, 46 bytes, Stack size 24 bytes, tos_mmheap.o(i.mapping_search)) +

    [Stack]

    • Max Depth = 72 + Unknown Stack Size +
    • Call Chain = mapping_search ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   mapping_insert +
    • >>   __fls +
    +
    [Called By]
    • >>   blk_locate_free +
    + +

    mmheap_ctl_init (Thumb, 88 bytes, Stack size 0 bytes, tos_mmheap.o(i.mmheap_ctl_init)) +

    [Called By]

    • >>   mmheap_init_with_pool +
    + +

    mmheap_pool_is_exist (Thumb, 38 bytes, Stack size 0 bytes, tos_mmheap.o(i.mmheap_pool_is_exist)) +

    [Called By]

    • >>   tos_mmheap_pool_add +
    + +

    offset_to_blk (Thumb, 6 bytes, Stack size 0 bytes, tos_mmheap.o(i.offset_to_blk)) +

    [Called By]

    • >>   tos_mmheap_pool_add +
    • >>   blk_split +
    • >>   blk_next +
    + +

    remove_free_block (Thumb, 92 bytes, Stack size 16 bytes, tos_mmheap.o(i.remove_free_block)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = remove_free_block +
    +
    [Called By]
    • >>   blk_remove +
    • >>   blk_locate_free +
    + +

    knl_object_verify (Thumb, 16 bytes, Stack size 0 bytes, tos_mutex.o(i.knl_object_verify)) +

    [Called By]

    • >>   tos_mutex_post +
    • >>   tos_mutex_pend_timed +
    + +

    mutex_fresh_owner_mark (Thumb, 40 bytes, Stack size 8 bytes, tos_mutex.o(i.mutex_fresh_owner_mark)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = mutex_fresh_owner_mark +
    +
    [Called By]
    • >>   tos_mutex_post +
    • >>   tos_mutex_pend_timed +
    + +

    mutex_old_owner_release (Thumb, 74 bytes, Stack size 16 bytes, tos_mutex.o(i.mutex_old_owner_release)) +

    [Stack]

    • Max Depth = 80 + Unknown Stack Size +
    • Call Chain = mutex_old_owner_release ⇒ tos_task_prio_change ⇒ readyqueue_remove ⇒ readyqueue_prio_highest_get ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   tos_task_prio_change +
    +
    [Called By]
    • >>   tos_mutex_post +
    • >>   mutex_release +
    + +

    pend_list_add (Thumb, 68 bytes, Stack size 16 bytes, tos_pend.o(i.pend_list_add)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = pend_list_add +
    +
    [Called By]
    • >>   pend_task_block +
    • >>   pend_list_adjust +
    + +

    tos_list_del (Thumb, 12 bytes, Stack size 0 bytes, tos_pend.o(i.tos_list_del)) +

    [Called By]

    • >>   pend_list_remove +
    • >>   pend_list_adjust +
    + +

    tos_list_empty (Thumb, 16 bytes, Stack size 0 bytes, tos_pend.o(i.tos_list_empty)) +

    [Called By]

    • >>   pend_is_nopending +
    • >>   pend_highest_pending_prio_get +
    + +

    tos_list_init (Thumb, 6 bytes, Stack size 0 bytes, tos_pend.o(i.tos_list_init)) +

    [Called By]

    • >>   pend_object_init +
    + +

    _list_add (Thumb, 10 bytes, Stack size 0 bytes, tos_sched.o(i._list_add)) +

    [Called By]

    • >>   readyqueue_add_head +
    • >>   tos_list_add_tail +
    + +

    _list_del (Thumb, 6 bytes, Stack size 0 bytes, tos_sched.o(i._list_del)) +

    [Called By]

    • >>   readyqueue_remove +
    + +

    readyqueue_prio_highest_get (Thumb, 36 bytes, Stack size 16 bytes, tos_sched.o(i.readyqueue_prio_highest_get)) +

    [Stack]

    • Max Depth = 24 + Unknown Stack Size +
    • Call Chain = readyqueue_prio_highest_get ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   tos_cpu_clz +
    +
    [Called By]
    • >>   readyqueue_remove +
    + +

    readyqueue_prio_mark (Thumb, 56 bytes, Stack size 0 bytes, tos_sched.o(i.readyqueue_prio_mark)) +

    [Called By]

    • >>   readyqueue_add_tail +
    • >>   readyqueue_add_head +
    + +

    tos_list_add_tail (Thumb, 18 bytes, Stack size 16 bytes, tos_sched.o(i.tos_list_add_tail)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = tos_list_add_tail +
    +
    [Calls]
    • >>   _list_add +
    +
    [Called By]
    • >>   readyqueue_add_tail +
    + +

    tos_list_empty (Thumb, 16 bytes, Stack size 0 bytes, tos_sched.o(i.tos_list_empty)) +

    [Called By]

    • >>   readyqueue_remove +
    • >>   readyqueue_add_tail +
    • >>   readyqueue_add_head +
    + +

    knl_idle_entry (Thumb, 10 bytes, Stack size 0 bytes, tos_sys.o(i.knl_idle_entry)) +

    [Stack]

    • Max Depth = 136 + Unknown Stack Size +
    • Call Chain = knl_idle_entry ⇒ task_free_all ⇒ task_free ⇒ tos_mmheap_free ⇒ blk_merge_prev ⇒ blk_remove ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   task_free_all +
    +
    [Address Reference Count : 1]
    • tos_sys.o(i.knl_idle_init) +
    +

    knl_object_verify (Thumb, 16 bytes, Stack size 0 bytes, tos_task.o(i.knl_object_verify)) +

    [Called By]

    • >>   tos_task_prio_change +
    • >>   tos_task_destroy +
    + +

    task_do_destroy (Thumb, 132 bytes, Stack size 16 bytes, tos_task.o(i.task_do_destroy)) +

    [Stack]

    • Max Depth = 120 + Unknown Stack Size +
    • Call Chain = task_do_destroy ⇒ task_mutex_release ⇒ mutex_release ⇒ pend_wakeup_all ⇒ pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   knl_sched +
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    • >>   tick_list_remove +
    • >>   readyqueue_remove +
    • >>   pend_list_remove +
    • >>   tos_list_empty +
    • >>   tos_list_del +
    • >>   task_state_is_ready +
    • >>   task_reset +
    • >>   task_mutex_release +
    • >>   knl_is_idle +
    +
    [Called By]
    • >>   tos_task_destroy +
    + +

    task_exit (Thumb, 10 bytes, Stack size 8 bytes, tos_task.o(i.task_exit)) +

    [Stack]

    • Max Depth = 136 + Unknown Stack Size +
    • Call Chain = task_exit ⇒ tos_task_destroy ⇒ task_do_destroy ⇒ task_mutex_release ⇒ mutex_release ⇒ pend_wakeup_all ⇒ pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   tos_task_destroy +
    +
    [Address Reference Count : 1]
    • tos_task.o(i.tos_task_create) +
    +

    task_free (Thumb, 18 bytes, Stack size 8 bytes, tos_task.o(i.task_free)) +

    [Stack]

    • Max Depth = 112 + Unknown Stack Size +
    • Call Chain = task_free ⇒ tos_mmheap_free ⇒ blk_merge_prev ⇒ blk_remove ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   tos_mmheap_free +
    +
    [Called By]
    • >>   task_free_all +
    + +

    task_highest_pending_prio_get (Thumb, 48 bytes, Stack size 24 bytes, tos_task.o(i.task_highest_pending_prio_get)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = task_highest_pending_prio_get ⇒ pend_highest_pending_prio_get +
    +
    [Calls]
    • >>   pend_highest_pending_prio_get +
    +
    [Called By]
    • >>   tos_task_prio_change +
    + +

    task_mutex_release (Thumb, 32 bytes, Stack size 16 bytes, tos_task.o(i.task_mutex_release)) +

    [Stack]

    • Max Depth = 104 + Unknown Stack Size +
    • Call Chain = task_mutex_release ⇒ mutex_release ⇒ pend_wakeup_all ⇒ pend_task_wakeup ⇒ readyqueue_add ⇒ readyqueue_add_tail ⇒ tos_list_add_tail +
    +
    [Calls]
    • >>   mutex_release +
    +
    [Called By]
    • >>   task_do_destroy +
    + +

    task_reset (Thumb, 80 bytes, Stack size 8 bytes, tos_task.o(i.task_reset)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = task_reset +
    +
    [Calls]
    • >>   tos_list_init +
    +
    [Called By]
    • >>   task_do_destroy +
    • >>   tos_task_create +
    + +

    task_state_is_ready (Thumb, 14 bytes, Stack size 0 bytes, tos_task.o(i.task_state_is_ready)) +

    [Called By]

    • >>   tos_task_prio_change +
    • >>   task_do_destroy +
    + +

    tos_list_add (Thumb, 14 bytes, Stack size 0 bytes, tos_task.o(i.tos_list_add)) +

    [Called By]

    • >>   tos_task_create +
    + +

    tos_list_del (Thumb, 12 bytes, Stack size 0 bytes, tos_task.o(i.tos_list_del)) +

    [Called By]

    • >>   task_do_destroy +
    • >>   task_free_all +
    + +

    tos_list_empty (Thumb, 16 bytes, Stack size 0 bytes, tos_task.o(i.tos_list_empty)) +

    [Called By]

    • >>   tos_task_prio_change +
    • >>   task_do_destroy +
    + +

    tos_list_init (Thumb, 6 bytes, Stack size 0 bytes, tos_task.o(i.tos_list_init)) +

    [Called By]

    • >>   task_reset +
    + +

    tick_task_place (Thumb, 184 bytes, Stack size 56 bytes, tos_tick.o(i.tick_task_place)) +

    [Stack]

    • Max Depth = 64 + Unknown Stack Size +
    • Call Chain = tick_task_place ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    +
    [Called By]
    • >>   tick_list_add +
    + +

    tick_task_takeoff (Thumb, 126 bytes, Stack size 16 bytes, tos_tick.o(i.tick_task_takeoff)) +

    [Stack]

    • Max Depth = 24 + Unknown Stack Size +
    • Call Chain = tick_task_takeoff ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    • >>   tos_list_empty +
    +
    [Called By]
    • >>   tick_list_remove +
    + +

    tos_list_empty (Thumb, 16 bytes, Stack size 0 bytes, tos_tick.o(i.tos_list_empty)) +

    [Called By]

    • >>   tick_task_takeoff +
    • >>   tick_update +
    + +

    timer_place (Thumb, 130 bytes, Stack size 24 bytes, tos_timer.o(i.timer_place)) +

    [Stack]

    • Max Depth = 32 + Unknown Stack Size +
    • Call Chain = timer_place ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    +
    [Called By]
    • >>   timer_update +
    + +

    timer_takeoff (Thumb, 110 bytes, Stack size 24 bytes, tos_timer.o(i.timer_takeoff)) +

    [Stack]

    • Max Depth = 32 + Unknown Stack Size +
    • Call Chain = timer_takeoff ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_cpu_cpsr_save +
    • >>   tos_cpu_cpsr_restore +
    +
    [Called By]
    • >>   timer_update +
    + +

    __NVIC_SetPriority (Thumb, 32 bytes, Stack size 8 bytes, port_c.o(i.__NVIC_SetPriority)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = __NVIC_SetPriority +
    +
    [Called By]
    • >>   port_systick_priority_set +
    • >>   port_systick_config +
    + +

    errno_knl2cmsis (Thumb, 12 bytes, Stack size 0 bytes, cmsis_os.o(i.errno_knl2cmsis)) +

    [Called By]

    • >>   osKernelStart +
    • >>   osKernelInitialize +
    + +

    priority_cmsis2knl (Thumb, 18 bytes, Stack size 0 bytes, cmsis_os.o(i.priority_cmsis2knl)) +

    [Called By]

    • >>   osThreadCreate +
    + +

    kv_blk_flags_add (Thumb, 58 bytes, Stack size 12 bytes, tos_kv.o(i.kv_blk_flags_add)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = kv_blk_flags_add +
    +
    [Called By]
    • >>   kv_mgr_ctl_build +
    • >>   kv_blk_set_inuse +
    • >>   kv_blk_set_dirty +
    + +

    kv_blk_flags_get (Thumb, 30 bytes, Stack size 0 bytes, tos_kv.o(i.kv_blk_flags_get)) +

    [Called By]

    • >>   kv_gc +
    • >>   kv_blk_is_inuse +
    • >>   kv_blk_is_hanging +
    • >>   kv_blk_is_fresh +
    • >>   kv_blk_is_bad +
    + +

    kv_blk_flags_rmv (Thumb, 58 bytes, Stack size 12 bytes, tos_kv.o(i.kv_blk_flags_rmv)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = kv_blk_flags_rmv +
    +
    [Called By]
    • >>   kv_mgr_blk_index_rebuild +
    • >>   kv_blk_reset_inuse +
    • >>   kv_blk_reset_fresh +
    + +

    kv_blk_flags_set (Thumb, 30 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_flags_set)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = kv_blk_flags_set +
    +
    [Called By]
    • >>   kv_blk_set_fresh +
    • >>   kv_blk_set_bad +
    + +

    kv_blk_format (Thumb, 42 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_format)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = kv_blk_format ⇒ kv_flash_wunit_modify ⇒ kv_flash_write +
    +
    [Calls]
    • >>   kv_flash_wunit_modify +
    • >>   kv_flash_blk_erase +
    • >>   kv_blk_set_fresh +
    +
    [Called By]
    • >>   kv_mgr_ctl_build +
    • >>   kv_gc +
    + +

    kv_blk_freesz_get (Thumb, 32 bytes, Stack size 0 bytes, tos_kv.o(i.kv_blk_freesz_get)) +

    [Called By]

    • >>   kv_item_save +
    • >>   kv_item_do_gc +
    • >>   kv_blk_search_suitable +
    • >>   kv_blk_search_inuse +
    • >>   kv_blk_is_full +
    • >>   kv_blk_freesz_reduce +
    + +

    kv_blk_freesz_reduce (Thumb, 24 bytes, Stack size 16 bytes, tos_kv.o(i.kv_blk_freesz_reduce)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = kv_blk_freesz_reduce ⇒ kv_blk_freesz_set +
    +
    [Calls]
    • >>   kv_blk_freesz_set +
    • >>   kv_blk_freesz_get +
    +
    [Called By]
    • >>   kv_item_save +
    • >>   kv_item_do_gc +
    + +

    kv_blk_freesz_set (Thumb, 32 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_freesz_set)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = kv_blk_freesz_set +
    +
    [Called By]
    • >>   kv_item_walkthru +
    • >>   kv_blk_set_fresh +
    • >>   kv_blk_freesz_reduce +
    + +

    kv_blk_hdr_read (Thumb, 18 bytes, Stack size 16 bytes, tos_kv.o(i.kv_blk_hdr_read)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = kv_blk_hdr_read ⇒ kv_flash_read +
    +
    [Calls]
    • >>   kv_flash_read +
    +
    [Called By]
    • >>   tos_kv_walkthru +
    • >>   kv_mgr_ctl_build +
    + +

    kv_blk_is_bad (Thumb, 16 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_is_bad)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = kv_blk_is_bad +
    +
    [Calls]
    • >>   kv_blk_flags_get +
    +
    [Called By]
    • >>   kv_item_find_new_copy +
    • >>   kv_item_find +
    + +

    kv_blk_is_fresh (Thumb, 16 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_is_fresh)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = kv_blk_is_fresh +
    +
    [Calls]
    • >>   kv_blk_flags_get +
    +
    [Called By]
    • >>   kv_mgr_workspace_locate +
    • >>   kv_item_save +
    • >>   kv_item_find_new_copy +
    • >>   kv_item_find +
    • >>   kv_blk_set_fresh +
    • >>   kv_blk_reset_fresh +
    • >>   kv_blk_next_fresh +
    + +

    kv_blk_is_full (Thumb, 38 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_is_full)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = kv_blk_is_full +
    +
    [Calls]
    • >>   kv_blk_freesz_get +
    +
    [Called By]
    • >>   kv_item_save +
    • >>   kv_gc +
    + +

    kv_blk_is_hanging (Thumb, 16 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_is_hanging)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = kv_blk_is_hanging +
    +
    [Calls]
    • >>   kv_blk_flags_get +
    +
    [Called By]
    • >>   kv_mgr_ctl_build +
    • >>   kv_mgr_blk_index_rebuild +
    + +

    kv_blk_is_inuse (Thumb, 16 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_is_inuse)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = kv_blk_is_inuse +
    +
    [Calls]
    • >>   kv_blk_flags_get +
    +
    [Called By]
    • >>   kv_mgr_workspace_locate +
    • >>   kv_blk_set_inuse +
    • >>   kv_blk_search_inuse +
    • >>   kv_blk_reset_inuse +
    + +

    kv_blk_next_fresh (Thumb, 118 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_next_fresh)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = kv_blk_next_fresh ⇒ kv_blk_is_fresh +
    +
    [Calls]
    • >>   kv_blk_is_fresh +
    +
    [Called By]
    • >>   kv_gc +
    • >>   kv_blk_search_suitable +
    + +

    kv_blk_reset_fresh (Thumb, 34 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_reset_fresh)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = kv_blk_reset_fresh ⇒ kv_blk_flags_rmv +
    +
    [Calls]
    • >>   kv_blk_is_fresh +
    • >>   kv_blk_flags_rmv +
    +
    [Called By]
    • >>   kv_item_save +
    • >>   kv_gc +
    + +

    kv_blk_reset_inuse (Thumb, 34 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_reset_inuse)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = kv_blk_reset_inuse ⇒ kv_blk_flags_rmv +
    +
    [Calls]
    • >>   kv_blk_is_inuse +
    • >>   kv_blk_flags_rmv +
    +
    [Called By]
    • >>   kv_item_walkthru +
    • >>   kv_item_save +
    • >>   kv_gc +
    + +

    kv_blk_search_inuse (Thumb, 130 bytes, Stack size 16 bytes, tos_kv.o(i.kv_blk_search_inuse)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = kv_blk_search_inuse ⇒ kv_blk_is_inuse +
    +
    [Calls]
    • >>   kv_blk_is_inuse +
    • >>   kv_blk_freesz_get +
    +
    [Called By]
    • >>   kv_blk_search_suitable +
    + +

    kv_blk_search_suitable (Thumb, 150 bytes, Stack size 16 bytes, tos_kv.o(i.kv_blk_search_suitable)) +

    [Stack]

    • Max Depth = 232 + Unknown Stack Size +
    • Call Chain = kv_blk_search_suitable ⇒ kv_gc ⇒ kv_mgr_blk_index_rebuild ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_gc +
    • >>   kv_blk_search_inuse +
    • >>   kv_blk_next_fresh +
    • >>   kv_blk_freesz_get +
    +
    [Called By]
    • >>   kv_item_save +
    + +

    kv_blk_set_bad (Thumb, 14 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_set_bad)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = kv_blk_set_bad ⇒ kv_blk_flags_set +
    +
    [Calls]
    • >>   kv_blk_flags_set +
    +
    [Called By]
    • >>   kv_mgr_ctl_build +
    • >>   kv_gc +
    + +

    kv_blk_set_dirty (Thumb, 14 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_set_dirty)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = kv_blk_set_dirty ⇒ kv_blk_flags_add +
    +
    [Calls]
    • >>   kv_blk_flags_add +
    +
    [Called By]
    • >>   kv_item_walkthru +
    • >>   kv_item_delete_aux +
    + +

    kv_blk_set_fresh (Thumb, 64 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_set_fresh)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = kv_blk_set_fresh ⇒ kv_blk_is_fresh +
    +
    [Calls]
    • >>   kv_blk_is_fresh +
    • >>   kv_blk_freesz_set +
    • >>   kv_blk_flags_set +
    +
    [Called By]
    • >>   kv_item_walkthru +
    • >>   kv_blk_format +
    + +

    kv_blk_set_inuse (Thumb, 34 bytes, Stack size 8 bytes, tos_kv.o(i.kv_blk_set_inuse)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = kv_blk_set_inuse ⇒ kv_blk_flags_add +
    +
    [Calls]
    • >>   kv_blk_is_inuse +
    • >>   kv_blk_flags_add +
    +
    [Called By]
    • >>   kv_item_walkthru +
    • >>   kv_item_save +
    • >>   kv_gc +
    + +

    kv_block_walkthru (Thumb, 666 bytes, Stack size 40 bytes, tos_kv.o(i.kv_block_walkthru)) +

    [Stack]

    • Max Depth = 184 + Unknown Stack Size +
    • Call Chain = kv_block_walkthru ⇒ kv_item_body_read ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   tos_mmheap_alloc +
    • >>   kv_u8_disp +
    • >>   kv_item_hdr_verify +
    • >>   kv_item_hdr_read +
    • >>   kv_item_free +
    • >>   kv_item_body_verify +
    • >>   kv_item_body_read +
    • >>   __2printf +
    +
    [Called By]
    • >>   tos_kv_walkthru +
    + +

    kv_checksum_crc8 (Thumb, 58 bytes, Stack size 12 bytes, tos_kv.o(i.kv_checksum_crc8)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = kv_checksum_crc8 +
    +
    [Called By]
    • >>   kv_item_do_save +
    • >>   kv_item_body_verify +
    + +

    kv_do_gc (Thumb, 18 bytes, Stack size 8 bytes, tos_kv.o(i.kv_do_gc)) +

    [Stack]

    • Max Depth = 176 + Unknown Stack Size +
    • Call Chain = kv_do_gc ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_walkthru +
    +
    [Called By]
    • >>   kv_gc +
    + +

    kv_flash_blk_erase (Thumb, 22 bytes, Stack size 8 bytes, tos_kv.o(i.kv_flash_blk_erase)) +

    [Stack]

    • Max Depth = 24
    • Call Chain = kv_flash_blk_erase ⇒ kv_flash_erase +
    +
    [Calls]
    • >>   kv_flash_erase +
    +
    [Called By]
    • >>   kv_blk_format +
    + +

    kv_flash_ctl_init (Thumb, 78 bytes, Stack size 12 bytes, tos_kv.o(i.kv_flash_ctl_init)) +

    [Stack]

    • Max Depth = 12
    • Call Chain = kv_flash_ctl_init +
    +
    [Called By]
    • >>   tos_kv_init +
    + +

    kv_flash_erase (Thumb, 28 bytes, Stack size 16 bytes, tos_kv.o(i.kv_flash_erase)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = kv_flash_erase +
    +
    [Called By]
    • >>   kv_flash_blk_erase +
    + +

    kv_flash_read (Thumb, 32 bytes, Stack size 16 bytes, tos_kv.o(i.kv_flash_read)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = kv_flash_read +
    +
    [Called By]
    • >>   kv_item_try_delete +
    • >>   kv_item_hdr_read +
    • >>   kv_item_body_read +
    • >>   kv_blk_hdr_read +
    + +

    kv_flash_write (Thumb, 32 bytes, Stack size 16 bytes, tos_kv.o(i.kv_flash_write)) +

    [Stack]

    • Max Depth = 16
    • Call Chain = kv_flash_write +
    +
    [Called By]
    • >>   kv_item_write +
    • >>   kv_item_hdr_write +
    • >>   kv_flash_wunit_modify +
    + +

    kv_flash_wunit_modify (Thumb, 18 bytes, Stack size 24 bytes, tos_kv.o(i.kv_flash_wunit_modify)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = kv_flash_wunit_modify ⇒ kv_flash_write +
    +
    [Calls]
    • >>   kv_flash_write +
    +
    [Called By]
    • >>   kv_item_hdr_write +
    • >>   kv_item_do_delete +
    • >>   kv_blk_format +
    + +

    kv_gc (Thumb, 162 bytes, Stack size 24 bytes, tos_kv.o(i.kv_gc)) +

    [Stack]

    • Max Depth = 216 + Unknown Stack Size +
    • Call Chain = kv_gc ⇒ kv_mgr_blk_index_rebuild ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_mgr_blk_index_rebuild +
    • >>   kv_do_gc +
    • >>   kv_blk_set_inuse +
    • >>   kv_blk_set_bad +
    • >>   kv_blk_reset_inuse +
    • >>   kv_blk_reset_fresh +
    • >>   kv_blk_next_fresh +
    • >>   kv_blk_is_full +
    • >>   kv_blk_format +
    • >>   kv_blk_flags_get +
    +
    [Called By]
    • >>   kv_blk_search_suitable +
    + +

    kv_item_body_read (Thumb, 108 bytes, Stack size 16 bytes, tos_kv.o(i.kv_item_body_read)) +

    [Stack]

    • Max Depth = 144 + Unknown Stack Size +
    • Call Chain = kv_item_body_read ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   tos_mmheap_free +
    • >>   tos_mmheap_alloc +
    • >>   kv_flash_read +
    +
    [Called By]
    • >>   kv_item_is_moved +
    • >>   kv_item_do_recovery +
    • >>   kv_item_do_gc +
    • >>   kv_item_do_fetch_new_copy +
    • >>   kv_item_do_fetch +
    • >>   kv_block_walkthru +
    + +

    kv_item_body_verify (Thumb, 30 bytes, Stack size 8 bytes, tos_kv.o(i.kv_item_body_verify)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = kv_item_body_verify ⇒ kv_checksum_crc8 +
    +
    [Calls]
    • >>   kv_checksum_crc8 +
    +
    [Called By]
    • >>   kv_item_do_recovery +
    • >>   kv_block_walkthru +
    + +

    kv_item_delete (Thumb, 12 bytes, Stack size 8 bytes, tos_kv.o(i.kv_item_delete)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = kv_item_delete ⇒ kv_item_delete_aux ⇒ kv_item_do_delete ⇒ kv_flash_wunit_modify ⇒ kv_flash_write +
    +
    [Calls]
    • >>   kv_item_delete_aux +
    +
    [Called By]
    • >>   tos_kv_del +
    • >>   kv_item_update +
    • >>   kv_item_do_recovery +
    + +

    kv_item_delete_aux (Thumb, 56 bytes, Stack size 8 bytes, tos_kv.o(i.kv_item_delete_aux)) +

    [Stack]

    • Max Depth = 56
    • Call Chain = kv_item_delete_aux ⇒ kv_item_do_delete ⇒ kv_flash_wunit_modify ⇒ kv_flash_write +
    +
    [Calls]
    • >>   kv_item_do_delete +
    • >>   kv_blk_set_dirty +
    +
    [Called By]
    • >>   kv_item_try_delete +
    • >>   kv_item_delete +
    + +

    kv_item_do_delete (Thumb, 18 bytes, Stack size 8 bytes, tos_kv.o(i.kv_item_do_delete)) +

    [Stack]

    • Max Depth = 48
    • Call Chain = kv_item_do_delete ⇒ kv_flash_wunit_modify ⇒ kv_flash_write +
    +
    [Calls]
    • >>   kv_flash_wunit_modify +
    +
    [Called By]
    • >>   kv_item_walkthru +
    • >>   kv_item_delete_aux +
    + +

    kv_item_do_fetch (Thumb, 60 bytes, Stack size 24 bytes, tos_kv.o(i.kv_item_do_fetch)) +

    [Stack]

    • Max Depth = 168 + Unknown Stack Size +
    • Call Chain = kv_item_do_fetch ⇒ kv_item_body_read ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_body_read +
    • >>   memcmp +
    • >>   strlen +
    +
    [Address Reference Count : 1]
    • tos_kv.o(i.kv_item_do_find) +
    +

    kv_item_do_fetch_new_copy (Thumb, 76 bytes, Stack size 40 bytes, tos_kv.o(i.kv_item_do_fetch_new_copy)) +

    [Stack]

    • Max Depth = 184 + Unknown Stack Size +
    • Call Chain = kv_item_do_fetch_new_copy ⇒ kv_item_body_read ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_body_read +
    • >>   memcmp +
    +
    [Address Reference Count : 1]
    • tos_kv.o(i.kv_item_do_find_new_copy) +
    +

    kv_item_do_find (Thumb, 28 bytes, Stack size 16 bytes, tos_kv.o(i.kv_item_do_find)) +

    [Stack]

    • Max Depth = 184 + Unknown Stack Size +
    • Call Chain = kv_item_do_find ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_walkthru +
    +
    [Called By]
    • >>   kv_item_find +
    + +

    kv_item_do_find_new_copy (Thumb, 28 bytes, Stack size 16 bytes, tos_kv.o(i.kv_item_do_find_new_copy)) +

    [Stack]

    • Max Depth = 184 + Unknown Stack Size +
    • Call Chain = kv_item_do_find_new_copy ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_walkthru +
    +
    [Called By]
    • >>   kv_item_find_new_copy +
    + +

    kv_item_do_gc (Thumb, 136 bytes, Stack size 24 bytes, tos_kv.o(i.kv_item_do_gc)) +

    [Stack]

    • Max Depth = 168 + Unknown Stack Size +
    • Call Chain = kv_item_do_gc ⇒ kv_item_body_read ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_write +
    • >>   kv_item_body_read +
    • >>   kv_blk_freesz_reduce +
    • >>   kv_blk_freesz_get +
    +
    [Address Reference Count : 1]
    • tos_kv.o(i.kv_do_gc) +
    +

    kv_item_do_recovery (Thumb, 78 bytes, Stack size 16 bytes, tos_kv.o(i.kv_item_do_recovery)) +

    [Stack]

    • Max Depth = 192 + Unknown Stack Size +
    • Call Chain = kv_item_do_recovery ⇒ kv_item_try_delete ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_try_delete +
    • >>   kv_item_delete +
    • >>   kv_item_body_verify +
    • >>   kv_item_body_read +
    +
    [Address Reference Count : 1]
    • tos_kv.o(i.kv_mgr_index_build) +
    +

    kv_item_do_save (Thumb, 152 bytes, Stack size 64 bytes, tos_kv.o(i.kv_item_do_save)) +

    [Stack]

    • Max Depth = 192 + Unknown Stack Size +
    • Call Chain = kv_item_do_save ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   tos_mmheap_free +
    • >>   tos_mmheap_alloc +
    • >>   kv_item_write +
    • >>   kv_checksum_crc8 +
    • >>   strlen +
    • >>   __aeabi_memclr +
    • >>   __aeabi_memcpy +
    +
    [Called By]
    • >>   kv_item_save +
    + +

    kv_item_find (Thumb, 74 bytes, Stack size 16 bytes, tos_kv.o(i.kv_item_find)) +

    [Stack]

    • Max Depth = 200 + Unknown Stack Size +
    • Call Chain = kv_item_find ⇒ kv_item_do_find ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_do_find +
    • >>   kv_blk_is_fresh +
    • >>   kv_blk_is_bad +
    +
    [Called By]
    • >>   tos_kv_set +
    • >>   tos_kv_has_key +
    • >>   tos_kv_get +
    • >>   tos_kv_del +
    + +

    kv_item_find_new_copy (Thumb, 74 bytes, Stack size 16 bytes, tos_kv.o(i.kv_item_find_new_copy)) +

    [Stack]

    • Max Depth = 200 + Unknown Stack Size +
    • Call Chain = kv_item_find_new_copy ⇒ kv_item_do_find_new_copy ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_do_find_new_copy +
    • >>   kv_blk_is_fresh +
    • >>   kv_blk_is_bad +
    +
    [Called By]
    • >>   kv_item_fix +
    + +

    kv_item_fix (Thumb, 32 bytes, Stack size 16 bytes, tos_kv.o(i.kv_item_fix)) +

    [Stack]

    • Max Depth = 216 + Unknown Stack Size +
    • Call Chain = kv_item_fix ⇒ kv_item_find_new_copy ⇒ kv_item_do_find_new_copy ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_free +
    • >>   kv_item_find_new_copy +
    +
    [Called By]
    • >>   kv_item_save +
    + +

    kv_item_free (Thumb, 22 bytes, Stack size 8 bytes, tos_kv.o(i.kv_item_free)) +

    [Stack]

    • Max Depth = 112 + Unknown Stack Size +
    • Call Chain = kv_item_free ⇒ tos_mmheap_free ⇒ blk_merge_prev ⇒ blk_remove ⇒ mapping_insert ⇒ __fls ⇒ generic_fls ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   tos_mmheap_free +
    +
    [Called By]
    • >>   tos_kv_set +
    • >>   tos_kv_get +
    • >>   tos_kv_del +
    • >>   kv_item_walkthru +
    • >>   kv_item_fix +
    • >>   kv_block_walkthru +
    + +

    kv_item_hdr_read (Thumb, 18 bytes, Stack size 16 bytes, tos_kv.o(i.kv_item_hdr_read)) +

    [Stack]

    • Max Depth = 32
    • Call Chain = kv_item_hdr_read ⇒ kv_flash_read +
    +
    [Calls]
    • >>   kv_flash_read +
    +
    [Called By]
    • >>   kv_item_walkthru +
    • >>   kv_item_try_delete +
    • >>   kv_item_is_moved +
    • >>   kv_block_walkthru +
    + +

    kv_item_hdr_verify (Thumb, 144 bytes, Stack size 20 bytes, tos_kv.o(i.kv_item_hdr_verify)) +

    [Stack]

    • Max Depth = 20
    • Call Chain = kv_item_hdr_verify +
    +
    [Called By]
    • >>   kv_item_walkthru +
    • >>   kv_block_walkthru +
    + +

    kv_item_hdr_write (Thumb, 62 bytes, Stack size 24 bytes, tos_kv.o(i.kv_item_hdr_write)) +

    [Stack]

    • Max Depth = 64
    • Call Chain = kv_item_hdr_write ⇒ kv_flash_wunit_modify ⇒ kv_flash_write +
    +
    [Calls]
    • >>   kv_flash_wunit_modify +
    • >>   kv_flash_write +
    +
    [Called By]
    • >>   kv_item_write +
    + +

    kv_item_is_moved (Thumb, 90 bytes, Stack size 48 bytes, tos_kv.o(i.kv_item_is_moved)) +

    [Stack]

    • Max Depth = 192 + Unknown Stack Size +
    • Call Chain = kv_item_is_moved ⇒ kv_item_body_read ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   tos_mmheap_free +
    • >>   kv_item_hdr_read +
    • >>   kv_item_body_read +
    • >>   memcmp +
    +
    [Called By]
    • >>   kv_item_save +
    + +

    kv_item_save (Thumb, 208 bytes, Stack size 48 bytes, tos_kv.o(i.kv_item_save)) +

    [Stack]

    • Max Depth = 280 + Unknown Stack Size +
    • Call Chain = kv_item_save ⇒ kv_blk_search_suitable ⇒ kv_gc ⇒ kv_mgr_blk_index_rebuild ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_is_moved +
    • >>   kv_item_fix +
    • >>   kv_item_do_save +
    • >>   kv_blk_set_inuse +
    • >>   kv_blk_search_suitable +
    • >>   kv_blk_reset_inuse +
    • >>   kv_blk_reset_fresh +
    • >>   kv_blk_is_full +
    • >>   kv_blk_is_fresh +
    • >>   kv_blk_freesz_reduce +
    • >>   kv_blk_freesz_get +
    • >>   strlen +
    +
    [Called By]
    • >>   tos_kv_set +
    • >>   kv_item_update +
    + +

    kv_item_try_delete (Thumb, 174 bytes, Stack size 48 bytes, tos_kv.o(i.kv_item_try_delete)) +

    [Stack]

    • Max Depth = 176 + Unknown Stack Size +
    • Call Chain = kv_item_try_delete ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   tos_mmheap_free +
    • >>   tos_mmheap_alloc +
    • >>   kv_item_hdr_read +
    • >>   kv_item_delete_aux +
    • >>   kv_flash_read +
    • >>   memcmp +
    +
    [Called By]
    • >>   kv_item_do_recovery +
    + +

    kv_item_update (Thumb, 58 bytes, Stack size 24 bytes, tos_kv.o(i.kv_item_update)) +

    [Stack]

    • Max Depth = 304 + Unknown Stack Size +
    • Call Chain = kv_item_update ⇒ kv_item_save ⇒ kv_blk_search_suitable ⇒ kv_gc ⇒ kv_mgr_blk_index_rebuild ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_value_is_match +
    • >>   kv_item_save +
    • >>   kv_item_delete +
    +
    [Called By]
    • >>   tos_kv_set +
    + +

    kv_item_value_is_match (Thumb, 50 bytes, Stack size 24 bytes, tos_kv.o(i.kv_item_value_is_match)) +

    [Stack]

    • Max Depth = 36
    • Call Chain = kv_item_value_is_match ⇒ memcmp +
    +
    [Calls]
    • >>   memcmp +
    +
    [Called By]
    • >>   kv_item_update +
    + +

    kv_item_walkthru (Thumb, 486 bytes, Stack size 40 bytes, tos_kv.o(i.kv_item_walkthru)) +

    [Stack]

    • Max Depth = 168 + Unknown Stack Size +
    • Call Chain = kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   tos_mmheap_alloc +
    • >>   kv_item_hdr_verify +
    • >>   kv_item_hdr_read +
    • >>   kv_item_free +
    • >>   kv_item_do_delete +
    • >>   kv_blk_set_inuse +
    • >>   kv_blk_set_fresh +
    • >>   kv_blk_set_dirty +
    • >>   kv_blk_reset_inuse +
    • >>   kv_blk_freesz_set +
    +
    [Called By]
    • >>   kv_mgr_index_build +
    • >>   kv_item_do_find_new_copy +
    • >>   kv_item_do_find +
    • >>   kv_do_gc +
    + +

    kv_item_write (Thumb, 54 bytes, Stack size 24 bytes, tos_kv.o(i.kv_item_write)) +

    [Stack]

    • Max Depth = 88
    • Call Chain = kv_item_write ⇒ kv_item_hdr_write ⇒ kv_flash_wunit_modify ⇒ kv_flash_write +
    +
    [Calls]
    • >>   kv_item_hdr_write +
    • >>   kv_flash_write +
    +
    [Called By]
    • >>   kv_item_do_save +
    • >>   kv_item_do_gc +
    + +

    kv_lock (Thumb, 16 bytes, Stack size 8 bytes, tos_kv.o(i.kv_lock)) +

    [Stack]

    • Max Depth = 144 + Unknown Stack Size +
    • Call Chain = kv_lock ⇒ tos_mutex_pend ⇒ tos_mutex_pend_timed ⇒ pend_task_block ⇒ tick_list_add ⇒ tick_task_place ⇒ tos_cpu_cpsr_save +
    +
    [Calls]
    • >>   tos_knl_is_running +
    • >>   tos_mutex_pend +
    +
    [Called By]
    • >>   tos_kv_set +
    • >>   tos_kv_has_key +
    • >>   tos_kv_get +
    • >>   tos_kv_del +
    + +

    kv_mgr_blk_index_rebuild (Thumb, 88 bytes, Stack size 16 bytes, tos_kv.o(i.kv_mgr_blk_index_rebuild)) +

    [Stack]

    • Max Depth = 192 + Unknown Stack Size +
    • Call Chain = kv_mgr_blk_index_rebuild ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_mgr_index_build +
    • >>   kv_blk_is_hanging +
    • >>   kv_blk_flags_rmv +
    +
    [Called By]
    • >>   kv_mgr_workspace_locate +
    • >>   kv_gc +
    + +

    kv_mgr_ctl_build (Thumb, 128 bytes, Stack size 24 bytes, tos_kv.o(i.kv_mgr_ctl_build)) +

    [Stack]

    • Max Depth = 200 + Unknown Stack Size +
    • Call Chain = kv_mgr_ctl_build ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_mgr_index_build +
    • >>   kv_blk_set_bad +
    • >>   kv_blk_is_hanging +
    • >>   kv_blk_hdr_read +
    • >>   kv_blk_format +
    • >>   kv_blk_flags_add +
    +
    [Called By]
    • >>   tos_kv_init +
    + +

    kv_mgr_ctl_init (Thumb, 72 bytes, Stack size 8 bytes, tos_kv.o(i.kv_mgr_ctl_init)) +

    [Stack]

    • Max Depth = 136 + Unknown Stack Size +
    • Call Chain = kv_mgr_ctl_init ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   tos_mmheap_alloc +
    • >>   tos_mutex_create +
    • >>   __aeabi_memclr4 +
    +
    [Called By]
    • >>   tos_kv_init +
    + +

    kv_mgr_index_build (Thumb, 18 bytes, Stack size 8 bytes, tos_kv.o(i.kv_mgr_index_build)) +

    [Stack]

    • Max Depth = 176 + Unknown Stack Size +
    • Call Chain = kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_item_walkthru +
    +
    [Called By]
    • >>   kv_mgr_ctl_build +
    • >>   kv_mgr_blk_index_rebuild +
    + +

    kv_mgr_workspace_locate (Thumb, 102 bytes, Stack size 8 bytes, tos_kv.o(i.kv_mgr_workspace_locate)) +

    [Stack]

    • Max Depth = 200 + Unknown Stack Size +
    • Call Chain = kv_mgr_workspace_locate ⇒ kv_mgr_blk_index_rebuild ⇒ kv_mgr_index_build ⇒ kv_item_walkthru ⇒ tos_mmheap_alloc ⇒ blk_prepare_used ⇒ blk_trim_free ⇒ blk_split ⇒ blk_mark_as_free ⇒ blk_link_next ⇒ blk_next +
    +
    [Calls]
    • >>   kv_mgr_blk_index_rebuild +
    • >>   kv_blk_is_inuse +
    • >>   kv_blk_is_fresh +
    +
    [Called By]
    • >>   tos_kv_init +
    + +

    kv_param_verify (Thumb, 60 bytes, Stack size 8 bytes, tos_kv.o(i.kv_param_verify)) +

    [Stack]

    • Max Depth = 8
    • Call Chain = kv_param_verify +
    +
    [Called By]
    • >>   tos_kv_init +
    + +

    kv_u8_disp (Thumb, 40 bytes, Stack size 16 bytes, tos_kv.o(i.kv_u8_disp)) +

    [Stack]

    • Max Depth = 40
    • Call Chain = kv_u8_disp ⇒ __2printf +
    +
    [Calls]
    • >>   __2printf +
    +
    [Called By]
    • >>   kv_block_walkthru +
    + +

    kv_unlock (Thumb, 16 bytes, Stack size 8 bytes, tos_kv.o(i.kv_unlock)) +

    [Stack]

    • Max Depth = 120 + Unknown Stack Size +
    • Call Chain = kv_unlock ⇒ tos_mutex_post ⇒ mutex_old_owner_release ⇒ tos_task_prio_change ⇒ readyqueue_remove ⇒ readyqueue_prio_highest_get ⇒ tos_cpu_clz +
    +
    [Calls]
    • >>   tos_knl_is_running +
    • >>   tos_mutex_post +
    +
    [Called By]
    • >>   tos_kv_set +
    • >>   tos_kv_has_key +
    • >>   tos_kv_get +
    • >>   tos_kv_del +
    + +

    _printf_core (Thumb, 658 bytes, Stack size 104 bytes, printf5.o(i._printf_core), UNUSED) +

    [Calls]

    • >>   __aeabi_uldivmod +
    +
    [Called By]
    • >>   __0printf$5 +
    +

    +

    +Undefined Global Symbols +


    diff --git a/board/NUCLEO_STM32L073RZ/KEIL/lorawan/TencentOS_tiny/TencentOS_tiny.sct b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/obj/TencentOS_tiny.sct similarity index 63% rename from board/NUCLEO_STM32L073RZ/KEIL/lorawan/TencentOS_tiny/TencentOS_tiny.sct rename to board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/obj/TencentOS_tiny.sct index 2d15c6b4..66acf7f8 100644 --- a/board/NUCLEO_STM32L073RZ/KEIL/lorawan/TencentOS_tiny/TencentOS_tiny.sct +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/obj/TencentOS_tiny.sct @@ -2,14 +2,14 @@ ; *** Scatter-Loading Description File generated by uVision *** ; ************************************************************* -LR_IROM1 0x08000000 0x00030000 { ; load region size_region - ER_IROM1 0x08000000 0x00030000 { ; load address = execution address +LR_IROM1 0x08000000 0x00040000 { ; load region size_region + ER_IROM1 0x08000000 0x00040000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) .ANY (+XO) } - RW_IRAM1 0x20000000 0x00005000 { ; RW data + RW_IRAM1 0x20000000 0x00010000 { ; RW data .ANY (+RW +ZI) } } diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/startup_stm32l431xx.s b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/startup_stm32l431xx.s new file mode 100644 index 00000000..6a5c15a5 --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/kv/startup_stm32l431xx.s @@ -0,0 +1,404 @@ +;********************** COPYRIGHT(c) 2017 STMicroelectronics ****************** +;* File Name : startup_stm32l431xx.s +;* Author : MCD Application Team +;* Description : STM32L431xx Ultra Low Power 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 Cortex-M4 processor is in Thread mode, +;* priority is Privileged, and the Stack is set to Main. +;* <<< Use Configuration Wizard in Context Menu >>> +;******************************************************************************* +;* +;* Redistribution and use in source and binary forms, with or without modification, +;* are permitted provided that the following conditions are met: +;* 1. Redistributions of source code must retain the above copyright notice, +;* this list of conditions and the following disclaimer. +;* 2. Redistributions in binary form must reproduce the above copyright notice, +;* this list of conditions and the following disclaimer in the documentation +;* and/or other materials provided with the distribution. +;* 3. Neither the name of STMicroelectronics nor the names of its contributors +;* may be used to endorse or promote products derived from this software +;* without specific prior written permission. +;* +;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;* +;******************************************************************************* +; +; 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 0x100 + + 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 0x100 + + 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/PVM1/PVM2/PVM3/PVM4 through EXTI Line detection + DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line + DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line + DCD FLASH_IRQHandler ; FLASH + DCD RCC_IRQHandler ; RCC + DCD EXTI0_IRQHandler ; EXTI Line0 + DCD EXTI1_IRQHandler ; EXTI Line1 + DCD EXTI2_IRQHandler ; EXTI Line2 + DCD EXTI3_IRQHandler ; EXTI Line3 + DCD EXTI4_IRQHandler ; EXTI Line4 + DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 + DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 + DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 + DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 + DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 + DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 + DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 + DCD ADC1_IRQHandler ; ADC1 + DCD CAN1_TX_IRQHandler ; CAN1 TX + DCD CAN1_RX0_IRQHandler ; CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; CAN1 RX1 + DCD CAN1_SCE_IRQHandler ; CAN1 SCE + DCD EXTI9_5_IRQHandler ; External Line[9:5]s + DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15 + DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 + DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation + DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare + DCD TIM2_IRQHandler ; TIM2 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD I2C1_EV_IRQHandler ; I2C1 Event + DCD I2C1_ER_IRQHandler ; I2C1 Error + DCD I2C2_EV_IRQHandler ; I2C2 Event + DCD I2C2_ER_IRQHandler ; I2C2 Error + DCD SPI1_IRQHandler ; SPI1 + DCD SPI2_IRQHandler ; SPI2 + DCD USART1_IRQHandler ; USART1 + DCD USART2_IRQHandler ; USART2 + DCD USART3_IRQHandler ; USART3 + DCD EXTI15_10_IRQHandler ; External Line[15:10] + DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SDMMC1_IRQHandler ; SDMMC1 + DCD 0 ; Reserved + DCD SPI3_IRQHandler ; SPI3 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors + DCD TIM7_IRQHandler ; TIM7 + DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 + DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 + DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 + DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 + DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD COMP_IRQHandler ; COMP Interrupt + DCD LPTIM1_IRQHandler ; LP TIM1 interrupt + DCD LPTIM2_IRQHandler ; LP TIM2 interrupt + DCD 0 ; Reserved + DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 + DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 + DCD LPUART1_IRQHandler ; LP UART1 interrupt + DCD QUADSPI_IRQHandler ; Quad SPI global interrupt + DCD I2C3_EV_IRQHandler ; I2C3 event + DCD I2C3_ER_IRQHandler ; I2C3 error + DCD SAI1_IRQHandler ; Serial Audio Interface 1 global interrupt + DCD 0 ; Reserved + DCD SWPMI1_IRQHandler ; Serial Wire Interface 1 global interrupt + DCD TSC_IRQHandler ; Touch Sense Controller global interrupt + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD RNG_IRQHandler ; RNG global interrupt + DCD FPU_IRQHandler ; FPU + DCD CRS_IRQHandler ; CRS 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_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 CAN1_TX_IRQHandler [WEAK] + EXPORT CAN1_RX0_IRQHandler [WEAK] + EXPORT CAN1_RX1_IRQHandler [WEAK] + EXPORT CAN1_SCE_IRQHandler [WEAK] + EXPORT EXTI9_5_IRQHandler [WEAK] + EXPORT TIM1_BRK_TIM15_IRQHandler [WEAK] + EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] + EXPORT TIM1_TRG_COM_IRQHandler [WEAK] + EXPORT TIM1_CC_IRQHandler [WEAK] + EXPORT TIM2_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 USART3_IRQHandler [WEAK] + EXPORT EXTI15_10_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT SDMMC1_IRQHandler [WEAK] + EXPORT SPI3_IRQHandler [WEAK] + EXPORT TIM6_DAC_IRQHandler [WEAK] + EXPORT TIM7_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 COMP_IRQHandler [WEAK] + EXPORT LPTIM1_IRQHandler [WEAK] + EXPORT LPTIM2_IRQHandler [WEAK] + EXPORT DMA2_Channel6_IRQHandler [WEAK] + EXPORT DMA2_Channel7_IRQHandler [WEAK] + EXPORT LPUART1_IRQHandler [WEAK] + EXPORT QUADSPI_IRQHandler [WEAK] + EXPORT I2C3_EV_IRQHandler [WEAK] + EXPORT I2C3_ER_IRQHandler [WEAK] + EXPORT SAI1_IRQHandler [WEAK] + EXPORT SWPMI1_IRQHandler [WEAK] + EXPORT TSC_IRQHandler [WEAK] + EXPORT RNG_IRQHandler [WEAK] + EXPORT FPU_IRQHandler [WEAK] + EXPORT CRS_IRQHandler [WEAK] + +WWDG_IRQHandler +PVD_PVM_IRQHandler +TAMP_STAMP_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 +CAN1_TX_IRQHandler +CAN1_RX0_IRQHandler +CAN1_RX1_IRQHandler +CAN1_SCE_IRQHandler +EXTI9_5_IRQHandler +TIM1_BRK_TIM15_IRQHandler +TIM1_UP_TIM16_IRQHandler +TIM1_TRG_COM_IRQHandler +TIM1_CC_IRQHandler +TIM2_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +I2C2_EV_IRQHandler +I2C2_ER_IRQHandler +SPI1_IRQHandler +SPI2_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +USART3_IRQHandler +EXTI15_10_IRQHandler +RTC_Alarm_IRQHandler +SDMMC1_IRQHandler +SPI3_IRQHandler +TIM6_DAC_IRQHandler +TIM7_IRQHandler +DMA2_Channel1_IRQHandler +DMA2_Channel2_IRQHandler +DMA2_Channel3_IRQHandler +DMA2_Channel4_IRQHandler +DMA2_Channel5_IRQHandler +COMP_IRQHandler +LPTIM1_IRQHandler +LPTIM2_IRQHandler +DMA2_Channel6_IRQHandler +DMA2_Channel7_IRQHandler +LPUART1_IRQHandler +QUADSPI_IRQHandler +I2C3_EV_IRQHandler +I2C3_ER_IRQHandler +SAI1_IRQHandler +SWPMI1_IRQHandler +TSC_IRQHandler +RNG_IRQHandler +FPU_IRQHandler +CRS_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***** diff --git a/components/connectivity/Eclipse-Paho-MQTT/wrapper/src/mqtt_wrapper.c b/components/connectivity/Eclipse-Paho-MQTT/wrapper/src/mqtt_wrapper.c index 857a86cc..83fd0d98 100644 --- a/components/connectivity/Eclipse-Paho-MQTT/wrapper/src/mqtt_wrapper.c +++ b/components/connectivity/Eclipse-Paho-MQTT/wrapper/src/mqtt_wrapper.c @@ -1,6 +1,6 @@ #include "mqtt_wrapper.h" -#define BUFFER_LEN 200 +#define BUFFER_LEN 256 static MQTTPacket_connectData mqtt_form_connect_packet(mqtt_con_opt_t *opt) { diff --git a/components/fs/kv/include/tos_kv.h b/components/fs/kv/include/tos_kv.h new file mode 100644 index 00000000..2caf0d47 --- /dev/null +++ b/components/fs/kv/include/tos_kv.h @@ -0,0 +1,333 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _TOS_KV_H_ +#define _TOS_KV_H_ + +#include "tos.h" +#include "tos_kv_err.h" +#include "tos_kv_flash.h" + +/* the max length of write unit, DOUBLEWORD, 64-bit + a better way is to change kv_wunit_t according the the flash program type by precompile, + if to do this, should let user config the flash program type as a macro, and that is not so friendly. + we typedef kv_wunit_t as uint64_t, so the user can focus on the code rather than how to use kv. + (althrough there may cause some waste of flash space, just a little, but much more comfortable for coding) + */ +typedef uint64_t kv_wunit_t; + +typedef uint8_t kv_byte_t; // byte +typedef uint16_t kv_hword_t; // half word +typedef uint32_t kv_word_t; // word +typedef uint64_t kv_dword_t; // double word + +/* + add delete no more space + fresh -----> inuse --------> dirty | inuse ---------------> dirty + + add no more space + fresh -----> inuse ---------------> NONE + + if bad, probably the flash block is broken, no more try to use. + if hanging, maybe another chance to rebuild index. + there is a situation: dirty | hanging +*/ +#define KV_BLK_FLAG_FRESH 0x01 /* a totally virgin block */ +#define KV_BLK_FLAG_INUSE 0x02 /* in-use */ +#define KV_BLK_FLAG_DIRTY 0x04 /* has discarded item inside */ +#define KV_BLK_FLAG_BAD 0x08 /* bad block, maybe device error */ +#define KV_BLK_FLAG_HANGING 0x10 /* index building failed, we mark a hanging flag here, and will give another chance to do a retry */ + +#define KV_FLASH_START (kv_ctl.flash_ctl.flash_start) +#define KV_FLASH_SIZE (kv_ctl.flash_ctl.flash_size) +#define KV_FLASH_END (KV_FLASH_START + KV_FLASH_SIZE) +#define KV_FLASH_SECTOR_SIZE_LOG2 (kv_ctl.flash_ctl.sector_size_log2) +#define KV_FLASH_SECTOR_SIZE (1 << KV_FLASH_SECTOR_SIZE_LOG2) +#define KV_FLASH_WRITE_ALIGN (kv_ctl.flash_ctl.flash_write_align) + +#define KV_FLASH_WRITE ((kv_flash_write_t)(kv_ctl.flash_ctl.flash_drv.write)) +#define KV_FLASH_READ ((kv_flash_read_t)(kv_ctl.flash_ctl.flash_drv.read)) +#define KV_FLASH_ERASE ((kv_flash_erase_t)(kv_ctl.flash_ctl.flash_drv.erase)) + +#define KV_IS_ALINGED(v, align) ((v) % (align) == 0) +#define KV_IS_ALINGED_LOG2(v, align_log2) KV_IS_ALINGED(v, (1 << (align_log2))) +#define KV_ALIGN_UP(v, align) (((v) + ((align) - 1)) & ~((align) - 1)) +#define KV_ALIGN_DOWN(v, align) ((v) - ((v) & ((align) - 1))) +#define KV_ADDR_OF_FIELD(addr, type, field) (addr + TOS_OFFSET_OF_FIELD(type, field)) + +#define KV_ALIGNED_SIZE(len) KV_ALIGN_UP(len, KV_FLASH_WRITE_ALIGN) + +#define KV_MGR_LOCK (&kv_ctl.mgr_ctl.kv_lock) +#define KV_MGR_BLK_NUM_FRESH (kv_ctl.mgr_ctl.blk_info.num_fresh) +#define KV_MGR_BLK_NUM_INUSE (kv_ctl.mgr_ctl.blk_info.num_inuse) +#define KV_MGR_BLK_NUM_HANGING (kv_ctl.mgr_ctl.blk_info.num_hanging) +#define KV_MGR_BLK_NUM_TOTAL (kv_ctl.mgr_ctl.blk_info.num_total) +#define KV_MGR_BLK_DETAIL (kv_ctl.mgr_ctl.blk_info.blk_detail) +#define KV_MGR_WORKSPACE (kv_ctl.mgr_ctl.workspace) + +#define KV_NO_WRITEABLE_BLK() (KV_MGR_BLK_NUM_INUSE == 0 && KV_MGR_BLK_NUM_FRESH == 0) + +#define KV_ITEM_HDR_MAGIC 0xABCD1234DCBA4321 +#define KV_ITEM_DISCARDED 0x0F0F0F0F0F0F0F0F +#define KV_ITEM_IS_DISCARDED(item_hdr) ((item_hdr)->discarded_flag == KV_ITEM_DISCARDED) +#define KV_ITEM_IS_LEGAL(item_hdr) ((item_hdr)->magic == KV_ITEM_HDR_MAGIC) +#define KV_ITEM_IS_FRESH(item_hdr) ((item_hdr)->magic == (kv_wunit_t)-1 && \ + (item_hdr)->discarded_flag == (kv_wunit_t)-1 && \ + (item_hdr)->checksum == (uint8_t)-1 && \ + (item_hdr)->k_len == (uint8_t)-1 && \ + (item_hdr)->v_len == (uint16_t)-1 && \ + (item_hdr)->prev_pos == (uint32_t)-1) + +#define KV_ITEM_ADDR2BLK(item_start) (KV_ALIGN_DOWN((item_start) - KV_FLASH_START, KV_BLK_SIZE) + KV_FLASH_START) +#define KV_ITEM_HDR_SIZE KV_ALIGNED_SIZE(sizeof(kv_item_hdr_t)) +#define KV_ITEM_BODY_SIZE(k_len, v_len) KV_ALIGNED_SIZE(k_len + v_len) +#define KV_ITEM_SIZE(k_len, v_len) (KV_ITEM_HDR_SIZE + KV_ITEM_BODY_SIZE(k_len, v_len)) +#define KV_ITEM_SIZE_OF_ITEM(item) KV_ITEM_SIZE(item->hdr.k_len, item->hdr.v_len) +#define KV_ITEM_SIZE_OF_BODY(item) KV_ITEM_BODY_SIZE(item->hdr.k_len, item->hdr.v_len) +#define KV_ITEM_ADDR_OF_BODY(item) (item->pos + KV_ITEM_HDR_SIZE) + +#define KV_BLK_HDR_MAGIC 0x1234ABCD4321DCBA +#define KV_BLK_IS_LEGAL(blk_hdr) ((blk_hdr)->magic == KV_BLK_HDR_MAGIC) +#define KV_BLK_INVALID ((uint32_t)-1) +#define KV_BLK_HDR_SIZE KV_ALIGNED_SIZE(sizeof(kv_blk_hdr_t)) +#define KV_BLK_SIZE (KV_FLASH_SECTOR_SIZE) +#define KV_BLK_FRESH_SIZE (KV_BLK_SIZE - KV_BLK_HDR_SIZE) +#define KV_BLK_END(blk_start) (blk_start + KV_BLK_SIZE) +#define KV_BLK_USABLE_ADDR(blk_start) (KV_BLK_END(blk_start) - kv_blk_freesz_get(blk_start)) +#define KV_BLK_ADDR2IDX(blk_start) ((blk_start - KV_FLASH_START) / KV_BLK_SIZE) +#define KV_BLK_FIRST_ITEM(blk_start) (blk_start + KV_BLK_HDR_SIZE) +#define KV_BLK_NEXT(blk_start) (blk_start + KV_BLK_SIZE >= KV_FLASH_END ? KV_FLASH_START : blk_start + KV_BLK_SIZE) + +#define KV_BLK_FOREACH_FROM(cur_blk, start_blk) \ + for (cur_blk = KV_BLK_NEXT(start_blk); \ + cur_blk != start_blk; \ + cur_blk = KV_BLK_NEXT(cur_blk)) + +#define KV_BLK_FOREACH(cur_blk) \ + for (cur_blk = KV_FLASH_START; \ + cur_blk < KV_FLASH_END; \ + cur_blk += KV_BLK_SIZE) + +typedef struct kv_flash_control_st { + uint8_t sector_size_log2; + uint8_t flash_write_align; + uint32_t flash_start; + uint32_t flash_size; + + kv_flash_drv_t flash_drv; +} kv_flash_ctl_t; + +typedef struct kv_blk_detail_st { + uint8_t blk_flags; /*< flags indicating the status of the blk, see KV_BLK_FLAG_* */ + uint32_t free_size; /*< how many usable flash left */ +} kv_blk_detail_t; + +typedef struct kv_blk_info_st { + uint16_t num_inuse; + uint16_t num_fresh; + uint16_t num_hanging; + uint16_t num_total; + + kv_blk_detail_t *blk_detail; +} kv_blk_info_t; + +typedef struct kv_manager_control_st { + uint32_t workspace; + kv_blk_info_t blk_info; + + k_mutex_t kv_lock; +} kv_mgr_ctl_t; + +typedef struct kv_control_st { + kv_flash_ctl_t flash_ctl; + kv_mgr_ctl_t mgr_ctl; +} kv_ctl_t; + +typedef struct kv_block_header_st { + kv_wunit_t magic; /*< is this block formatted? */ +} __PACKED__ kv_blk_hdr_t; + +typedef struct kv_item_header_st { + kv_wunit_t discarded_flag; /*< is this item a discarded one, deleted or updated */ + kv_wunit_t magic; /*< for item header integrity verification */ + uint8_t checksum; /*< checksum for key/value buffer */ + uint8_t k_len; /*< key length */ + uint16_t v_len; /*< value length */ + uint32_t prev_pos; /*< previous position of this item + if meet a power down while updating an item, and we have saved the new item, + but do not get a chance to delete the old one(we have two copy of the item with + the same key on flash), we should do the real delete when system is power on next time */ +} __PACKED__ kv_item_hdr_t; + +typedef struct kv_item_st { + kv_item_hdr_t hdr; /*< item header */ + uint32_t pos; /*< where this item is */ + uint8_t *body; /*< item body: key/value buffer */ +} kv_item_t; + +__STATIC__ kv_ctl_t kv_ctl; + +__STATIC_INLINE__ void kv_blk_freesz_set(uint32_t blk_start, uint32_t free_size) +{ + KV_MGR_BLK_DETAIL[KV_BLK_ADDR2IDX(blk_start)].free_size = free_size; +} + +__STATIC_INLINE__ uint32_t kv_blk_freesz_get(uint32_t blk_start) +{ + return KV_MGR_BLK_DETAIL[KV_BLK_ADDR2IDX(blk_start)].free_size; +} + +__STATIC_INLINE__ void kv_blk_freesz_reduce(uint32_t blk_start, uint32_t size_reduced) +{ + kv_blk_freesz_set(blk_start, kv_blk_freesz_get(blk_start) - size_reduced); +} + +__STATIC_INLINE__ int kv_blk_is_full(uint32_t blk_start) +{ + return kv_blk_freesz_get(blk_start) <= KV_ITEM_HDR_SIZE; +} + +__STATIC_INLINE__ void kv_blk_flags_set(uint32_t blk_start, uint8_t blk_flags) +{ + KV_MGR_BLK_DETAIL[KV_BLK_ADDR2IDX(blk_start)].blk_flags = blk_flags; +} + +__STATIC_INLINE__ uint8_t kv_blk_flags_get(uint32_t blk_start) +{ + return KV_MGR_BLK_DETAIL[KV_BLK_ADDR2IDX(blk_start)].blk_flags; +} + +__STATIC_INLINE__ void kv_blk_flags_add(uint32_t blk_start, uint8_t blk_flags) +{ + KV_MGR_BLK_DETAIL[KV_BLK_ADDR2IDX(blk_start)].blk_flags |= blk_flags; +} + +__STATIC_INLINE__ void kv_blk_flags_rmv(uint32_t blk_start, uint8_t blk_flags) +{ + KV_MGR_BLK_DETAIL[KV_BLK_ADDR2IDX(blk_start)].blk_flags &= ~blk_flags; +} + +__STATIC_INLINE__ int kv_blk_is_fresh(uint32_t blk_start) +{ + return kv_blk_flags_get(blk_start) & KV_BLK_FLAG_FRESH; +} + +__STATIC_INLINE__ int kv_blk_is_inuse(uint32_t blk_start) +{ + return kv_blk_flags_get(blk_start) & KV_BLK_FLAG_INUSE; +} + +__STATIC_INLINE__ int kv_blk_is_dirty(uint32_t blk_start) +{ + return kv_blk_flags_get(blk_start) & KV_BLK_FLAG_DIRTY; +} + +__STATIC_INLINE__ int kv_blk_is_bad(uint32_t blk_start) +{ + return kv_blk_flags_get(blk_start) & KV_BLK_FLAG_BAD; +} + +__STATIC_INLINE__ int kv_blk_is_hanging(uint32_t blk_start) +{ + return kv_blk_flags_get(blk_start) & KV_BLK_FLAG_HANGING; +} + +__STATIC_INLINE__ void kv_blk_set_fresh(uint32_t blk_start) +{ + if (!kv_blk_is_fresh(blk_start)) { + ++KV_MGR_BLK_NUM_FRESH; + } + + kv_blk_freesz_set(blk_start, KV_BLK_FRESH_SIZE); + kv_blk_flags_set(blk_start, KV_BLK_FLAG_FRESH); +} + +__STATIC_INLINE__ void kv_blk_set_inuse(uint32_t blk_start) +{ + if (!kv_blk_is_inuse(blk_start)) { + ++KV_MGR_BLK_NUM_INUSE; + } + + kv_blk_flags_add(blk_start, KV_BLK_FLAG_INUSE); +} + +__STATIC_INLINE__ void kv_blk_set_dirty(uint32_t blk_start) +{ + kv_blk_flags_add(blk_start, KV_BLK_FLAG_DIRTY); +} + +__STATIC_INLINE__ void kv_blk_set_bad(uint32_t blk_start) +{ + kv_blk_flags_set(blk_start, KV_BLK_FLAG_BAD); +} + +__STATIC_INLINE__ void kv_blk_set_hanging(uint32_t blk_start) +{ + if (!kv_blk_is_hanging(blk_start)) { + ++KV_MGR_BLK_NUM_HANGING; + } + + kv_blk_flags_add(blk_start, KV_BLK_FLAG_HANGING); +} + +__STATIC_INLINE__ void kv_blk_reset_fresh(uint32_t blk_start) +{ + if (kv_blk_is_fresh(blk_start)) { + --KV_MGR_BLK_NUM_FRESH; + } + + kv_blk_flags_rmv(blk_start, KV_BLK_FLAG_FRESH); +} + +__STATIC_INLINE__ void kv_blk_reset_inuse(uint32_t blk_start) +{ + if (kv_blk_is_inuse(blk_start)) { + --KV_MGR_BLK_NUM_INUSE; + } + + kv_blk_flags_rmv(blk_start, KV_BLK_FLAG_INUSE); +} + +__STATIC_INLINE__ void kv_blk_reset_hanging(uint32_t blk_start) +{ + if (kv_blk_is_hanging(blk_start)) { + --KV_MGR_BLK_NUM_HANGING; + } + + kv_blk_flags_rmv(blk_start, KV_BLK_FLAG_HANGING); +} + +typedef kv_err_t (*kv_item_walker_t)(kv_item_t *item, const void *patten); + +__API__ kv_err_t tos_kv_init(kv_flash_drv_t *flash_drv, kv_flash_prop_t *flash_prop); + +__API__ kv_err_t tos_kv_deinit(void); + +__API__ kv_err_t tos_kv_set(const char *key, const void *value, size_t v_len); + +__API__ kv_err_t tos_kv_get(const char *key, void *value_buf, size_t value_buf_size, size_t *v_len); + +__API__ int tos_kv_has_key(const char *key); + +__API__ kv_err_t tos_kv_del(const char *key); + +__DEBUG__ kv_err_t tos_kv_walkthru(void); + +__STATIC__ kv_err_t kv_gc(void); + +#endif /* _TOS_KV_H_ */ + diff --git a/components/fs/kv/include/tos_kv_err.h b/components/fs/kv/include/tos_kv_err.h new file mode 100644 index 00000000..62b4b4b8 --- /dev/null +++ b/components/fs/kv/include/tos_kv_err.h @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _TOS_KV_ERR_H_ +#define _TOS_KV_ERR_H_ + +typedef enum kv_err_en { + KV_ERR_NONE = 0u, + + KV_ERR_BUF_TOO_SHORT = 10u, + KV_ERR_BLK_STATUS_ERROR, + + KV_ERR_DATA_FETCH_FAILED = 20u, + + KV_ERR_FLASH_ERASE_FAILED = 30u, + KV_ERR_FLASH_READ_FAILED, + KV_ERR_FLASH_WRITE_FAILED, + + KV_ERR_GC_NOTHING = 40u, + + KV_ERR_INTERNAL_ERROR = 50u, + KV_ERR_INSUFFICIENT_SPACE, + KV_ERR_INVALID_PARAM, + KV_ERR_INVALID_ITEM, + + KV_ERR_NEXT_LOOP = 60u, + KV_ERR_NOT_EXIST, + KV_ERR_NO_WRITEABLE_BLK, + + KV_ERR_OUT_OF_MEMORY = 70u, + + KV_ERR_POS_FIX_FAILED =80u, + + KV_ERR_SIZE_EXCEEDED = 90u, +} kv_err_t; + +#endif /* _TOS_KV_ERR_H_ */ + diff --git a/components/fs/kv/include/tos_kv_flash.h b/components/fs/kv/include/tos_kv_flash.h new file mode 100644 index 00000000..1f209a77 --- /dev/null +++ b/components/fs/kv/include/tos_kv_flash.h @@ -0,0 +1,46 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _TOS_KV_FLASH_H_ +#define _TOS_KV_FLASH_H_ + +typedef enum kv_flash_program_type_en { + KV_FLASH_PROGRAM_TYPE_BYTE, /*!< Program byte (8-bit) at a specified address */ + KV_FLASH_PROGRAM_TYPE_HALFWORD, /*!< Program a half-word (16-bit) at a specified address */ + KV_FLASH_PROGRAM_TYPE_WORD, /*!< Program a word (32-bit) at a specified address */ + KV_FLASH_PROGRAM_TYPE_DOUBLEWORD, /*!< Program a double word (64-bit) at a specified address */ +} kv_flash_pgm_type_t; + +typedef int (*kv_flash_write_t)(uint32_t addr, const void *buf, size_t len); +typedef int (*kv_flash_read_t)(uint32_t addr, void *buf, size_t len); +typedef int (*kv_flash_erase_t)(uint32_t addr, size_t len); + +typedef struct kv_flash_drv_st { + kv_flash_write_t write; + kv_flash_read_t read; + kv_flash_erase_t erase; +} kv_flash_drv_t; + +typedef struct kv_flash_property_st { + uint8_t sector_size_log2; + kv_flash_pgm_type_t pgm_type; + uint32_t flash_start; + uint32_t flash_size; +} kv_flash_prop_t; + +#endif /* _TOS_KV_FLASH_H_ */ + diff --git a/components/fs/kv/tos_kv.c b/components/fs/kv/tos_kv.c new file mode 100644 index 00000000..f99e76b1 --- /dev/null +++ b/components/fs/kv/tos_kv.c @@ -0,0 +1,1347 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#include "tos_kv.h" + +__STATIC__ kv_ctl_t kv_ctl; + +__STATIC__ uint8_t kv_checksum_crc8(uint8_t *buf, int nbyte) +{ + int i; + uint8_t crc = 0; + +#define POLY 0x31 +#define BIT_PER_BYTE 8 +#define TOP_BIT 0x80 + + while (nbyte--) { + crc ^= *buf++; + for (i = 0; i < BIT_PER_BYTE; ++i) { + if (crc & TOP_BIT) { + crc = (crc << 1) ^ POLY; + } else { + crc <<= 1; + } + } + crc &= 0xFF; + } + + return crc; +} + +__STATIC_INLINE__ void kv_lock(void) +{ + if (tos_knl_is_running()) { + tos_mutex_pend(KV_MGR_LOCK); + } +} + +__STATIC_INLINE__ void kv_unlock(void) +{ + if (tos_knl_is_running()) { + tos_mutex_post(KV_MGR_LOCK); + } +} + +__STATIC__ kv_err_t kv_flash_read(uint32_t addr, void *buf, size_t buf_size) +{ + if (KV_FLASH_READ(addr, buf, buf_size) < 0) { + return KV_ERR_FLASH_READ_FAILED; + } + return KV_ERR_NONE; +} + +__STATIC__ kv_err_t kv_flash_write(uint32_t addr, void *buf, size_t buf_size) +{ + if (KV_FLASH_WRITE(addr, buf, buf_size) < 0) { + return KV_ERR_FLASH_WRITE_FAILED; + } + return KV_ERR_NONE; +} + +__STATIC__ kv_err_t kv_flash_erase(uint32_t start, size_t len) +{ + if (KV_FLASH_ERASE(start, len) < 0) { + return KV_ERR_FLASH_ERASE_FAILED; + } + return KV_ERR_NONE; +} + +__STATIC__ kv_err_t kv_flash_wunit_modify(uint32_t addr, kv_wunit_t data) +{ + return kv_flash_write(addr, &data, sizeof(kv_wunit_t)); +} + +__STATIC__ kv_err_t kv_flash_blk_erase(uint32_t blk_start) +{ + return kv_flash_erase(blk_start, KV_BLK_SIZE); +} + +__STATIC__ void kv_flash_ctl_init(kv_flash_drv_t *flash_drv, kv_flash_prop_t *flash_prop) +{ + memcpy(&kv_ctl.flash_ctl.flash_drv, flash_drv, sizeof(kv_flash_drv_t)); + + KV_FLASH_START = flash_prop->flash_start; + KV_FLASH_SIZE = flash_prop->flash_size; + KV_FLASH_SECTOR_SIZE_LOG2 = flash_prop->sector_size_log2; + + if (flash_prop->pgm_type == KV_FLASH_PROGRAM_TYPE_BYTE) { + KV_FLASH_WRITE_ALIGN = sizeof(kv_byte_t); + } else if (flash_prop->pgm_type == KV_FLASH_PROGRAM_TYPE_HALFWORD) { + KV_FLASH_WRITE_ALIGN = sizeof(kv_hword_t); + } else if (flash_prop->pgm_type == KV_FLASH_PROGRAM_TYPE_WORD) { + KV_FLASH_WRITE_ALIGN = sizeof(kv_word_t); + } else if (flash_prop->pgm_type == KV_FLASH_PROGRAM_TYPE_DOUBLEWORD) { + KV_FLASH_WRITE_ALIGN = sizeof(kv_dword_t); + } +} + +__STATIC__ kv_err_t kv_blk_hdr_read(uint32_t blk_start, kv_blk_hdr_t *blk_hdr) +{ + return kv_flash_read(blk_start, blk_hdr, sizeof(kv_blk_hdr_t)); +} + +__STATIC__ kv_err_t kv_blk_format(uint32_t blk_start) +{ + if (kv_flash_blk_erase(blk_start) != KV_ERR_NONE) { + return KV_ERR_FLASH_ERASE_FAILED; + } + + if (kv_flash_wunit_modify(KV_ADDR_OF_FIELD(blk_start, kv_blk_hdr_t, magic), + KV_BLK_HDR_MAGIC) != KV_ERR_NONE) { + return KV_ERR_FLASH_WRITE_FAILED; + } + + kv_blk_set_fresh(blk_start); + + return KV_ERR_NONE; +} + +__STATIC__ uint32_t kv_blk_next_fresh(void) +{ + uint32_t cur_blk; + + // we try to find a fresh block behind current block(take all the blocks as a ring) + KV_BLK_FOREACH_FROM(cur_blk, KV_MGR_WORKSPACE) { + if (kv_blk_is_fresh(cur_blk)) { + return cur_blk; + } + } + + return KV_BLK_INVALID; +} + +__STATIC__ uint32_t kv_blk_search_inuse(uint32_t item_size) +{ + uint32_t cur_blk; + + KV_BLK_FOREACH_FROM(cur_blk, KV_MGR_WORKSPACE) { + if (kv_blk_is_inuse(cur_blk) && + kv_blk_freesz_get(cur_blk) >= item_size) { + return cur_blk; + } + } + + return KV_BLK_INVALID; +} + +__STATIC__ uint32_t kv_blk_search_suitable(uint32_t item_size) +{ + uint32_t the_blk; + + // no more writeable block, no need to do the next logic + if (KV_NO_WRITEABLE_BLK()) { + return KV_BLK_INVALID; + } + + // no more blocks with sufficient space, searched before + if (KV_MGR_WORKSPACE == KV_BLK_INVALID) { + return KV_BLK_INVALID; + } + + do { + // current workspace is just ok(workspace is kinda cache) + if (kv_blk_freesz_get(KV_MGR_WORKSPACE) >= item_size) { + return KV_MGR_WORKSPACE; + } + + // first we should search in inuse blocks + the_blk = kv_blk_search_inuse(item_size); + if (the_blk != KV_BLK_INVALID) { + KV_MGR_WORKSPACE = the_blk; + return KV_MGR_WORKSPACE; + } + + // no more fresh block, cannot allocate new block and cannot do gc neither. + if (KV_MGR_BLK_NUM_FRESH < 1) { + return KV_BLK_INVALID; + } + + // if we have more than one fresh block, just give it out + if (KV_MGR_BLK_NUM_FRESH > 1) { + KV_MGR_WORKSPACE = kv_blk_next_fresh(); + return KV_MGR_WORKSPACE; + } + + // no more block inuse has sufficient space, and only one fresh block left, we should try gc + if (KV_MGR_BLK_NUM_FRESH == 1) { + if (kv_gc() != KV_ERR_NONE) { + // no more dirty block to gc, we give out the last precious fresh block(no more gc any more) + KV_MGR_WORKSPACE = kv_blk_next_fresh(); + return KV_MGR_WORKSPACE; + } + + /* if reach here, means we free some discarded space by gc, + we should try to search in inuse block again(the only fresh block left is so precious that we should + give it out as a last resort). + */ + } + } while (K_TRUE); +} + +__STATIC__ kv_err_t kv_item_hdr_write(uint32_t item_start, kv_item_hdr_t *item_hdr) +{ + if (kv_flash_write(KV_ADDR_OF_FIELD(item_start, kv_item_hdr_t, checksum), + &item_hdr->checksum, + KV_ITEM_HDR_SIZE - sizeof(kv_wunit_t) * 2) != KV_ERR_NONE) { + return KV_ERR_FLASH_WRITE_FAILED; + } + + return kv_flash_wunit_modify(KV_ADDR_OF_FIELD(item_start, kv_item_hdr_t, magic), + item_hdr->magic); +} + +__STATIC__ kv_err_t kv_item_write(uint32_t item_start, kv_item_hdr_t *item_hdr, const uint8_t *item_body, uint32_t item_body_len) +{ + /* + write item header first, then the kv buffer(item body). + if meat a power down while item writing, we wanna the consequence is predictable. + + *** for some norflash on-chip, no support for multi-times-write on the same write unit, + that means the 0xFF -> 0xEE -> 0xCC -> 0x44 trick actually does not work. + only write once on one single write unit. + so we do the header write except the kv_wunit_t domain(donnot waste the chance to modify + essential member, like discarded_flag, otherwise we have to "erase" before "write" again). + */ + + // write header, if a power down happen here, we can know it by header magic verify. + if (kv_item_hdr_write(item_start, item_hdr) != KV_ERR_NONE) { + return KV_ERR_FLASH_WRITE_FAILED; + } + + // if a power down happen here, we can know it by checksum verify. + + // write body(key & value) + return kv_flash_write(item_start + KV_ITEM_HDR_SIZE, (void *)item_body, item_body_len); +} + +__STATIC__ kv_err_t kv_item_hdr_read(uint32_t item_start, kv_item_hdr_t *item_hdr) +{ + return kv_flash_read(item_start, item_hdr, sizeof(kv_item_hdr_t)); +} + +__STATIC__ kv_err_t kv_item_body_read(kv_item_t *item) +{ + uint8_t *kv_buf = K_NULL; + + kv_buf = (uint8_t *)tos_mmheap_alloc(KV_ITEM_SIZE_OF_BODY(item)); + if (!kv_buf) { + return KV_ERR_OUT_OF_MEMORY; + } + + if (kv_flash_read(KV_ITEM_ADDR_OF_BODY(item), kv_buf, + KV_ITEM_SIZE_OF_BODY(item)) != KV_ERR_NONE) { + tos_mmheap_free(kv_buf); + return KV_ERR_FLASH_READ_FAILED; + } + + item->body = kv_buf; + + return KV_ERR_NONE; +} + +__STATIC__ kv_err_t kv_item_do_delete(uint32_t item_start) +{ + // set the discarded_flag on the flash + return kv_flash_wunit_modify(KV_ADDR_OF_FIELD(item_start, kv_item_hdr_t, discarded_flag), KV_ITEM_DISCARDED); +} + +__STATIC__ kv_err_t kv_item_delete_aux(uint32_t item_start) +{ + if (kv_item_do_delete(item_start) != KV_ERR_NONE) { + return KV_ERR_FLASH_WRITE_FAILED; + } + + kv_blk_set_dirty(KV_ITEM_ADDR2BLK(item_start)); + + return KV_ERR_NONE; +} + +__STATIC__ kv_err_t kv_item_delete(kv_item_t *item) +{ + return kv_item_delete_aux(item->pos); +} + +__STATIC__ kv_err_t kv_item_try_delete(kv_item_t *item) +{ + uint8_t *prev_key; + uint32_t prev_pos; + uint8_t prev_k_len, k_len; + kv_item_hdr_t prev_item_hdr; + + prev_pos = item->hdr.prev_pos; + + if (kv_item_hdr_read(prev_pos, &prev_item_hdr) != KV_ERR_NONE) { + return KV_ERR_FLASH_READ_FAILED; + } + + if (!KV_ITEM_IS_LEGAL(&prev_item_hdr) || + KV_ITEM_IS_DISCARDED(&prev_item_hdr)) { + /* situation 1 in kv_item_update, the prev_pos is in a fresh block now(for gc sake), + no need to delete the previous one. + */ + return KV_ERR_NONE; + } + + // test if situation 2 in kv_item_update happened + + k_len = item->hdr.k_len; + prev_k_len = prev_item_hdr.k_len; + + if (k_len != prev_k_len) { + return KV_ERR_NONE; + } + + prev_key = (uint8_t *)tos_mmheap_alloc(k_len); + if (!prev_key) { + return KV_ERR_OUT_OF_MEMORY; + } + + if (kv_flash_read(prev_pos + KV_ITEM_HDR_SIZE, prev_key, k_len) != KV_ERR_NONE) { + tos_mmheap_free(prev_key); + return KV_ERR_FLASH_READ_FAILED; + } + + // key changes, means another turn of gc happened, the previous block is filled with new item. + if (memcmp(prev_key, (void *)KV_ITEM_ADDR_OF_BODY(item), k_len) != 0) { + tos_mmheap_free(prev_key); + return KV_ERR_NONE; + } + + // the previous item is still there, delete it. + return kv_item_delete_aux(prev_pos); +} + +__STATIC_INLINE__ void kv_item_free(kv_item_t *item) +{ + if (item->body) { + tos_mmheap_free(item->body); + } + tos_mmheap_free(item); +} + +__STATIC__ int kv_item_hdr_verify(kv_item_hdr_t *item_hdr, uint32_t item_start, uint32_t blk_start) +{ + uint8_t k_len; + uint16_t v_len; + + k_len = item_hdr->k_len; + v_len = item_hdr->v_len; + + // 1. test key/value size + if (k_len == 0 || + v_len == 0 || + k_len == (uint8_t)-1 || + v_len == (uint16_t)-1) { + return K_FALSE; + } + + // 2. test the flash address range + if (item_start + KV_ITEM_SIZE(k_len, v_len) > KV_BLK_END(blk_start)) { + return K_FALSE; + } + + if (item_start + KV_ITEM_SIZE(k_len, v_len) > KV_FLASH_END) { + return K_FALSE; + } + + return K_TRUE; +} + +__STATIC_INLINE__ int kv_item_body_verify(kv_item_t *item) +{ + return item->hdr.checksum == kv_checksum_crc8(item->body, item->hdr.k_len + item->hdr.v_len); +} + +__STATIC_INLINE__ int kv_item_is_updated_one(kv_item_t *item) +{ + /* attention: + there's a possibility that item->pos equals to item->hdr.prev_pos, + if this happen, means the previous one is gc-ed, and the "item" is just + moved to the prev_pos by coincidence. + that means the previous one is not in prev_pos any more. no need to delete. + */ + return item->hdr.prev_pos != 0 && item->pos != item->hdr.prev_pos; +} + +__STATIC__ int kv_item_is_moved(kv_item_t *item) +{ + kv_err_t err; + int is_moved = K_FALSE; + kv_item_hdr_t item_hdr; + uint8_t *body_backup = K_NULL; + + // drag the header out of the flash + err = kv_item_hdr_read(item->pos, &item_hdr); + if (err != KV_ERR_NONE) { + return K_FALSE; + } + + // compare the header + if (memcmp(&item_hdr, &item->hdr, sizeof(kv_item_hdr_t)) != 0) { + return K_TRUE; + } + + // backup the body + body_backup = item->body; + + // drag the body out of the flash + err = kv_item_body_read(item); + if (err != KV_ERR_NONE) { + return K_FALSE; + } + + // compare the body + if (memcmp(body_backup, item->body, item->hdr.k_len + item->hdr.v_len) != 0) { + is_moved = K_TRUE; + } + + tos_mmheap_free(item->body); + item->body = body_backup; + + return is_moved; +} + +__STATIC__ kv_err_t kv_item_do_gc(kv_item_t *item, const void *dummy) +{ + kv_err_t err; + + err = kv_item_body_read(item); + if (err != KV_ERR_NONE) { + return err; + } + + if (kv_item_write(KV_BLK_USABLE_ADDR(KV_MGR_WORKSPACE), + &item->hdr, item->body, + KV_ITEM_SIZE_OF_BODY(item)) != KV_ERR_NONE) { + return KV_ERR_FLASH_WRITE_FAILED; + } + + // reduce the free_size + kv_blk_freesz_reduce(KV_MGR_WORKSPACE, KV_ITEM_SIZE_OF_ITEM(item)); + + return KV_ERR_NEXT_LOOP; +} + +__STATIC__ kv_err_t kv_item_do_fetch_new_copy(kv_item_t *item, const void *the_item) +{ + kv_err_t err; + kv_item_t *dst_item; + uint8_t k_len, dst_k_len; + uint16_t v_len, dst_v_len; + + dst_item = (kv_item_t *)the_item; + dst_k_len = dst_item->hdr.k_len; + dst_v_len = dst_item->hdr.v_len; + + k_len = item->hdr.k_len; + v_len = item->hdr.v_len; + + if (k_len != dst_k_len || + v_len != dst_v_len) { + return KV_ERR_NEXT_LOOP; + } + + err = kv_item_body_read(item); + if (err != KV_ERR_NONE) { + return err; + } + + if (memcmp(item->body, dst_item->body, k_len + v_len) == 0) { + return KV_ERR_NONE; + } + + return KV_ERR_NEXT_LOOP; +} + +__STATIC__ kv_err_t kv_item_do_fetch(kv_item_t *item, const void *key) +{ + kv_err_t err; + uint8_t k_len; + + k_len = item->hdr.k_len; + + if (strlen((const char *)key) != k_len) { + return KV_ERR_NEXT_LOOP; + } + + err = kv_item_body_read(item); + if (err != KV_ERR_NONE) { + return err; + } + + if (memcmp(item->body, key, k_len) == 0) { + return KV_ERR_NONE; + } + + return KV_ERR_NEXT_LOOP; +} + +__STATIC__ kv_err_t kv_item_do_recovery(kv_item_t *item, const void *dummy) +{ + kv_err_t err; + + err = kv_item_body_read(item); + if (err != KV_ERR_NONE) { + return err; + } + + if (!kv_item_body_verify(item)) { + err = kv_item_delete(item); + } else if (kv_item_is_updated_one(item)) { + /* we need to take a look inside into the previous item, + to check whether the previous one is correctly deleted. + maybe a power down happened during the update + */ + + /* + if current item's pos is not as same as its prev_pos, two situation: + 1. the item is be gc-ed to another block(just the same). + 2. the item is updated, the new data is saved but the old one may be not deleted. + */ + err = kv_item_try_delete(item); + } + + if (err != KV_ERR_NONE) { + return err; + } + + return KV_ERR_NEXT_LOOP; +} + +/* + aos's logic framework is nice here, so I learn from it. + although I have my own idea to write this logic, but the more other kv logic I process, + the more reasonable of this framework I find. thanks. +*/ +__STATIC__ kv_err_t kv_item_walkthru(uint32_t blk_start, + kv_item_walker_t walker, + const void *patten, + kv_item_t **item_out) +{ + kv_err_t err; + uint32_t cur_item; + kv_item_t *item; + kv_item_hdr_t *item_hdr; + int is_item_integral = K_TRUE; + + if (item_out) { + *item_out = K_NULL; + } + + cur_item = KV_BLK_FIRST_ITEM(blk_start); + + do { + is_item_integral = K_TRUE; + + item = (kv_item_t *)tos_mmheap_alloc(sizeof(kv_item_t)); + if (!item) { + return KV_ERR_OUT_OF_MEMORY; + } + + item->body = K_NULL; + item_hdr = &item->hdr; + + // drag the item header out of the flash to see whether is a legal item + err = kv_item_hdr_read(cur_item, item_hdr); + if (err != KV_ERR_NONE) { + kv_item_free(item); + return err; + } + + /* meet a magic none-set item + if magic is not set: + 1. it's a fresh item slot(not used) + 2. meet a power down before item magic write done + */ + if (!KV_ITEM_IS_LEGAL(item_hdr)) { + if (KV_ITEM_IS_FRESH(item_hdr)) { + // situation 1, it's a fresh item slot, meet the ending + kv_item_free(item); + break; + } + + // situation 2, meet power down, probably broken, just mark the item as discarded + is_item_integral = K_FALSE; + } + + if (!is_item_integral || + !kv_item_hdr_verify(item_hdr, cur_item, blk_start)) { + // it's no integral item, or header verify illegal + if (kv_item_do_delete(cur_item) == KV_ERR_NONE) { + kv_blk_set_dirty(blk_start); + } + + cur_item += KV_ITEM_HDR_SIZE; + kv_item_free(item); + + continue; + } + + if (!KV_ITEM_IS_DISCARDED(item_hdr)) { + // tell the item where he is, he does not know yet. + item->pos = cur_item; + + err = walker(item, patten); + if (err == KV_ERR_NONE) { + if (item_out) { + *item_out = item; + } + return KV_ERR_NONE; + } else if (err != KV_ERR_NEXT_LOOP) { + kv_item_free(item); + return err; + } + } else { + // it's a discarded item, deleted before + kv_blk_set_dirty(blk_start); + } + + cur_item += KV_ITEM_SIZE(item_hdr->k_len, item_hdr->v_len); + kv_item_free(item); + } while (cur_item + KV_ITEM_HDR_SIZE < KV_BLK_END(blk_start)); + + // have walked through all the items, get enough information to refresh the index(blk_info). + if (cur_item == KV_BLK_FIRST_ITEM(blk_start)) { + // come from fresh block break + kv_blk_set_fresh(blk_start); + } else if (cur_item + KV_ITEM_HDR_SIZE < KV_BLK_END(blk_start)) { + // come from while ending + kv_blk_freesz_set(blk_start, KV_BLK_END(blk_start) - cur_item); + kv_blk_set_inuse(blk_start); + } else { + // go across the boarder, means the space left is insufficient + kv_blk_freesz_set(blk_start, 0); + kv_blk_reset_inuse(blk_start); + } + + return KV_ERR_NONE; +} + +__STATIC__ kv_item_t *kv_item_do_find(uint32_t blk_start, const char *key) +{ + kv_item_t *the_item; + + if (kv_item_walkthru(blk_start, kv_item_do_fetch, key, &the_item) == KV_ERR_NONE) { + return the_item; + } + + return K_NULL; +} + +__STATIC__ kv_item_t *kv_item_find(const char *key) +{ + uint32_t cur_blk; + kv_item_t *item; + + KV_BLK_FOREACH(cur_blk) { + if (kv_blk_is_bad(cur_blk) || + kv_blk_is_fresh(cur_blk)) { + continue; + } + + item = kv_item_do_find(cur_blk, key); + if (item) { + return item; + } + } + return K_NULL; +} + +__STATIC__ kv_item_t *kv_item_do_find_new_copy(uint32_t blk_start, kv_item_t *item) +{ + kv_item_t *the_item; + + if (kv_item_walkthru(blk_start, kv_item_do_fetch_new_copy, + item, &the_item) == KV_ERR_NONE) { + return the_item; + } + + return K_NULL; +} + +__STATIC__ kv_item_t *kv_item_find_new_copy(kv_item_t *the_item) +{ + uint32_t cur_blk; + kv_item_t *item; + + KV_BLK_FOREACH(cur_blk) { + if (kv_blk_is_bad(cur_blk) || + kv_blk_is_fresh(cur_blk)) { + continue; + } + + item = kv_item_do_find_new_copy(cur_blk, the_item); + if (item) { + return item; + } + } + return K_NULL; +} + +__STATIC__ kv_err_t kv_item_do_save(uint32_t item_start, const char *k, const void *v, size_t v_len, uint32_t prev_pos) +{ + kv_err_t err; + uint8_t k_len; + uint32_t kv_len; + kv_item_hdr_t item_hdr; + uint8_t *kv_buf = K_NULL; + + k_len = strlen(k); + kv_len = KV_ITEM_BODY_SIZE(k_len, v_len); + + kv_buf = (uint8_t *)tos_mmheap_alloc(kv_len); + if (!kv_buf) { + return KV_ERR_OUT_OF_MEMORY; + } + + memset(kv_buf, 0, kv_len); + memcpy(kv_buf, k, k_len); + memcpy(kv_buf + k_len, v, v_len); + + item_hdr.magic = KV_ITEM_HDR_MAGIC; + item_hdr.checksum = kv_checksum_crc8(kv_buf, k_len + v_len); + + item_hdr.k_len = k_len; + item_hdr.v_len = v_len; + item_hdr.prev_pos = prev_pos; + + // we donnot deal with the discarded_flag here + err = kv_item_write(item_start, &item_hdr, kv_buf, kv_len); + + tos_mmheap_free(kv_buf); + + return err; +} + +__STATIC__ int kv_item_value_is_match(kv_item_t *item, const void *value, size_t value_len) +{ + uint8_t k_len; + uint16_t v_len; + + k_len = item->hdr.k_len; + v_len = item->hdr.v_len; + + if (value_len != v_len) { + return K_FALSE; + } + + if (memcmp(item->body + k_len, value, v_len) != 0) { + return K_FALSE; + } + + return K_TRUE; +} + +__STATIC__ kv_err_t kv_item_fix(kv_item_t *item) +{ + kv_item_t *moved_item; + + moved_item = kv_item_find_new_copy(item); + if (!moved_item) { + return KV_ERR_POS_FIX_FAILED; + } + + item->pos = moved_item->pos; + + kv_item_free(moved_item); + + return KV_ERR_NONE; +} + +__STATIC__ kv_err_t kv_item_save(const char *k, const void *v, size_t v_len, kv_item_t *prev_item) +{ + kv_err_t err; + uint32_t blk_start, k_len, item_size; + + k_len = strlen(k); + item_size = KV_ITEM_SIZE(k_len, v_len); + + blk_start = kv_blk_search_suitable(item_size); + if (blk_start == KV_BLK_INVALID) { + return KV_ERR_INSUFFICIENT_SPACE; + } + + /* gc may have been triggered in kv_blk_search_suitable, the "item" has been gc-ed from its original block to another, + so there is a possibility that neither the item->pos nor item->hdr.prev_pos is valid any more(actually the + prev_pos(is the "item->pos") of the new item is not valid either). + and there is no way to know where the new position of the "item" is (except to search again). + this may cause seriously bug. + */ + + /* gc maybe has been triggered in kv_blk_search_suitable, and the prev_item maybe moved from its + original block to another, we should identify this situation, and do kv_item_fix + */ + if (prev_item && kv_item_is_moved(prev_item)) { + /* we quite sure that the item is moved to another block because of gc. + find the new position of the item + */ + err = kv_item_fix(prev_item); + if (err != KV_ERR_NONE) { + return err; + } + } + + err = kv_item_do_save(KV_BLK_USABLE_ADDR(blk_start), k, v, v_len, prev_item ? prev_item->pos : 0); + if (err != KV_ERR_NONE) { + return err; + } + + // reduce the free_size + kv_blk_freesz_reduce(blk_start, item_size); + + if (kv_blk_is_fresh(blk_start)) { + kv_blk_reset_fresh(blk_start); + + if (!kv_blk_is_full(blk_start)) { + kv_blk_set_inuse(blk_start); + } + } else if (kv_blk_is_full(blk_start)) { + kv_blk_reset_inuse(blk_start); + } + + return KV_ERR_NONE; +} + +__STATIC__ kv_err_t kv_item_update(kv_item_t *item, const char *key, const void *value, size_t value_len) +{ + kv_err_t err; + + if (kv_item_value_is_match(item, value, value_len)) { + return KV_ERR_NONE; + } + + /* save first, then delete, is trying best to keep data integrality. */ + + err = kv_item_save(key, value, value_len, item); + if (err != KV_ERR_NONE) { + return err; + } + + /* + if gc triggered int kv_item_save, and the "item" has been gc-ed from its original block to another, + AND worse than that, a power down just happen here. + 1. the previous block is fresh(after gc) + 2. the previous block is filled with other items(another round of gc happen) + no matter 1 or 2 happen, when recovery, should test whether the item in prev_pos is legal(if not, means + block of prev_pos is fresh now), or with the same key as the "item"(the item in prev_pos may be one with + new key for gc's sake). + a lot of things should be done in kv_item_try_delete. + */ + + return kv_item_delete(item); +} + +__STATIC__ kv_err_t kv_param_verify(kv_flash_drv_t *flash_drv, kv_flash_prop_t *flash_prop) +{ + if (!flash_drv || !flash_prop) { + return KV_ERR_INVALID_PARAM; + } + + if (!KV_IS_ALINGED_LOG2(flash_prop->flash_start, flash_prop->sector_size_log2)) { + return KV_ERR_INVALID_PARAM; + } + + if (!KV_IS_ALINGED_LOG2(flash_prop->flash_size, flash_prop->sector_size_log2)) { + return KV_ERR_INVALID_PARAM; + } + + return KV_ERR_NONE; +} + +__STATIC_INLINE__ kv_err_t kv_mgr_index_build(uint32_t blk_start) +{ + return kv_item_walkthru(blk_start, kv_item_do_recovery, K_NULL, K_NULL); +} + +__STATIC__ int kv_mgr_blk_index_rebuild(void) +{ + uint32_t cur_blk; + int is_rebuild_done = K_FALSE; + + KV_BLK_FOREACH(cur_blk) { + if (kv_blk_is_hanging(cur_blk)) { + if (kv_mgr_index_build(cur_blk) == KV_ERR_NONE) { + kv_blk_reset_hanging(cur_blk); + is_rebuild_done = K_TRUE; + } + } + } + + return is_rebuild_done; +} + +__STATIC__ kv_err_t kv_mgr_workspace_locate(void) +{ + uint32_t cur_blk; + + /* we give blocks with KV_BLK_FLAG_HANGING a chance to rebuild index */ + if (KV_MGR_BLK_NUM_HANGING > 0) { + kv_mgr_blk_index_rebuild(); + } + + if (KV_NO_WRITEABLE_BLK()) { + return KV_ERR_NO_WRITEABLE_BLK; + } + + /* if no block inuse, we locate workspace in first fresh block + else locate in first block inuse + */ + KV_BLK_FOREACH(cur_blk) { + if (KV_MGR_BLK_NUM_INUSE == 0) { + if (kv_blk_is_fresh(cur_blk)) { + KV_MGR_WORKSPACE = cur_blk; + return KV_ERR_NONE; + } + } else if (kv_blk_is_inuse(cur_blk)) { + KV_MGR_WORKSPACE = cur_blk; + return KV_ERR_NONE; + } + } + + // actually unreachable here, but have to make compiler happy + return KV_ERR_NONE; +} + +__STATIC__ void kv_mgr_ctl_build(void) +{ + uint32_t cur_blk; + kv_blk_hdr_t blk_hdr; + + KV_BLK_FOREACH(cur_blk) { + if (kv_blk_hdr_read(cur_blk, &blk_hdr) != KV_ERR_NONE) { + // sth must be wrong seriously with this block + kv_blk_set_bad(cur_blk); + continue; + } + + if (!KV_BLK_IS_LEGAL(&blk_hdr)) { + if (kv_blk_format(cur_blk) != KV_ERR_NONE) { + // sth must be wrong seriously with this block + kv_blk_set_bad(cur_blk); + } + // we get a fresh block + continue; + } + + // do index building + if (kv_mgr_index_build(cur_blk) != KV_ERR_NONE) { + // sth goes wrong while index building, we give it a mark + kv_blk_set_hanging(cur_blk); + continue; + } + } +} + +__STATIC__ kv_err_t kv_mgr_ctl_init(void) +{ + kv_blk_detail_t *blk_detail; + + KV_MGR_BLK_NUM_TOTAL = KV_FLASH_SIZE / KV_FLASH_SECTOR_SIZE; + + blk_detail = (kv_blk_detail_t *)tos_mmheap_alloc(sizeof(kv_blk_detail_t) * KV_MGR_BLK_NUM_TOTAL); + if (!blk_detail) { + return KV_ERR_OUT_OF_MEMORY; + } + + memset(blk_detail, 0, sizeof(kv_blk_detail_t) * KV_MGR_BLK_NUM_TOTAL); + KV_MGR_BLK_DETAIL = blk_detail; + + if (tos_mutex_create(KV_MGR_LOCK) != K_ERR_NONE) { + return KV_ERR_INTERNAL_ERROR; + } + + return KV_ERR_NONE; +} + +__STATIC__ void kv_mgr_ctl_deinit(void) +{ + tos_mutex_destroy(KV_MGR_LOCK); + tos_mmheap_free(KV_MGR_BLK_DETAIL); + KV_MGR_BLK_DETAIL = K_NULL; + + memset(&kv_ctl, 0, sizeof(kv_ctl)); +} + +__STATIC__ kv_err_t kv_do_gc(uint32_t dirty_blk) +{ + return kv_item_walkthru(dirty_blk, kv_item_do_gc, K_NULL, K_NULL); +} + +/* on each turn of gc, we free some discarded items in the dirty block. + so we get more space to save the new item. + gc should be done only when necessary, if there is no sitiation of an item too big to save, + should not do gc(gc cause erase/write of the flash). + */ +__STATIC__ kv_err_t kv_gc(void) +{ + uint32_t cur_blk, workspace_backup; + int is_gc_done = K_FALSE, is_rebuild_done = K_FALSE; + + /* we give blocks with KV_BLK_FLAG_HANGING a chance to rebuild index */ + if (KV_MGR_BLK_NUM_HANGING > 0) { + is_rebuild_done = kv_mgr_blk_index_rebuild(); + } + + workspace_backup = KV_MGR_WORKSPACE; + + // there must be at least one fresh block left, make workspace pointer to the fresh one + KV_MGR_WORKSPACE = kv_blk_next_fresh(); + + KV_BLK_FOREACH(cur_blk) { + if (kv_blk_is_dirty(cur_blk)) { + if (kv_do_gc(cur_blk) != KV_ERR_NONE) { + // cannot do gc for this block, give others a try + continue; + } + + kv_blk_reset_inuse(cur_blk); + + if (kv_blk_format(cur_blk) != KV_ERR_NONE) { + kv_blk_set_bad(cur_blk); + } + + kv_blk_reset_fresh(KV_MGR_WORKSPACE); + + if (!kv_blk_is_full(KV_MGR_WORKSPACE)) { + kv_blk_set_inuse(KV_MGR_WORKSPACE); + } + + is_gc_done = K_TRUE; + + break; + } + } + + if (!is_gc_done) { + // if do nothing, should restore the workspace; + KV_MGR_WORKSPACE = workspace_backup; + } + + return (is_gc_done || is_rebuild_done) ? KV_ERR_NONE : KV_ERR_GC_NOTHING; +} + +__DEBUG__ __STATIC__ void kv_u8_disp(uint8_t *buf, size_t buf_len) +{ + int i = 0; + + printf("\""); + for (i = 0; i < buf_len; ++i) { + printf("%c", buf[i]); + } + printf("\"\n"); +} + +__DEBUG__ __STATIC__ kv_err_t kv_block_walkthru(uint32_t blk_start) +{ + int i = 0; + kv_err_t err; + uint32_t cur_item; + kv_item_t *item; + kv_item_hdr_t *item_hdr; + int is_item_integral = K_TRUE; + + cur_item = KV_BLK_FIRST_ITEM(blk_start); + + do { + printf("\n - [%d] item\n", i++); + printf(" - addr: 0x%x\n", cur_item); + + is_item_integral = K_TRUE; + + item = (kv_item_t *)tos_mmheap_alloc(sizeof(kv_item_t)); + if (!item) { + printf("OUT OF MEMORY\n"); + return KV_ERR_OUT_OF_MEMORY; + } + + item->body = K_NULL; + item_hdr = &item->hdr; + + err = kv_item_hdr_read(cur_item, item_hdr); + if (err != KV_ERR_NONE) { + printf(" - header read failed\n"); + kv_item_free(item); + return err; + } + + if (!KV_ITEM_IS_LEGAL(item_hdr)) { + if (KV_ITEM_IS_FRESH(item_hdr)) { + kv_item_free(item); + break; + } + + is_item_integral = K_FALSE; + } + + if (!is_item_integral) { + printf(" - not integral\n"); + } + + if (!kv_item_hdr_verify(item_hdr, cur_item, blk_start)) { + printf(" - header verify failed\n"); + } + + if (KV_ITEM_IS_DISCARDED(item_hdr)) { + printf(" - discarded\n"); + } + + if (!is_item_integral || + !kv_item_hdr_verify(item_hdr, cur_item, blk_start)) { + + cur_item += KV_ITEM_HDR_SIZE; + kv_item_free(item); + + continue; + } + + item->pos = cur_item; + + err = kv_item_body_read(item); + if (err == KV_ERR_NONE) { + if (!kv_item_body_verify(item)) { + printf(" - body verify failed\n"); + } else { + printf(" - prev_pos: 0x%x [%d block]\n", item->hdr.prev_pos, KV_BLK_ADDR2IDX(KV_ITEM_ADDR2BLK(item->hdr.prev_pos))); + printf(" - curr_pos: 0x%x [%d block]\n", item->pos, KV_BLK_ADDR2IDX(KV_ITEM_ADDR2BLK(item->pos))); + printf(" - k_len: %d\n", item->hdr.k_len); + printf(" - v_len: %d\n", item->hdr.v_len); + printf(" - k: "); + kv_u8_disp(item->body, item->hdr.k_len); + printf(" - v: "); + kv_u8_disp(item->body + item->hdr.k_len, item->hdr.v_len); + } + } + + cur_item += KV_ITEM_SIZE(item_hdr->k_len, item_hdr->v_len); + kv_item_free(item); + } while (cur_item + KV_ITEM_HDR_SIZE < KV_BLK_END(blk_start)); + + // have walked through all the items, get enough information to refresh the index(blk_info). + if (cur_item == KV_BLK_FIRST_ITEM(blk_start)) { + printf("block fresh\n"); + } else if (cur_item + KV_ITEM_HDR_SIZE < KV_BLK_END(blk_start)) { + printf("block inuse, freesize: 0x%x\n", KV_BLK_END(blk_start) - cur_item); + } else { + printf("block full\n"); + } + + return KV_ERR_NONE; +} + +__DEBUG__ kv_err_t tos_kv_walkthru(void) +{ + int i = 0; + uint32_t cur_blk; + kv_blk_hdr_t blk_hdr; + + printf("workspace: 0x%x [%d block]\n", KV_MGR_WORKSPACE, KV_BLK_ADDR2IDX(KV_MGR_WORKSPACE)); + + KV_BLK_FOREACH(cur_blk) { + printf("[%d] block\n", i++); + printf("addr: 0x%x\n", cur_blk); + + if (kv_blk_hdr_read(cur_blk, &blk_hdr) != KV_ERR_NONE) { + printf("block header read failed\n"); + continue; + } + + if (!KV_BLK_IS_LEGAL(&blk_hdr)) { + printf("block not formatted\n"); + continue; + } + + if (kv_block_walkthru(cur_blk) != KV_ERR_NONE) { + printf("block diagnosis failed\n"); + continue; + } + + printf("\n\n"); + } + + return KV_ERR_NONE; +} + +__API__ kv_err_t tos_kv_init(kv_flash_drv_t *flash_drv, kv_flash_prop_t *flash_prop) +{ + kv_err_t err; + + if (kv_param_verify(flash_drv, flash_prop) != KV_ERR_NONE) { + return KV_ERR_INVALID_PARAM; + } + + memset(&kv_ctl, 0, sizeof(kv_ctl)); + + kv_flash_ctl_init(flash_drv, flash_prop); + + err = kv_mgr_ctl_init(); + if (err != KV_ERR_NONE) { + return err; + } + + kv_mgr_ctl_build(); + + printf("fresh: %d\n", KV_MGR_BLK_NUM_FRESH); + printf("hanging: %d\n", KV_MGR_BLK_NUM_HANGING); + printf("inuse: %d\n", KV_MGR_BLK_NUM_INUSE); + printf("total: %d\n", KV_MGR_BLK_NUM_TOTAL); + + return kv_mgr_workspace_locate(); +} + +__API__ kv_err_t tos_kv_deinit(void) +{ + kv_mgr_ctl_deinit(); + return KV_ERR_NONE; +} + +__API__ kv_err_t tos_kv_set(const char *key, const void *value, size_t value_len) +{ + kv_err_t err; + kv_item_t *item; + + if (!key || !value) { + return KV_ERR_INVALID_PARAM; + } + + if (strlen(key) >= (uint8_t)-1 || + value_len >= (uint16_t)-1) { + return KV_ERR_SIZE_EXCEEDED; + } + + kv_lock(); + + item = kv_item_find(key); + if (item) { // already exist + err = kv_item_update(item, key, value, value_len); + kv_item_free(item); + } else { + err = kv_item_save(key, value, value_len, K_NULL); + } + + kv_unlock(); + + return err; +} + +__API__ kv_err_t tos_kv_get(const char *key, void *value_buf, size_t value_buf_size, size_t *value_len) +{ + uint8_t k_len; + uint16_t v_len; + kv_item_t *item; + + if (!key || !value_buf || !value_len) { + return KV_ERR_INVALID_PARAM; + } + + if (strlen(key) >= (uint8_t)-1) { + return KV_ERR_SIZE_EXCEEDED; + } + + kv_lock(); + + item = kv_item_find(key); + if (!item) { + kv_unlock(); + return KV_ERR_NOT_EXIST; + } + + kv_unlock(); + + k_len = item->hdr.k_len; + v_len = item->hdr.v_len; + *value_len = v_len; + + if (value_buf_size < v_len) { + kv_item_free(item); + return KV_ERR_BUF_TOO_SHORT; + } + + memcpy(value_buf, item->body + k_len, v_len); + kv_item_free(item); + + return KV_ERR_NONE; +} + +__API__ int tos_kv_has_key(const char *key) +{ + int has_key; + + if (!key) { + return KV_ERR_INVALID_PARAM; + } + + if (strlen(key) >= (uint8_t)-1) { + return KV_ERR_SIZE_EXCEEDED; + } + + kv_lock(); + has_key = kv_item_find(key) ? K_TRUE : K_FALSE; + kv_unlock(); + + return has_key; +} + +__API__ kv_err_t tos_kv_del(const char *key) +{ + kv_err_t err; + kv_item_t *item; + + if (!key) { + return KV_ERR_INVALID_PARAM; + } + + if (strlen(key) >= (uint8_t)-1) { + return KV_ERR_SIZE_EXCEEDED; + } + + kv_lock(); + + item = kv_item_find(key); + if (!item) { + kv_unlock(); + return KV_ERR_NOT_EXIST; + } + + err = kv_item_delete(item); + kv_item_free(item); + + kv_unlock(); + + return err; +} + diff --git a/devices/rhf76_lora/RHF76.c b/devices/rhf76_lora/RHF76.c index 32d98446..18eb2d27 100644 --- a/devices/rhf76_lora/RHF76.c +++ b/devices/rhf76_lora/RHF76.c @@ -3,6 +3,21 @@ static mcps_indication_t rhf76_mcps_indication; +static int rhf76_exit_low_power(void) +{ + int try = 0; + at_echo_t echo; + + tos_at_echo_create(&echo, NULL, 0, "+LOWPOWER: AUTOOFF"); + while (try++ < 10) { + tos_at_cmd_exec(&echo, 3000, RHF76_LOWPOWER_SET); + if (echo.status == AT_ECHO_STATUS_OK || echo.status == AT_ECHO_STATUS_EXPECT) { + return 0; + } + } + return -1; +} + static int rhf76_reset(void) { int try = 0; @@ -186,6 +201,10 @@ static int rhf76_init(void) printf("Init RHF76 LoRa ...\n" ); at_delay_ms(1000); + if (rhf76_exit_low_power() != 0) { + printf("rhf76 reset FAILED\n"); + return -1; + } if (rhf76_reset() != 0) { printf("rhf76 reset FAILED\n"); diff --git a/devices/rhf76_lora/RHF76.h b/devices/rhf76_lora/RHF76.h index 55694a21..a8524dc5 100644 --- a/devices/rhf76_lora/RHF76.h +++ b/devices/rhf76_lora/RHF76.h @@ -51,6 +51,9 @@ typedef enum lora_key_type { } lora_key_type_t; +const char RHF76_LOWPOWER_SET[] = { + 0xFF,0xFF,0xFF,0xFF,'A','T','+','L','O','W','P','O','W','E','R','=','a','u','t','o','o','f','f','\r','\n' +}; #define RHF76_ATCMD_SET_CLASS_A "AT+CLASS=A\r\n" #define RHF76_ATCMD_SET_CLASS_B "AT+CLASS=B\r\n" #define RHF76_ATCMD_SET_CLASS_C "AT+CLASS=C\r\n" diff --git a/examples/kv/kv_sample.c b/examples/kv/kv_sample.c new file mode 100644 index 00000000..9fadb755 --- /dev/null +++ b/examples/kv/kv_sample.c @@ -0,0 +1,105 @@ +#include "tos_kv.h" + +#include "cmsis_os.h" + +#define TASK_STK_SIZE 2048 +void task(void *arg); +osThreadDef(task, osPriorityNormal, 1, TASK_STK_SIZE); + +// #define USING_ONCHIP_FLASH + +#ifdef USING_ONCHIP_FLASH +extern kv_flash_drv_t stm32l4_norflash_onchip_drv; +extern kv_flash_prop_t stm32l4_norflash_onchip_prop; +#else +extern kv_flash_drv_t stm32l4_qspiflash_drv; +extern kv_flash_prop_t stm32l4_qspiflash_prop; +#endif + +void disp_value(uint8_t *value, uint32_t value_len) +{ + int i = 0; + + printf("value_len: %d\n", value_len); + + printf("\""); + for (i = 0; i < value_len; ++i) { + printf("%c", value[i]); + } + printf("\"\n\n"); +} + +void task(void *arg) +{ + int has_key; + kv_err_t err; + uint8_t value_buf[40]; + uint32_t value_len; + +#ifndef USING_ONCHIP_FLASH // use qspiflash + extern void MX_QUADSPI_Init(void); + MX_QUADSPI_Init(); +#endif + +#if 0 + stm32l4_norflash_onchip_erase(0x803d000, 2048); + stm32l4_norflash_onchip_erase(0x803d000 + 2048, 2048); + return; +#endif + +#ifdef USING_ONCHIP_FLASH + err = tos_kv_init(&stm32l4_norflash_onchip_drv, &stm32l4_norflash_onchip_prop); + printf("kv init, rc: %d\n", err); +#else + err = tos_kv_init(&stm32l4_qspiflash_drv, &stm32l4_qspiflash_prop); + printf("kv init, rc: %d\n", err); +#endif + + has_key = tos_kv_has_key("key00"); + printf("has key[%s] ? %s\n\n", "key00", has_key ? "True" : "False"); + + err = tos_kv_set("key00", "value_00", strlen("value_00")); + printf("kv set(%s), rc: %d\n\n", "key00", err); + + has_key = tos_kv_has_key("key00"); + printf("has key[%s] ? %s\n\n", "key00", has_key ? "True" : "False"); + + if (err == KV_ERR_NONE) { + err = tos_kv_get("key00", value_buf, sizeof(value_buf), &value_len); + printf("kv get(%s), rc: %d\n\n", "key00", err); + + if (err == KV_ERR_NONE) { + disp_value(value_buf, value_len); + } + + tos_kv_walkthru(); + } + + err = tos_kv_set("key00", "value_xx", strlen("value_xx")); + printf("kv set(%s), rc: %d\n\n", "key00", err); + + if (err == KV_ERR_NONE) { + err = tos_kv_get("key00", value_buf, sizeof(value_buf), &value_len); + printf("kv get(%s), rc: %d\n\n", "key00", err); + + if (err == KV_ERR_NONE) { + disp_value(value_buf, value_len); + } + + tos_kv_walkthru(); + } + + err = tos_kv_del("key00"); + printf("kv del(%s), rc: %d\n\n", "key00", err); + + has_key = tos_kv_has_key("key00"); + printf("has key[%s] ? %s\n\n", "key00", has_key ? "True" : "False"); + + tos_kv_walkthru(); +} + +void application_entry(void *arg) +{ + osThreadCreate(osThread(task), NULL); // Create task1 +} + diff --git a/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo.c b/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo.c new file mode 100644 index 00000000..83a5155c --- /dev/null +++ b/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo.c @@ -0,0 +1,394 @@ +#include "e53_ia1_e2e_demo.h" +#include "e53_ia1_e2e_demo_config.h" +#include "cJSON.h" +#include "E53_IA1.h" +#include "mcu_init.h" + +#define USE_ESP8266 +//#define MQTT_SERVER_IP "iotcloud-mqtt.gz.tencentdevices.com" +#define MQTT_SERVER_IP "111.230.127.136" +#define MQTT_SERVER_PORT "1883" + +const char OPEN = 1; +const char CLOSE = 0; + +int sock_id = 0; + +void sensor_init(void) { + Init_E53_IA1(); +} + +void sensor_read(void) { + E53_IA1_Read_Data(); +} + +int light_intensity_low() { + return E53_IA1_Data.Lux < (float)20.0 && E53_IA1_Data.LightMode == CLOSE; +} + +int light_intensity_high() { + return E53_IA1_Data.Lux > (float)20.0 && E53_IA1_Data.LightMode == OPEN; +} + +int temperature_too_high() { + return E53_IA1_Data.Lux > (float)20.0 && E53_IA1_Data.LightMode == OPEN; + // return E53_IA1_Data.Temperature > (float)30.0 && E53_IA1_Data.MotorMode == OPEN; +} + +void turnon_fan() { + motor_control(OPEN); +} + +void turnoff_fan() { + motor_control(CLOSE); +} + +void turnon_light() { + light_control(OPEN); +} + +void turnoff_light() { + light_control(CLOSE); +} + +void print_sensor_data() { + printf("{\"temperature\":%.2f,\"humidity\":%.2f,\"light_intensity\":%.2f,\"motor\":%d,\"light\":%d}\n", + E53_IA1_Data.Temperature, + E53_IA1_Data.Humidity, + E53_IA1_Data.Lux, + E53_IA1_Data.MotorMode, + E53_IA1_Data.LightMode); +} + +int parse_data(uint8_t *data) { + //{"motor":0,"light":1} + cJSON* cjson = cJSON_Parse((char *)data); + cJSON *cjsonret = NULL; + int motor; + int light; + if(cjson == NULL) { + printf("json pack into cjson error..."); + return -1; + } else { + cJSON_Print(cjson); + } + cjsonret = NULL; + cjsonret = cJSON_GetObjectItem(cjson, "motor"); + if(cjsonret != NULL) { + motor = cjsonret->valueint; + printf("motor=%d\n", motor); + if(motor == 1) { + //power on relay + turnon_fan(); + // motor_control(OPEN); + } else if(motor == 0) { + //power off relay + motor_control(CLOSE); + } + } + cjsonret = NULL; + cjsonret = cJSON_GetObjectItem(cjson, "light"); + if(cjsonret != NULL) { + light = cjsonret->valueint; + printf("light=%d\n", light); + if(light == 1) { + //power on relay + light_control(OPEN); + } else if(light == 0) { + //power off relay + light_control(CLOSE); + } + } + cJSON_Delete(cjson); + return 0; +} + +int receive_data(void) { + static int count = 1; + uint8_t read_data[100] = {0}; + int read_len; + mqtt_sub_opt_t sub_opt; + sub_opt.count = 1; + sub_opt.dup = 0; + sub_opt.id = 1; + sub_opt.req_qos = 0; + sub_opt.topic = MQTT_SUBSCRIBE_TOPIC; + + printf("receive: \r\n"); + read_len = tos_mqtt_receive(sub_opt.topic, strlen(sub_opt.topic), read_data, sizeof(read_data)); + if (read_len >= 0) { + printf("MQTT count: %d\r\n", count++); + printf("---------->topic: %s, payload: %s, payload_len: %d\n", sub_opt.topic, read_data, read_len); + parse_data(read_data); + } + return 0; +} + +int publish_data(void) { + mqtt_pub_opt_t pub_opt; + pub_opt.dup = 0; + pub_opt.qos = 0; + pub_opt.retained = 0; + pub_opt.id = 0; + pub_opt.topic = MQTT_PUBLISH_TOPIC; + + char buffer[256] = {0}; + snprintf(buffer, sizeof(buffer), + "{\"type\":\"update\",\"state\":{\"desired\":null,\"reported\":{\"temperature\":%.2f,\"humidity\":%.2f,\"light_intensity\":%.2f,\"motor\":%d,\"light\":%d}},\"version\":0,\"clientToken\":\"clientToken\"}", + E53_IA1_Data.Temperature, + E53_IA1_Data.Humidity, + E53_IA1_Data.Lux, + E53_IA1_Data.MotorMode, + E53_IA1_Data.LightMode); + + pub_opt.payload = (unsigned char *)buffer; + pub_opt.payload_len = strlen(buffer); + printf("\r\nreport--->topic:%s\r\ndata(%d):%s\r\n", pub_opt.topic, pub_opt.payload_len, pub_opt.payload); + if (tos_mqtt_publish(sock_id, &pub_opt) != 0) { + printf("publish failed!!!\n"); + } + return 0; +} + +int network_init() { +#ifdef USE_ESP8266 + extern int esp8266_sal_init(hal_uart_port_t uart_port); + extern int esp8266_join_ap(const char *ssid, const char *pwd); + esp8266_sal_init(HAL_UART_PORT_0); + int ret = esp8266_join_ap("Tencent-StaffWiFi", ""); + //int ret = esp8266_join_ap("Tencent-StaffWiFi", ""); + //int ret = esp8266_join_ap("Tencent-GuestWiFi", "252901"); + return ret; +#endif +} + +int mqtt_connect(void) { + mqtt_con_opt_t con_opt; + con_opt.keep_alive_interval = 2000; + con_opt.cleansession = 1; + con_opt.username = MQTT_USR_NAME; + con_opt.password = MQTT_PASSWORD; + con_opt.client_id = MQTT_CLIENT_ID; + + int try = 0; + while(try++ < 10) { + sock_id = tos_mqtt_connect(MQTT_SERVER_IP, MQTT_SERVER_PORT, &con_opt); + if (sock_id != -1) { + printf("tos_mqtt_connect success. sock_id %d \r\n", sock_id); + return 0; + } + transport_close(sock_id); + printf("tos_mqtt_connect fail. sock_id %d \r\n", sock_id); + osDelay(2000); + } + return -1; +} + +int mqtt_subscribe(void) { + mqtt_sub_opt_t sub_opt; + sub_opt.count = 1; + sub_opt.dup = 0; + sub_opt.id = 1; + sub_opt.req_qos = 0; + sub_opt.topic = MQTT_SUBSCRIBE_TOPIC; + + int try = 0; + while (try++ < 10) { + if (tos_mqtt_subscribe(sock_id, &sub_opt) == 0) { + printf("subscribe topic:%s success\n", sub_opt.topic); + return 0; + } + osDelay(2000); + } + printf("subscribe topic:%s fail\n", sub_opt.topic); + + return -1; +} + +void qcloud_agent(void) { + // 通过通信模组实现网络连接 + int ret = network_init(); + if (ret < 0) { + printf("network_init fail\n"); + return; + } + + // 建立到IoT hub的MQTT连接 + ret = mqtt_connect(); + if (ret < 0) { + printf("mqtt_connect fail\n"); + return; + } + + // 订阅设备主题,用于接收下行消息 + ret = mqtt_subscribe(); + if (ret < 0) { + printf("mqtt_subscribe fail\n"); + return; + } + + sensor_init(); + while(1) { + sensor_read(); + // 上报传感器数据 + publish_data(); + // 接收下行控制消息 + receive_data(); + osDelay(1000); + } +} + + +void one_loop_task(void *arg) { + sensor_init(); + while(1) { + sensor_read(); + print_sensor_data(); + // 光照强度太低 => 打开补光灯 + if (light_intensity_low()) { + turnon_light(); // 实时性如何保证? + // 光照强度过高 => 关闭补光灯 + } else if (light_intensity_high()) { + turnoff_light(); + } + + // 其他业务逻辑 + printf("delay 5 senconds \n"); + osDelay(5000); + } +} + +void monitor_task(void) { + sensor_init(); + while(1) { + sensor_read(); + // 光照强度太低 => 打开补光灯 + if (light_intensity_low()) { + turnon_light(); + turnon_fan(); + // 光照强度过高 => 关闭补光灯 + } else if (light_intensity_high()) { + turnoff_light(); + turnoff_fan(); + } + osDelay(100); + } +} + +void normal_task() { + while(1) { + printf("do something for 5 senconds \n"); + print_sensor_data(); + osDelay(5000); + } +} + +void network_test_task() { + // 初始化WiFi模组,连接AP + int ret = network_init(); + if (ret < 0) { + printf("network_init fail\n"); + return; + } + + // 调用SAL层接口,建立Socket连接 + int socket_id = -1; + uint8_t recv_data[128]; + socket_id = tos_sal_module_connect("45.40.201.56", "8080", TOS_SAL_PROTO_TCP); + if (socket_id == -1) { + printf("TCP connect failed\r\n"); + return; + } else { + printf("TCP connect success! fd: %d\n", socket_id); + } + + // 调用SAL层接口,消息收发 + while (1) { + tos_sal_module_send(socket_id, (const void *)"Hello TencentOS tiny!\r\n", + strlen("Hello TencentOS tiny!\r\n")); + + int recv_len = tos_sal_module_recv_timeout(socket_id, recv_data, sizeof(recv_data), 8000); + if (recv_len < 0) { + printf("receive error\n\r"); + } else if (recv_len == 0) { + printf("receive none\n"); + } else { + recv_data[recv_len] = 0; + printf("receive len: %d\n recv_data: %s\n", recv_len, recv_data); + } + + tos_sleep_ms(2000); + } +} + +// 联网测试 +osThreadDef(network_test_task, osPriorityNormal, 1, 1024); + +// 端云对接 +osThreadDef(qcloud_agent, osPriorityNormal, 1, 8192); + +// 大循环的方式 +osThreadDef(one_loop_task, osPriorityNormal, 1, 1024); + +// 1. 高优先级任务 +#define MONITOR_STK_SIZE 1024 +osThreadDef(monitor_task, osPriorityHigh, 1, MONITOR_STK_SIZE); + +// 2. 普通优先级任务 +#define NORMAL_STK_SIZE 512 +osThreadDef(normal_task, osPriorityNormal, 1, NORMAL_STK_SIZE); + +void helloworld(void *arg) +{ + while(1) { + printf("helloworld\n"); + osDelay(1000); + } +} + +#define TASK2_STK_SIZE 512 +osThreadDef(helloworld, osPriorityNormal, 1, TASK2_STK_SIZE); + +void application_entry(void *arg) { + osThreadCreate(osThread(qcloud_agent), NULL); +} + +/* +// 创建任务 +osThreadCreate(osThread(helloworld), NULL); + +// 大循环的方式 +sensor_init(); +while(1) { + sensor_read(); + print_sensor_data(); + + // 光照强度太低 => 打开补光灯 + if (light_intensity_low()) { + turnon_light(); // 实时性如何保证? + // 光照强度过高 => 关闭补光灯 + } else if (light_intensity_high()) { + turnoff_light(); + } + + // 其他业务逻辑 + printf("do something for 5 senconds \n"); + osDelay(5000); +} + + +// 多任务,基于优先级抢占 +// 高优先级任务: 读取传感器,并实时监控传感器值 +osThreadCreate(osThread(monitor_task), NULL); +// 普通优先级任务:其他业务逻辑 +osThreadCreate(osThread(normal_task), NULL); + +// 联网测试 +osThreadCreate(osThread(network_test_task), NULL); + +// 端云对接 +osThreadCreate(osThread(qcloud_agent), NULL); + +*/ + + diff --git a/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo.h b/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo.h new file mode 100644 index 00000000..21f28fb4 --- /dev/null +++ b/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo.h @@ -0,0 +1,16 @@ +#ifndef __MQTT_DEMO_H__ +#define __MQTT_DEMO_H__ + +#include "mcu_init.h" +#include "tos_at.h" +#include "string.h" +#include "cmsis_os.h" +#include "sal_module_wrapper.h" + +#include "mqtt_wrapper.h" + +extern void application_entry(void *arg); +extern void motor_control(char mode); +extern void light_control(char mode); +#endif /* __APP_DEMO_H__ */ + diff --git a/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo_config.h b/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo_config.h new file mode 100644 index 00000000..7a3d2cc3 --- /dev/null +++ b/examples/sensor_e53_ia1_e2e_demo/e53_ia1_e2e_demo_config.h @@ -0,0 +1,12 @@ +#ifndef _H_TOS_FARM_AI_CONFIG_H +#define _H_TOS_FARM_AI_CONFIG_H + +#define MQTT_PRODUCT_ID "U1BZWHF7F9" +#define MQTT_DEV_NAME "dev_01" +#define MQTT_CLIENT_ID "U1BZWHF7F9dev_01" +#define MQTT_USR_NAME "U1BZWHF7F9dev_01;12010126;O3I57;1611533066" +#define MQTT_PASSWORD "6ebcf20c9f7f725b5bcf18a85cc7a49479f489eea65946f92ba18a51a135c89e;hmacsha256" +#define MQTT_SUBSCRIBE_TOPIC "U1BZWHF7F9/dev_01/data" +#define MQTT_PUBLISH_TOPIC "$shadow/operation/U1BZWHF7F9/dev_01" + +#endif diff --git a/kernel/core/include/tos_task.h b/kernel/core/include/tos_task.h index 13f24344..da773297 100644 --- a/kernel/core/include/tos_task.h +++ b/kernel/core/include/tos_task.h @@ -61,7 +61,7 @@ typedef void (*k_task_entry_t)(void *arg); -typedef void (*k_task_walker)(k_task_t *task); +typedef void (*k_task_walker_t)(k_task_t *task); /** * task control block @@ -339,7 +339,7 @@ __API__ k_err_t tos_task_stack_draught_depth(k_task_t *task, int *depth); * * @return None */ -__API__ void tos_task_walkthru(k_task_walker walker); +__API__ void tos_task_walkthru(k_task_walker_t walker); /** * @brief A debug API for display all tasks information. diff --git a/kernel/core/tos_mmheap.c b/kernel/core/tos_mmheap.c index 48a0432c..bb98073a 100644 --- a/kernel/core/tos_mmheap.c +++ b/kernel/core/tos_mmheap.c @@ -191,7 +191,7 @@ __STATIC_INLINE__ void *blk_to_ptr(const mmheap_blk_t *blk) } /* Return location of next block after block of given size. */ -__STATIC_INLINE__ mmheap_blk_t *offset_to_block(const void *ptr, int diff) +__STATIC_INLINE__ mmheap_blk_t *offset_to_blk(const void *ptr, int diff) { return (mmheap_blk_t *)((cpu_addr_t)ptr + diff); } @@ -207,7 +207,7 @@ __STATIC__ mmheap_blk_t *blk_next(const mmheap_blk_t *blk) { mmheap_blk_t *next_blk; - next_blk = offset_to_block(blk_to_ptr(blk), blk_size(blk) - K_MMHEAP_BLK_HEADER_OVERHEAD); + next_blk = offset_to_blk(blk_to_ptr(blk), blk_size(blk) - K_MMHEAP_BLK_HEADER_OVERHEAD); return next_blk; } @@ -331,7 +331,7 @@ __STATIC__ mmheap_blk_t *blk_split(mmheap_blk_t *blk, size_t size) size_t remain_size; /* Calculate the amount of space left in the remaining block. */ - remaining = offset_to_block(blk_to_ptr(blk), size - K_MMHEAP_BLK_HEADER_OVERHEAD); + remaining = offset_to_blk(blk_to_ptr(blk), size - K_MMHEAP_BLK_HEADER_OVERHEAD); remain_size = blk_size(blk) - (size + K_MMHEAP_BLK_HEADER_OVERHEAD); blk_set_size(remaining, remain_size); @@ -735,7 +735,7 @@ __API__ k_err_t tos_mmheap_pool_add(void *pool_start, size_t pool_size) ** so that the prev_phys_block field falls outside of the pool - ** it will never be used. */ - curr_blk = offset_to_block(pool_start, -K_MMHEAP_BLK_HEADER_OVERHEAD); + curr_blk = offset_to_blk(pool_start, -K_MMHEAP_BLK_HEADER_OVERHEAD); blk_set_size(curr_blk, size_aligned); blk_set_free(curr_blk); blk_set_prev_used(curr_blk); @@ -763,7 +763,7 @@ __API__ k_err_t tos_mmheap_pool_rmv(void *pool_start) return K_ERR_MMHEAP_POOL_NOT_EXIST; } - blk = offset_to_block(pool_start, -K_MMHEAP_BLK_HEADER_OVERHEAD); + blk = offset_to_blk(pool_start, -K_MMHEAP_BLK_HEADER_OVERHEAD); mapping_insert(blk_size(blk), &fl, &sl); remove_free_block(blk, fl, sl); @@ -780,7 +780,7 @@ __API__ k_err_t tos_mmheap_pool_check(void *pool_start, k_mmheap_info_t *info) memset(info, 0, sizeof(k_mmheap_info_t)); - blk = offset_to_block(pool_start, -K_MMHEAP_BLK_HEADER_OVERHEAD); + blk = offset_to_blk(pool_start, -K_MMHEAP_BLK_HEADER_OVERHEAD); while (blk && !blk_is_last(blk)) { if (blk_is_free(blk)) { diff --git a/kernel/core/tos_task.c b/kernel/core/tos_task.c index 0f073463..e278d560 100644 --- a/kernel/core/tos_task.c +++ b/kernel/core/tos_task.c @@ -547,7 +547,7 @@ __API__ k_task_t *tos_task_curr_task_get(void) return curr_task; } -__API__ void tos_task_walkthru(k_task_walker walker) +__API__ void tos_task_walkthru(k_task_walker_t walker) { TOS_CPU_CPSR_ALLOC(); k_task_t *task; diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/README.md b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/README.md new file mode 100644 index 00000000..93c7a088 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/README.md @@ -0,0 +1,4 @@ +### 小程序云开发DEMO +1. 说明 +本示例小程序配合TencentOS_tiny开发板智慧农业传感器扩展板使用 +TencentOS-tiny/examples/sensor_e53_ia1_e2e_demo diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-publish/index.js b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-publish/index.js new file mode 100644 index 00000000..298668c9 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-publish/index.js @@ -0,0 +1,36 @@ +const tencentcloud = require("tencentcloud-sdk-nodejs"); + +const IotcloudClient = tencentcloud.iotcloud.v20180614.Client; +const models = tencentcloud.iotcloud.v20180614.Models; + +const Credential = tencentcloud.common.Credential; +const ClientProfile = tencentcloud.common.ClientProfile; +const HttpProfile = tencentcloud.common.HttpProfile; + +let cred = new Credential("AKIDxZ2LTTi84eaR3OfS8hnfxd4JHzQatFpF", "UigMrA9rJXUCeoiBQP8dsJuJ6sYzmNjs"); +let httpProfile = new HttpProfile(); +httpProfile.endpoint = "iotcloud.tencentcloudapi.com"; +let clientProfile = new ClientProfile(); +clientProfile.httpProfile = httpProfile; +let client = new IotcloudClient(cred, "ap-guangzhou", clientProfile); + +// 云函数入口函数 +exports.main = async (event, context) => { + let req = new models.PublishMessageRequest(); + req.Topic = "U1BZWHF7F9/dev_01/data"; + req.DeviceName = "dev_01"; + req.ProductId = "U1BZWHF7F9"; + req.Payload = event.Payload; + + return new Promise((resolve, reject)=>{ + client.PublishMessage(req, function (errMsg, response) { + if (errMsg) { + console.log(errMsg); + reject(errMsg) + return; + } + console.log(response.to_json_string()); + resolve(response) + }); + }) +} \ No newline at end of file diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-publish/package.json b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-publish/package.json new file mode 100644 index 00000000..80f0014c --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-publish/package.json @@ -0,0 +1,14 @@ +{ + "name": "iothub-publish", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "latest" + } +} \ No newline at end of file diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-shadow-query/index.js b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-shadow-query/index.js new file mode 100644 index 00000000..4a7dc6b8 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-shadow-query/index.js @@ -0,0 +1,36 @@ +const tencentcloud = require("tencentcloud-sdk-nodejs"); + +const IotcloudClient = tencentcloud.iotcloud.v20180614.Client; +const models = tencentcloud.iotcloud.v20180614.Models; + +const Credential = tencentcloud.common.Credential; +const ClientProfile = tencentcloud.common.ClientProfile; +const HttpProfile = tencentcloud.common.HttpProfile; + +let cred = new Credential("AKIDxZ2LTTi84eaR3OfS8hnfxd4JHzQatFpF", "UigMrA9rJXUCeoiBQP8dsJuJ6sYzmNjs"); +let httpProfile = new HttpProfile(); +httpProfile.endpoint = "iotcloud.tencentcloudapi.com"; +let clientProfile = new ClientProfile(); +clientProfile.httpProfile = httpProfile; +let client = new IotcloudClient(cred, "ap-guangzhou", clientProfile); + +let req = new models.DescribeDeviceShadowRequest(); + +let params = '{"ProductId":"U1BZWHF7F9","DeviceName":"dev_01"}' +req.from_json_string(params); + +exports.main = async (event, context) => { + return new Promise((resolve, reject)=>{ + client.DescribeDeviceShadow(req, function (errMsg, response) { + + if (errMsg) { + console.log(errMsg); + reject(errMsg) + return; + } + + console.log(response.to_json_string()); + resolve(response) + }); + }) +} diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-shadow-query/package.json b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-shadow-query/package.json new file mode 100644 index 00000000..f346ef44 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/iothub-shadow-query/package.json @@ -0,0 +1,15 @@ +{ + "name": "iotexplorer", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "tencentcloud-sdk-nodejs": "^3.0.77", + "wx-server-sdk": "latest" + } +} diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/package-lock.json b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/package-lock.json new file mode 100644 index 00000000..9113190b --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/cloudfunctions/package-lock.json @@ -0,0 +1,549 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@cloudbase/database": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/@cloudbase/database/download/@cloudbase/database-0.1.1.tgz", + "integrity": "sha1-yf/JK3HhkAVxljkL6odpZ3f/l/8=", + "requires": { + "bson": "^4.0.2" + } + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/@protobufjs/aspromise/download/@protobufjs/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/@protobufjs/base64/download/@protobufjs/base64-1.1.2.tgz", + "integrity": "sha1-TIVzDlm5ofHzSQR9vyQpYDS7JzU=" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npm.taobao.org/@protobufjs/codegen/download/@protobufjs/codegen-2.0.4.tgz", + "integrity": "sha1-fvN/DQEPsCitGtWXIuUG2SYoFcs=" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/@protobufjs/eventemitter/download/@protobufjs/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/@protobufjs/fetch/download/@protobufjs/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/@protobufjs/float/download/@protobufjs/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/@protobufjs/inquire/download/@protobufjs/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/@protobufjs/path/download/@protobufjs/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/@protobufjs/pool/download/@protobufjs/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/@protobufjs/utf8/download/@protobufjs/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/@types/long/download/@types/long-4.0.0.tgz", + "integrity": "sha1-cZVR0jUtMBrIuB23Mqy2vcKNve8=" + }, + "@types/node": { + "version": "10.14.13", + "resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-10.14.13.tgz?cache=0&sync_timestamp=1563391049881&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-10.14.13.tgz", + "integrity": "sha1-rHhtYjhgrfOaP1HWKUgKrNam7sc=" + }, + "ajv": { + "version": "6.10.2", + "resolved": "http://mirrors.cloud.tencent.com/npm/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "http://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz", + "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "http://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "http://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "http://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.8.0", + "resolved": "http://registry.npm.taobao.org/aws4/download/aws4-1.8.0.tgz", + "integrity": "sha1-8OAD2cqef1nHpQiUXXsu+aBKVC8=" + }, + "base64-js": { + "version": "1.3.0", + "resolved": "http://registry.npm.taobao.org/base64-js/download/base64-js-1.3.0.tgz", + "integrity": "sha1-yrHmEY8FEJXli1KBrqjBzSK/wOM=" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "http://mirrors.cloud.tencent.com/npm/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bson": { + "version": "4.0.2", + "resolved": "https://registry.npm.taobao.org/bson/download/bson-4.0.2.tgz", + "integrity": "sha1-KSn9/tGhRbHDYZCKK5UKbPS+0sI=", + "requires": { + "buffer": "^5.1.0", + "long": "^4.0.0" + } + }, + "buffer": { + "version": "5.2.1", + "resolved": "http://registry.npm.taobao.org/buffer/download/buffer-5.2.1.tgz", + "integrity": "sha1-3Vf6DxCaxZxgJHkETcp7iz0LcdY=", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "http://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz", + "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "http://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "http://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "http://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "http://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "http://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz", + "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "http://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-2.0.1.tgz?cache=0&sync_timestamp=1562517919182&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-deep-equal%2Fdownload%2Ffast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "http://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "http://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz?cache=0&sync_timestamp=1562216133657&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fform-data%2Fdownload%2Fform-data-2.3.3.tgz", + "integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "http://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=" + }, + "getpass": { + "version": "0.1.7", + "resolved": "http://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "http://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.3", + "resolved": "http://mirrors.cloud.tencent.com/npm/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "http://registry.npm.taobao.org/has/download/has-1.0.3.tgz", + "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=", + "requires": { + "function-bind": "^1.1.1" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "http://mirrors.cloud.tencent.com/npm/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "http://registry.npm.taobao.org/ieee754/download/ieee754-1.1.13.tgz", + "integrity": "sha1-7BaFWOlaoYH9h9N/VcMrvLZwi4Q=" + }, + "is-regex": { + "version": "1.0.4", + "resolved": "http://registry.npm.taobao.org/is-regex/download/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "requires": { + "has": "^1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "http://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "http://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "http://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "http://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "http://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz", + "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "http://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "http://mirrors.cloud.tencent.com/npm/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npm.taobao.org/lodash.merge/download/lodash.merge-4.6.2.tgz", + "integrity": "sha1-VYqlO0O2YeGSWgr9+japoQhf5Xo=" + }, + "long": { + "version": "4.0.0", + "resolved": "http://registry.npm.taobao.org/long/download/long-4.0.0.tgz", + "integrity": "sha1-mntxz7fTYaGU6lVSQckvdGjVvyg=" + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.40.0.tgz", + "integrity": "sha1-plBX6ZjbCQ9zKmj2wnbTh9QSbDI=" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.24.tgz", + "integrity": "sha1-tvjQs+lR77d97eyhlM/20W9nb4E=", + "requires": { + "mime-db": "1.40.0" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "http://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz", + "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "http://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "protobufjs": { + "version": "6.8.8", + "resolved": "http://mirrors.cloud.tencent.com/npm/protobufjs/-/protobufjs-6.8.8.tgz", + "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + } + }, + "psl": { + "version": "1.2.0", + "resolved": "http://mirrors.cloud.tencent.com/npm/psl/-/psl-1.2.0.tgz", + "integrity": "sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "http://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz", + "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=" + }, + "qs": { + "version": "6.5.2", + "resolved": "http://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz", + "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=" + }, + "request": { + "version": "2.88.0", + "resolved": "http://mirrors.cloud.tencent.com/npm/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.0.tgz", + "integrity": "sha1-t02uxJsRSPiMZLaNSbHoFcHy9Rk=" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "http://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz", + "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=" + }, + "sax": { + "version": "1.2.4", + "resolved": "http://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz", + "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=" + }, + "sshpk": { + "version": "1.16.1", + "resolved": "http://mirrors.cloud.tencent.com/npm/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "tcb-admin-node": { + "version": "1.9.0", + "resolved": "http://mirrors.cloud.tencent.com/npm/tcb-admin-node/-/tcb-admin-node-1.9.0.tgz", + "integrity": "sha512-TYoBo66CEIIw1QzgK4Jq43G45zvBE6ZB35LbDV8wwLQvg6CiZHlmOTVZkgj2YZ8O87ELi+ZE3UBVNZM3nFa6lQ==", + "requires": { + "@cloudbase/database": "0.1.1", + "is-regex": "^1.0.4", + "lodash.merge": "^4.6.1", + "request": "^2.87.0", + "xml2js": "^0.4.19" + } + }, + "tencentcloud-sdk-nodejs": { + "version": "3.0.77", + "resolved": "http://mirrors.cloud.tencent.com/npm/tencentcloud-sdk-nodejs/-/tencentcloud-sdk-nodejs-3.0.77.tgz", + "integrity": "sha512-DULk7IFdR8BQnvC1iRuj+GrYnuU72Lj3oyIO1U2pubf71GtN9PeZ/9km2T7lsCeySU/J6jCTvwVPZaIhip/H1g==", + "requires": { + "request": "^2.85.0" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "http://mirrors.cloud.tencent.com/npm/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "http://mirrors.cloud.tencent.com/npm/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + } + } + }, + "tslib": { + "version": "1.10.0", + "resolved": "http://mirrors.cloud.tencent.com/npm/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "http://mirrors.cloud.tencent.com/npm/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "http://mirrors.cloud.tencent.com/npm/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "uri-js": { + "version": "4.2.2", + "resolved": "http://mirrors.cloud.tencent.com/npm/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "uuid": { + "version": "3.3.2", + "resolved": "http://mirrors.cloud.tencent.com/npm/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "verror": { + "version": "1.10.0", + "resolved": "http://mirrors.cloud.tencent.com/npm/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "wx-server-sdk": { + "version": "0.8.1", + "resolved": "http://mirrors.cloud.tencent.com/npm/wx-server-sdk/-/wx-server-sdk-0.8.1.tgz", + "integrity": "sha512-mE7O3E7GtRhqk1ukWw2+NiykaO5DaJYiMFCeHrwvekYTVL5Z2nFXnSrUx6nPg/vZ7LWWQbCgQlGOygBjj2+hkQ==", + "requires": { + "protobufjs": "6.8.8", + "tcb-admin-node": "1.9.0", + "tslib": "^1.9.3" + } + }, + "xml2js": { + "version": "0.4.19", + "resolved": "http://mirrors.cloud.tencent.com/npm/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~9.0.1" + } + }, + "xmlbuilder": { + "version": "9.0.7", + "resolved": "http://mirrors.cloud.tencent.com/npm/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" + } + } +} diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/app.js b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/app.js new file mode 100644 index 00000000..0e2f6c14 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/app.js @@ -0,0 +1,22 @@ +//app.js +App({ + globalData: { + // 腾讯云物联网通信平台中获取 产品ID和设备名称 + productId: "U1BZWHF7F9", // 产品ID + deviceName: "dev_01", // 设备名称 + }, + onLaunch: function () { + if (!wx.cloud) { + console.error('请使用 2.2.3 或以上的基础库以使用云能力') + } else { + wx.cloud.init({ + // env 参数说明: + // env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源 + // 此处请填入环境 ID, 环境 ID 可打开云控制台查看 + // 如不填则使用默认环境(第一个创建的环境) + env: "tos-demo", + traceUser: true, + }) + } + } +}) diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/app.json b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/app.json new file mode 100644 index 00000000..07cd9e56 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/app.json @@ -0,0 +1,13 @@ +{ + "pages": [ + "pages/index/index" + ], + "window": { + "backgroundColor": "#F6F6F6", + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#F6F6F6", + "navigationBarTitleText": "智慧农业Demo", + "navigationBarTextStyle": "black" + }, + "sitemapLocation": "sitemap.json" +} \ No newline at end of file diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/app.wxss b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/app.wxss new file mode 100644 index 00000000..82678d67 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/app.wxss @@ -0,0 +1,156 @@ +/**app.wxss**/ +.container { + display: flex; + flex-direction: column; + align-items: center; + box-sizing: border-box; +} + +button { + background: initial; +} + +button:focus{ + outline: 0; +} + +button::after{ + border: none; +} + + +page { + background: #f6f6f6; + display: flex; + flex-direction: column; + justify-content: flex-start; +} + +.userinfo, .uploader, .tunnel { + margin-top: 40rpx; + height: 140rpx; + width: 100%; + background: #fff; + border: 1px solid rgba(0, 0, 0, 0.1); + border-left: none; + border-right: none; + display: flex; + flex-direction: row; + align-items: center; + transition: all 300ms ease; +} + +.userinfo-avatar { + width: 100rpx; + height: 100rpx; + margin: 20rpx; + border-radius: 50%; + background-size: cover; + background-color: white; +} + +.userinfo-avatar:after { + border: none; +} + +.userinfo-nickname { + font-size: 32rpx; + color: #007aff; + background-color: white; + background-size: cover; +} + +.userinfo-nickname::after { + border: none; +} + +.uploader, .tunnel { + height: auto; + padding: 0 0 0 40rpx; + flex-direction: column; + align-items: flex-start; + box-sizing: border-box; +} + +.uploader-text, .tunnel-text { + width: 100%; + line-height: 52px; + font-size: 34rpx; + color: #007aff; +} + +.uploader-container { + width: 100%; + height: 400rpx; + padding: 20rpx 20rpx 20rpx 0; + display: flex; + align-content: center; + justify-content: center; + box-sizing: border-box; + border-top: 1px solid rgba(0, 0, 0, 0.1); +} + +.uploader-image { + width: 100%; + height: 360rpx; +} + +.tunnel { + padding: 0 0 0 40rpx; +} + +.tunnel-text { + position: relative; + color: #222; + display: flex; + flex-direction: row; + align-content: center; + justify-content: space-between; + box-sizing: border-box; + border-top: 1px solid rgba(0, 0, 0, 0.1); +} + +.tunnel-text:first-child { + border-top: none; +} + +.tunnel-switch { + position: absolute; + right: 20rpx; + top: -2rpx; +} + +.disable { + color: #888; +} + +.service { + position: fixed; + right: 40rpx; + bottom: 40rpx; + width: 140rpx; + height: 140rpx; + border-radius: 50%; + background: linear-gradient(#007aff, #0063ce); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); + display: flex; + align-content: center; + justify-content: center; + transition: all 300ms ease; +} + +.service-button { + position: absolute; + top: 40rpx; +} + +.service:active { + box-shadow: none; +} + +.request-text { + padding: 20rpx 0; + font-size: 24rpx; + line-height: 36rpx; + word-break: break-all; +} diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/TencentOS_tiny_log.png b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/TencentOS_tiny_log.png new file mode 100644 index 00000000..54f21405 Binary files /dev/null and b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/TencentOS_tiny_log.png differ diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/farm.png b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/farm.png new file mode 100644 index 00000000..9aa88969 Binary files /dev/null and b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/farm.png differ diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/led.png b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/led.png new file mode 100644 index 00000000..28e5314b Binary files /dev/null and b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/images/led.png differ diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.js b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.js new file mode 100644 index 00000000..d4c48f78 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.js @@ -0,0 +1,90 @@ +const app = getApp() + +Page({ + data: { + productId: app.globalData.productId, + deviceName: app.globalData.deviceName, + stateReported: {}, + }, + onLoad: function (options) { + console.log("index onLoad") + if (!app.globalData.productId) { + wx.showToast({ + title: "产品ID不能为空", + icon: 'none', + duration: 3000 + }) + return + } else if (!app.globalData.deviceName) { + wx.showToast({ + title: "设备名称不能为空", + icon: 'none', + duration: 3000 + }) + return + } + this.update() + }, + update() { + wx.showLoading() + wx.cloud.callFunction({ + name: 'iothub-shadow-query', + data: { + productId: app.globalData.productId, + deviceName: app.globalData.deviceName, + }, + success: res => { + wx.showToast({ + title: '调用成功', + }) + let deviceData = JSON.parse(res.result.Data) + this.setData({ + stateReported: deviceData.payload.state.reported + }) + console.log("result:", deviceData) + }, + fail: err => { + wx.showToast({ + icon: 'none', + title: '调用失败', + }) + console.error('[云函数] [iotexplorer] 调用失败:', err) + } + }) + }, + switchChange(e) { + let value = 0 + if (e.detail.value == true) { + value = 1 + } + let item = e.currentTarget.dataset.item + let obj = { + [`${item}`]: value + } + let payload = JSON.stringify(obj) + console.log(payload) + wx.showLoading() + wx.cloud.callFunction({ + name: 'iothub-publish', + data: { + ProductId: app.globalData.productId, + DeviceName: app.globalData.deviceName, + Topic: "", + Payload: payload, + }, + success: res => { + wx.showToast({ + title: '调用成功', + }) + console.log("res:", res) + }, + fail: err => { + wx.showToast({ + icon: 'none', + title: '调用失败', + }) + console.error('[云函数] [iotexplorer] 调用失败:', err) + } + }) + }, +}) \ No newline at end of file diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.json b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.wxml b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.wxml new file mode 100644 index 00000000..b7e2eb77 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.wxml @@ -0,0 +1,65 @@ + + + + + + + 设备信息 + + + + 产品ID + {{productId}} + + + 设备名称 + {{deviceName}} + + + + \n + +
    + + + 农业Demo + + + + + + + + 照明 + + + + + + 风扇 + + + + + + 温度 + + {{stateReported.temperature}} + + + + + 湿度 + + {{stateReported.humidity}} + + % + + + 光照强度 + {{stateReported.light_intensity}} + lux + + +
    +
    \ No newline at end of file diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.wxss b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.wxss new file mode 100644 index 00000000..0cae550d --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/pages/index/index.wxss @@ -0,0 +1,31 @@ +.body { + margin: 10rpx 20rpx; +} + +.box { + padding: 0rpx 20rpx; + border-top: 2px solid #000; +} + +.cell { + margin-top: 10rpx; + margin-bottom: 40rpx; + display: flex; + justify-content: space-between; + align-items: center; +} + +.left { + width: 50%; + text-align: left; +} + +.right { + width: 40%; + text-align: right; +} + +.unit { + width: 10%; + text-align: right; +} diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/sitemap.json b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/sitemap.json new file mode 100644 index 00000000..ca02add2 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/miniprogram/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/project.config.json b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/project.config.json new file mode 100644 index 00000000..f80ad225 --- /dev/null +++ b/tools/Mini_Program/qcloud_iothub_mp_cloudfunctions_farmai/project.config.json @@ -0,0 +1,47 @@ +{ + "miniprogramRoot": "miniprogram/", + "cloudfunctionRoot": "cloudfunctions/", + "setting": { + "urlCheck": false, + "es6": true, + "postcss": true, + "minified": true, + "newFeature": true, + "autoAudits": false, + "checkInvalidKey": true, + "checkSiteMap": true, + "uploadWithSourceMap": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "nodeModules": true + }, + "appid": "wx394efa031612f9b5", + "projectname": "qcloud_iothub_mp_cloudfunctions_farmai", + "libVersion": "2.7.7", + "simulatorType": "wechat", + "simulatorPluginLibVersion": {}, + "cloudfunctionTemplateRoot": "cloudfunctionTemplate", + "condition": { + "search": { + "current": -1, + "list": [] + }, + "conversation": { + "current": -1, + "list": [] + }, + "plugin": { + "current": -1, + "list": [] + }, + "game": { + "list": [] + }, + "miniprogram": { + "current": 0 + } + } +} \ No newline at end of file