SimonLiu的ESP8266與AliOS Things 學(xué)習(xí)教程系列之十一:AliOS Things 2.1.0之新建(自定義)項(xiàng)目

歡迎加入交流群:ESP8266 AliOS Things 群 號(hào): 107723112
所有教程請(qǐng)看 AliOS Things 入門(mén)教程系列
此教程在SimonLiu的CSDN博客同步更新。

AliOS Things 2.1.0編譯自己項(xiàng)目的方法,和原來(lái)2.0.0不一樣了。在2.0.0里面,只需要放入example文件夾就能編譯了,在2.1.0里面需要編輯config.in文件。下面就以blink為基礎(chǔ),跟我一步步在AliOS Things 2.1.0中新建項(xiàng)目。
Note:部分example項(xiàng)目還有個(gè)ucube.py,這是scons文件,使用makefile編譯不需要理會(huì)這個(gè)文件。

1. 復(fù)制linkkitapp 文件夾

app/example/blink 文件夾復(fù)制到app中,并改名為myapp1,目錄結(jié)構(gòu)為app/myapp1。

2. 編輯app/config.in文件

編輯后內(nèi)容如下:

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文件

大寫(xiě)的BLINK,全部替換為大寫(xiě)的MYAPP1。
小寫(xiě)的blink,全部替換為小寫(xiě)的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,列表中出現(xiàn)了MYAPP1 Sample。

在這里插入圖片描述

然后BSP Configuration中選擇ESP8266
在這里插入圖片描述

連按ESC若干次保存退出

6. 編譯

運(yùn)行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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容