Skip to content

Commit

Permalink
code synchronization at 2017-12-16@23:48
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng-SG committed Dec 16, 2017
1 parent 2318dd4 commit 22d56cd
Show file tree
Hide file tree
Showing 5,117 changed files with 1,937,562 additions and 16,794 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ si
.project
*.pyc
aos_partition_*.bin
OSX
example/flash/flash.mk
example/flash/main.c
example/flash/README.md
settings.json
12 changes: 12 additions & 0 deletions .vscode/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
{
"text": "source .gdbinit"
},
{
"text": "source .gdbinitkernel",
"ignoreFailures": true
},
{
"text": "source .gdbinitframework",
"ignoreFailures": true
},
{
"text": "source .gdbinitapp",
"ignoreFailures": true
},
{
"text": "target remote localhost:3333"
},
Expand Down
129 changes: 67 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,103 @@
# AliOS Things

[![Join the chat at https://gitter.im/aliosthings/Lobby](https://badges.gitter.im/aliosthings/Lobby.svg)](https://gitter.im/aliosthings/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

AliOS Things 是 AliOS 家族旗下的、面向 IoT 领域的、轻量级物联网嵌入式操作系统。 AliOS Things 将致力于搭建云端一体化 IoT 基础设施,具备极致性能、极简开发、云端一体、丰富组件、安全防护等关键能力,并支持终端设备连接到阿里云 Link,可广泛应用在智能家居、智慧城市、新出行等领域。

## AliOS Things 特性
(中文描述在最后)

**极简开发**
AliOS Things is Alibaba's IoT version of AliOS Family, it's announced in [The Computing Conference](https://yunqi.aliyun.com) 2017 Hangzhou by Alibaba Cloud, and open sourced in 2017/10/20.

- 基于Linux平台,提供MCU虚拟化环境,开发者直接在Linux平台上开发硬件无关的IoT应用和软件库,使用GDB/Valgrind/SystemTap 等PC平台工具诊断开发问题
- 提供IDE,支持系统/内核行为Trace、Mesh组网图形化显示
- 提供Shell交互,支持内存踩踏、泄露、最大栈深度等各类侦测
- 提供面向组件的编译系统以及Cube工具,支持灵活组合IoT产品软件栈
- 提供包括存储(掉电保护、负载均衡)在内的各类产品级别的组件

**即插即用的连接和丰富服务**
AliOS Things is designed for low power, resource constrained MCU, connectivity SoC, greatly suitable for IoT devices. AliOS Things is not just a RTOS, it contains full stack of software components and tools for building IoT devices.

- 支持umesh即插即用网络技术,设备上电自动连网
- 通过Alink与阿里云计算IoT服务无缝连接
# Architecture Overview

**细颗粒度的FOTA更新**
From architectural point of view, AliOS Things adapts Layered Architecture, and Component Architecture. From bottom to top, AliOS Things includes:

- 支持应用代码独立编译映像,IoT App独立极小映像升级
- 支持映像高度压缩
- BSP: Board Support Package mainly developed and maintained by SoC Vendor
- HAL: Hardware Abstraction Layer, like WiFi, UART
- Kernel: Rhino RTOS Kernel, Yloop, VFS, KV Storage included
- Protocol Stack: LwIP TCPIP Stack, uMesh mesh networking stack included
- Security: TLS, TFS(Trusted Framework Service), TEE(Trusted Exexcution Environment)
- AOS API: AliOS Things exposed APIs for Application and Middleware
- Middleware: Alibaba's value-added and commonly seen IoT components included
- Examples: hands-on sample codes, and well tested industry applications such as Alinkapp

**彻底全面的安全保护**

- 提供系统和芯片级别安全保护
- 支持可信运行环境(支持ARMV8-M Trust Zone)
- 支持预置ID2根身份证和非对称密钥以及基于ID2的可信连接和服务
And all of the modules are organized as Component, each component has its own .mk file to describe its dependecy with other Components, which make it easy for applications to choose the components needed.

**高度优化的性能**

- 内核支持Idle Task成本,Ram<1K,Rom<2k,提供硬实时能力
- 提供YLOOP事件框架以及基于此整合的核心组件,避免栈空间消耗,核心架构良好支持极小FootPrint的设备
# Documentation

**解决IoT实际问题的特性演进**

- 更好的云端一体融合优化,更简单的开发体验,更安全,更优整体性能和算法支持,更多的特性演进,我们在路上
  Stay Hungry,Stay Foolish!
AliOS Things' documentation are mainly hosted at [Github Wiki](https://github.com/alibaba/AliOS-Things/wiki).

-----
### Quick Start by Command Line using Ubuntu Machine

# 文档
```shell
$ pip install aos-cube
$ git clone https://github.com/alibaba/AliOS-Things.git
$ cd AliOS-Things
$ aos make helloworld@linuxhost
$ ./out/helloworld@linuxhost/binary/[email protected]
```

* [Coding Style Guide](https://github.com/alibaba/AliOS-Things/wiki/AliOS-Things-Coding-Style-Guide)
Quick Start by IDE(supporting Windows/MAC/Linux)

* [Porting Guide](https://github.com/alibaba/AliOS-Things/wiki/AliOS-Things-Porting-Guide)
Please refer to [AliOS Things Application Develop Guide](https://github.com/alibaba/AliOS-Things/wiki/AliOS-Things-APP-DEV-Guide).

* [API Guide](https://github.com/alibaba/AliOS-Things/wiki/AliOS-Things-API-Guide)
# Community

* [Application Development Guide](https://github.com/alibaba/AliOS-Things/wiki/AliOS-Things-APP-DEV-Guide)
* [Technical Blog | 云栖社区](https://yq.aliyun.com/teams/184)
* [Technical Forum | 开发者论坛](https://bbs.aliyun.com/thread/410.html)

* [AliOS Studio](https://github.com/alibaba/AliOS-Things/wiki/AliOS-Things-Studio)
# License

-----
AliOS Things is released under the Apache 2.0 license.

# 社区
Copyright 2015-2017 Alibaba Group Holding Ltd.

* [云栖社区](https://yq.aliyun.com/teams/184)
* [开发者论坛](https://bbs.aliyun.com/thread/410.html?spm=5176.bbsl394.0.0.LygX9J)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at following link.

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

------

# 下载
## AliOS Things概述

* [VS Code](https://code.visualstudio.com)
AliOS Things 是 AliOS 家族旗下的、面向 IoT 领域的、轻量级物联网嵌入式操作系统。 AliOS Things 将致力于搭建云端一体化 IoT 基础设施,具备极致性能、极简开发、云端一体、丰富组件、安全防护等关键能力,并支持终端设备连接到阿里云 Link,可广泛应用在智能家居、智慧城市、新出行等领域。

* [Python](https://www.python.org/downloads/)
**极简开发**

* [GCC](https://launchpad.net/gcc-arm-embedded/+download)
- 基于Linux平台,提供MCU虚拟化环境,开发者直接在Linux平台上开发硬件无关的IoT应用和软件库,使用GDB/Valgrind/SystemTap 等PC平台工具诊断开发问题
- 提供IDE,支持系统/内核行为Trace、Mesh组网图形化显示
- 提供Shell交互,支持内存踩踏、泄露、最大栈深度等各类侦测
- 提供面向组件的编译系统以及Cube工具,支持灵活组合IoT产品软件栈
- 提供包括存储(掉电保护、负载均衡)在内的各类产品级别的组件

* [FTDI: UART driver](http://www.ftdichip.com/Drivers/D2XX.htm)
**即插即用的连接和丰富服务**

* [STLink](http://www.st.com/content/st_com/en/products/development-tools/hardware-development-tools/development-tool-hardware-for-mcus/debug-hardware-for-mcus/debug-hardware-for-stm32-mcus/st-link-v2.html)
- 支持umesh即插即用网络技术,设备上电自动连网
- 通过Alink与阿里云计算IoT服务无缝连接

* [CP2012 driver](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)
**细颗粒度的FOTA更新**

------
- 支持应用代码独立编译映像,IoT App独立极小映像升级
- 支持映像高度压缩

# License
**彻底全面的安全保护**

AliOS Things is released under the Apache 2.0 license.
- 提供系统和芯片级别安全保护
- 支持可信运行环境(支持ARMV8-M Trust Zone)
- 支持预置ID2根身份证和非对称密钥以及基于ID2的可信连接和服务

Copyright 2015-2017 Alibaba Group Holding Ltd.
**高度优化的性能**

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at following link.
- 内核支持Idle Task成本,Ram<1K,Rom<2k,提供硬实时能力
- 提供YLOOP事件框架以及基于此整合的核心组件,避免栈空间消耗,核心架构良好支持极小FootPrint的设备

http://www.apache.org/licenses/LICENSE-2.0
**解决IoT实际问题的特性演进**

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- 更好的云端一体融合优化,更简单的开发体验,更安全,更优整体性能和算法支持,更多的特性演进,我们在路上
Stay Hungry,Stay Foolish!
42 changes: 42 additions & 0 deletions board/b_l475e/atcmd_config_platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
*/

#ifndef _ATCMD_DEFINES_MK3060_H_
#define _ATCMD_DEFINES_MK3060_H_

#include <hal/soc/uart.h>

/**
* AT related platform-dependent things are here, including:
* 1. AT command;
* 2. AT response code;
* 3. AT delimiter;
* 4. AT event;
* 5. Uart port used by AT;
* 6. ...
*/

// AT command
#define AT_CMD_ENET_SEND "AT+ENETRAWSEND"
#define AT_CMD_ENTER_ENET_MODE "AT+ENETRAWMODE=ON"
#define AT_CMD_EHCO_OFF "AT+UARTE=OFF"
#define AT_CMD_TEST "AT"

// Delimiter
#define AT_RECV_DELIMITER "\r\n"
#define AT_SEND_DELIMITER "\r"

// AT event
#define AT_EVENT_ENET_DATA "+ENETEVENT:"

// AT uart
#define AT_UART_PORT 1
#define AT_UART_BAUDRATE 921600
#define AT_UART_DATA_WIDTH DATA_WIDTH_8BIT
#define AT_UART_PARITY NO_PARITY
#define AT_UART_STOP_BITS STOP_BITS_1
#define AT_UART_FLOW_CONTROL FLOW_CONTROL_DISABLED
#define AT_UART_LINUX_DEV "/dev/ttyUSB1" // required by linuxhost

#endif
15 changes: 13 additions & 2 deletions board/b_l475e/b_l475e.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ JTAG := stlink-v2-1
$(NAME)_TYPE := kernel
MODULE := 1062
HOST_ARCH := Cortex-M4
HOST_MCU_FAMILY := stm32l4xx
HOST_MCU_FAMILY := stm32l475
SUPPORT_BINS := no

$(NAME)_SOURCES := board.c osa_flash.c

GLOBAL_INCLUDES += .
GLOBAL_DEFINES += STDIO_UART=0 CONFIG_NO_TCPIP
GLOBAL_DEFINES += RHINO_CONFIG_TICK_TASK=0 RHINO_CONFIG_WORKQUEUE=0

ifeq ($(sal),1)
GLOBAL_DEFINES += RHINO_CONFIG_WORKQUEUE=1
endif

CONFIG_SYSINFO_PRODUCT_MODEL := ALI_AOS_B-L475E
CONFIG_SYSINFO_DEVICE_NAME := B-L475E

Expand All @@ -25,11 +30,17 @@ GLOBAL_LDFLAGS += -L $(SOURCE_ROOT)/board/b_l475e
# Global defines
# HSE_VALUE = STM32 crystal frequency = 26MHz (needed to make UART work correctly)
GLOBAL_DEFINES += $$(if $$(NO_CRLF_STDIO_REPLACEMENT),,CRLF_STDIO_REPLACEMENT)
GLOBAL_CFLAGS += -DSTM32L475xx -mcpu=cortex-m4 -mthumb -mfloat-abi=soft
GLOBAL_CFLAGS += -DSTM32L475xx

WIFI_FIRMWARE_SECTOR_START := 2 #0x2000
FILESYSTEM_IMAGE_SECTOR_START := 256 #0x100000

# Extra build target in mico_standard_targets.mk, include bootloader, and copy output file to eclipse debug file (copy_output_for_eclipse)
EXTRA_TARGET_MAKEFILES += $(MAKEFILES_PATH)/aos_standard_targets.mk
#EXTRA_TARGET_MAKEFILES += $(SOURCE_ROOT)/platform/mcu/$(HOST_MCU_FAMILY)/gen_crc_bin.mk

# Define default component testcase set
ifeq (, $(findstring yts, $(BUILD_STRING)))
GLOBAL_DEFINES += RHINO_CONFIG_WORKQUEUE=1
TEST_COMPONENTS += basic api wifi_hal rhino vcall kv yloop alicrypto cjson digest_algorithm hashtable
endif
87 changes: 36 additions & 51 deletions board/b_l475e/board.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,43 @@
#include <aos/kernel.h>

/* Logic partition on flash devices */
const hal_logic_partition_t hal_partitions[] =
{
[HAL_PARTITION_APPLICATION] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "Application",
.partition_start_addr = 0x08000000,
.partition_length = 0x7D000, //500k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_1] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER1",
.partition_start_addr = 0x0807D000,
.partition_length = 0x1000, // 4k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_2] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER2",
.partition_start_addr = 0x0807E000,
.partition_length = 0x1000, //4k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_OTA_TEMP] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "OTA Storage",
.partition_start_addr = 0x08080000,
.partition_length = 0x7D000, //500k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_3] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER3",
.partition_start_addr = 0x080FD000,
.partition_length = 0x1000, //4k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_4] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER4",
.partition_start_addr = 0x080FF000,
.partition_length = 0x1000, //4k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
};
hal_logic_partition_t hal_partitions[HAL_PARTITION_MAX];

void board_init(void)
{
hal_partitions[HAL_PARTITION_APPLICATION].partition_owner = HAL_FLASH_EMBEDDED;
hal_partitions[HAL_PARTITION_APPLICATION].partition_description = "Application";
hal_partitions[HAL_PARTITION_APPLICATION].partition_start_addr = 0x08000000;
hal_partitions[HAL_PARTITION_APPLICATION].partition_length = 0x7D000; //500k bytes
hal_partitions[HAL_PARTITION_APPLICATION].partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN;

hal_partitions[HAL_PARTITION_PARAMETER_1].partition_owner = HAL_FLASH_EMBEDDED;
hal_partitions[HAL_PARTITION_PARAMETER_1].partition_description = "PARAMETER1";
hal_partitions[HAL_PARTITION_PARAMETER_1].partition_start_addr = 0x0807D000;
hal_partitions[HAL_PARTITION_PARAMETER_1].partition_length = 0x1000; // 4k bytes
hal_partitions[HAL_PARTITION_PARAMETER_1].partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN;

hal_partitions[HAL_PARTITION_PARAMETER_2].partition_owner = HAL_FLASH_EMBEDDED;
hal_partitions[HAL_PARTITION_PARAMETER_2].partition_description = "PARAMETER2";
hal_partitions[HAL_PARTITION_PARAMETER_2].partition_start_addr = 0x0807E000;
hal_partitions[HAL_PARTITION_PARAMETER_2].partition_length = 0x1000; //4k bytes
hal_partitions[HAL_PARTITION_PARAMETER_2].partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN;

hal_partitions[HAL_PARTITION_OTA_TEMP].partition_owner = HAL_FLASH_EMBEDDED;
hal_partitions[HAL_PARTITION_OTA_TEMP].partition_description = "OTA Storage";
hal_partitions[HAL_PARTITION_OTA_TEMP].partition_start_addr = 0x08080000;
hal_partitions[HAL_PARTITION_OTA_TEMP].partition_length = 0x7D000; //500k bytes
hal_partitions[HAL_PARTITION_OTA_TEMP].partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN;

hal_partitions[HAL_PARTITION_PARAMETER_3].partition_owner = HAL_FLASH_EMBEDDED;
hal_partitions[HAL_PARTITION_PARAMETER_3].partition_description = "PARAMETER3";
hal_partitions[HAL_PARTITION_PARAMETER_3].partition_start_addr = 0x080FD000;
hal_partitions[HAL_PARTITION_PARAMETER_3].partition_length = 0x1000; //4k bytes
hal_partitions[HAL_PARTITION_PARAMETER_3].partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN;

hal_partitions[HAL_PARTITION_PARAMETER_4].partition_owner = HAL_FLASH_EMBEDDED;
hal_partitions[HAL_PARTITION_PARAMETER_4].partition_description = "PARAMETER4";
hal_partitions[HAL_PARTITION_PARAMETER_4].partition_start_addr = 0x080FE000;
hal_partitions[HAL_PARTITION_PARAMETER_4].partition_length = 0x1000; //4k bytes
hal_partitions[HAL_PARTITION_PARAMETER_4].partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN;
}
2 changes: 1 addition & 1 deletion board/b_l475e/k_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#define RHINO_CONFIG_GCC_RETADDR 1
#endif
#ifndef RHINO_CONFIG_MM_LEAKCHECK
#define RHINO_CONFIG_MM_LEAKCHECK 1
#define RHINO_CONFIG_MM_LEAKCHECK 0
#endif
#ifndef RHINO_CONFIG_RINGBUF_VENDOR
#define RHINO_CONFIG_RINGBUF_VENDOR 0
Expand Down
9 changes: 9 additions & 0 deletions board/eml3047/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "hal/soc/soc.h"
#include <aos/kernel.h>

/* Logic partition on flash devices */
hal_logic_partition_t hal_partitions[HAL_PARTITION_MAX];

void board_init(void)
{
}
Loading

0 comments on commit 22d56cd

Please sign in to comment.