SimonLiu的ESP8266与AliOS Things 学习教程系列之十一:AliOS Things 2.1.0之新建(自定义)项目

欢迎加入交流群: ESP8266 AliOS Things 群 号: 107723112
系列文章目录:
SimonLiu的ESP8266与AliOS Things 学习教程系列目录

AliOS Things 2.1.0编译自己项目的方法,和原来2.0.0不一样了。在2.0.0里面,只需要放入example文件夹就能编译了,在2.1.0里面需要编辑config.in文件。下面就以blink为基础,跟我一步步在AliOS Things 2.1.0中新建项目。
Note:部分example项目还有个ucube.py,这是scons文件,使用makefile编译不需要理会这个文件。

1. 复制linkkitapp 文件夹

app/example/blink 文件夹复制到app中,并改名为myapp1,目录结构为app/myapp1

2. 编辑app/config.in文件

编辑后内容如下:

config AOS_APP_LOCALAPP
    bool "Local Applications"

if AOS_APP_LOCALAPP
 choice
     prompt "Select application"
 source "app/myapp1/Config.in"
 if AOS_APP_MYAPP1
     config AOS_BUILD_APP
         default "myapp1"
 endif

 endchoice

3. 编辑app/myapp1/config.in文件

大写的BLINK,全部替换为大写的MYAPP1
小写的blink,全部替换为小写的myapp1
bool "Blink Sample"改为 bool "Myapp1 Sample"

4. 编辑app/myapp1/aos.mk文件

NAME := blink改为NAME := myapp1
$(NAME)_SUMMARY := blink改为$(NAME)_SUMMARY := myapp1 sample based on blink

5. aos make menuconfig

aos make menuconfig -Application Configuration-Select Application选择Local Application,列表中出现了MYAPP1 Sample
SimonLiu的ESP8266与AliOS Things 学习教程系列之十一:AliOS Things 2.1.0之新建(自定义)项目_第1张图片
然后BSP Configuration中选择ESP8266
SimonLiu的ESP8266与AliOS Things 学习教程系列之十一:AliOS Things 2.1.0之新建(自定义)项目_第2张图片
连按ESC若干次保存退出

6. 编译

运行aos make即可编译myapp1

aos-cube version: 0.3.1
Check if required tools for esp8266 exist
Parsing all components ...

Build Configuration:
====================
App: myapp1
Board: esp8266
====================
Making out/myapp1@esp8266/libraries/ota.a
Making myapp1@esp8266.elf

Making myapp1@esp8266.bin
Making myapp1@esp8266.hex
...
                        AOS MEMORY MAP
|=================================================================|
| MODULE                                   | ROM       | RAM      |
|=================================================================|
| arch_xtensa_lx106                        | 4064      | 2784     |
| board_esp8266                            | 1315      | 0        |
| cli                                      | 6646      | 353      |
| debug                                    | 3561      | 16       |
| kernel_init                              | 911       | 36       |
| kv                                       | 4127      | 36       |
| libcirom                                 | 28653     | 1204     |
| libcrypto                                | 14252     | 0        |
| libgcc                                   | 2190      | 0        |
| libhal                                   | 37        | 0        |
| liblwip                                  | 35910     | 2083     |
| libmain                                  | 29471     | 708      |
| libnet80211                              | 42570     | 3209     |
| libphy                                   | 48154     | 461      |
| libpp                                    | 44405     | 18005    |
| libwpa                                   | 17236     | 626      |
| mcu_esp8266                              | 10403     | 576      |
| myapp1                                   | 70        | 48       |
| netmgr                                   | 184       | 8        |
| newlib_stub                              | 363       | 0        |
| osal_aos                                 | 821       | 0        |
| ota_2nd_boot                             | 18838     | 40       |
| rhino                                    | 12124     | 6812     |
| ulog                                     | 683       | 18       |
| vfs                                      | 1341      | 1105     |
| yloop                                    | 1921      | 32       |
| *fill*                                   | 1723      | 120      |
|=================================================================|
| TOTAL (bytes)                            | 331973    | 38280    |
|=================================================================|
bin crc: 3391a331
334404
fa1286526af16f3cd28c5416fc1ede9c
Build complete: myapp1@esp8266

你可能感兴趣的:(ESP8266,AliOS,Things)