AliOS Things学习笔记(2)——Linux开发环境搭建

一、安装aos-cube

参考:Linux环境安装aos-cube
速度太慢可参考:pip国内源配置,pip速度起飞

# 安装python、pip和git
sudo apt-get install -y python python-pip git

# 安装依赖库和aos-cube
python -m pip install setuptools wheel aos-cube

# 查询版本确认是否安装成功
aos --version

二、获取AliOS Things源码

git clone https://gitee.com/alios-things/AliOS-Things.git

三、配置环境变量

# 编译环境变量文件
vim ~/.bashrc

# 文件末尾添加环境变量,指向AliOS Things源码目录,并保存退出
export AOS_SDK_PATH=~/AliOS-Things

# 使配置立即生效
source ~/.bashrc

四、编译

  • 进入AliOS-Things顶层目录编译,这里编译application/example/目录下的demo app
  • 根据编译打印的信息,生成的app固件在/out/helloworld_demo@<芯片平台>/binary/*@<芯片平台>.bin
# 进入`AliOS-Things`顶层目录
cd $AOS_SDK_PATH

# 配置
# 初次使用会显示"kconfig tools missing",并自动下载
aos make 工程名@芯片名 -c config		#例:aos make helloworld_demo@esp8266 -c config	

# 编译
# 初次编译如果没有 gcc-arm-none-eabi 编译链工具,会自动下载
aos make

初次使用aos-cube工具会显示改善用户体验需要收集一些个人信息的确认,输入’Y[es]’ or 'N[o]'都可以。

***Attention***:
==============================================================
  In order to improve the user experience of this tool,
  we want to collect some of your personal information
  including but not limited to the following items:

    (0) The Operating System and version on your computer..
    (1) the MAC and public IP address of your computer.
    (2) Your city location information.
    (3) The command line terminal used.
    (4) The most frequently used aos-cube functionalities.

  All collected information will be limited to be used in the
  user-experience improve plan, and will be carefully and
  restrictly secured.
==============================================================
Do you want to participate in the activity?
Please type 'Y[es]' or 'N[o]': 

五、LOG:

配置:

$ aos make helloworld_demo@esp8266 -c config

***Attention***:
==============================================================
  In order to improve the user experience of this tool,
  we want to collect some of your personal information
  including but not limited to the following items:

    (0) The Operating System and version on your computer..
    (1) the MAC and public IP address of your computer.
    (2) Your city location information.
    (3) The command line terminal used.
    (4) The most frequently used aos-cube functionalities.

  All collected information will be limited to be used in the
  user-experience improve plan, and will be carefully and
  restrictly secured.
==============================================================
Do you want to participate in the activity?
Please type 'Y[es]' or 'N[o]': N

aos-cube version: 0.5.11
kconfig tools missing, start download ...
https://gitee.com/alios-things/kconfig-frontends-linux.git -> .//build/kconfig/Linux64/
正克隆到 './/build/kconfig/Linux64'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 1), reused 0 (delta 0), pack-reused 0
展开对象中: 100% (7/7), 完成.
Creating .defconfig ...
Creating .config ...
platform/board/stm32f103rb-nucleo/Config.in:3:warning: defaults for choice values not supported
platform/board/esp8266/Config.in:3:warning: defaults for choice values not supported
platform/board/mk3072/Config.in:3:warning: defaults for choice values not supported
application/example/example_legacy/uai_demo/uai_kws_demo/Config.in:15:warning: defaults for choice values not supported
application/example/example_legacy/uai_demo/uai_cifar10_demo/Config.in:15:warning: defaults for choice values not supported
#
# configuration written to .config
#
Checking config output: .config ...

编译:

$ aos make

aos-cube version: 0.5.11
Check if required tools for esp8266 exist
Toolchain gcc-xtensa-lx106 missing, start download ...
https://gitee.com/alios-things/gcc-xtensa-lx106-linux.git -> /home/pjw/ESP8266/AliOS-Things/build/compiler/gcc-xtensa-lx106/Linux64
正克隆到 'gcc-xtensa-lx106'...
remote: Enumerating objects: 1108, done.
remote: Counting objects: 100% (1108/1108), done.
remote: Compressing objects: 100% (711/711), done.
remote: Total 1108 (delta 371), reused 1108 (delta 371), pack-reused 0
接收对象中: 100% (1108/1108), 25.64 MiB | 2.60 MiB/s, 完成.
处理 delta 中: 100% (371/371), 完成.
正在检出文件: 100% (1089/1089), 完成.
Download toolchain gcc-xtensa-lx106 succeed
Parsing all components ...

Build Configuration:
====================
App: helloworld_demo
Board: esp8266
====================

Creating out/config/autoconf.h ...
platform/board/stm32f103rb-nucleo/Config.in:3:warning: defaults for choice values not supported
platform/board/esp8266/Config.in:3:warning: defaults for choice values not supported
platform/board/mk3072/Config.in:3:warning: defaults for choice values not supported
application/example/example_legacy/uai_demo/uai_kws_demo/Config.in:15:warning: defaults for choice values not supported
application/example/example_legacy/uai_demo/uai_cifar10_demo/Config.in:15:warning: defaults for choice values not supported
Making config file for first time
processing components: helloworld_demo esp8266
*** All Components: helloworld_demo esp8266 osal_aos mcu_esp8266 kernel_init network rhino yloop newlib_stub lwip netmgr arch_xtensa_lx106 ulog lib_rbtree vfs kv
Build AOS Now
TOOLCHAIN_PATH=
Compiling helloworld_demo
Compiling board_esp8266
Compiling osal_aos
Compiling mcu_esp8266
platform/mcu/esp8266/hal/misc.c: In function 'hal_reboot':
platform/mcu/esp8266/hal/misc.c:32:5: warning: implicit declaration of function 'rom_i2c_writeReg' [-Wimplicit-function-declaration]
     rom_i2c_writeReg(0x67, 4, 1, 8);
     ^
platform/mcu/esp8266/hal/misc.c: In function 'hal_reboot_bank':
platform/mcu/esp8266/hal/misc.c:44:5: warning: implicit declaration of function 'ota_msleep' [-Wimplicit-function-declaration]
     ota_msleep(300);
     ^
platform/mcu/esp8266/hal/misc.c:48:9: warning: implicit declaration of function 'system_upgrade_process' [-Wimplicit-function-declaration]
         system_upgrade_process();
         ^
platform/mcu/esp8266/hal/misc.c:49:9: warning: implicit declaration of function 'system_restart_in_nmi' [-Wimplicit-function-declaration]
         system_restart_in_nmi();
         ^
platform/mcu/esp8266/hal/uart.c: In function 'hal_uart_send':
platform/mcu/esp8266/hal/uart.c:24:9: warning: implicit declaration of function 'uart0_write_char' [-Wimplicit-function-declaration]
         uart0_write_char(pdata[i]);
         ^
Compiling kernel_init
Compiling rhino
platform/mcu/esp8266/hal/wifi_port.c: In function 'register_wlan_mgnt_monitor_cb':
platform/mcu/esp8266/hal/wifi_port.c:733:9: warning: implicit declaration of function 'wifi_set_sta_rx_probe_req' [-Wimplicit-function-declaration]
         wifi_set_sta_rx_probe_req(esp_mgmt_filter);
         ^
platform/mcu/esp8266/hal/wifi_port.c: At top level:
platform/mcu/esp8266/hal/wifi_port.c:801:5: warning: initialization from incompatible pointer type [enabled by default]
     .get_wireless_info   = get_wireless_info,
     ^
platform/mcu/esp8266/hal/wifi_port.c:801:5: warning: (near initialization for 'aos_wifi_esp8266.get_wireless_info') [enabled by default]
Compiling yloop
Compiling newlib_stub
Compiling netmgr
Compiling arch_xtensa_lx106
Compiling ulog
Compiling lib_rbtree
Compiling vfs
Compiling kv
Making out/helloworld_demo@esp8266/ld/eagle.app.v6.new.1024.app1.ld
Making out/helloworld_demo@esp8266/libraries/helloworld_demo.a
Making out/helloworld_demo@esp8266/libraries/board_esp8266.a
Making out/helloworld_demo@esp8266/libraries/osal_aos.a
Making out/helloworld_demo@esp8266/libraries/mcu_esp8266.a
Making out/helloworld_demo@esp8266/libraries/kernel_init.a
Making out/helloworld_demo@esp8266/libraries/rhino.a
Making out/helloworld_demo@esp8266/libraries/yloop.a
Making out/helloworld_demo@esp8266/libraries/newlib_stub.a
Making out/helloworld_demo@esp8266/libraries/netmgr.a
Making out/helloworld_demo@esp8266/libraries/arch_xtensa_lx106.a
Making out/helloworld_demo@esp8266/libraries/ulog.a
Making out/helloworld_demo@esp8266/libraries/lib_rbtree.a
Making out/helloworld_demo@esp8266/libraries/vfs.a
Making out/helloworld_demo@esp8266/libraries/kv.a
Making [email protected]

Making [email protected]
Making [email protected]

                        AOS MEMORY MAP                            
|=================================================================|
| MODULE                                   | ROM       | RAM      |
|=================================================================|
| arch_xtensa_lx106                        | 2662      | 2784     |
| board_esp8266                            | 1214      | 44       |
| helloworld_demo                          | 166       | 12       |
| kernel_init                              | 108       | 0        |
| kv                                       | 2228      | 24       |
| libcirom                                 | 27511     | 1200     |
| libcrypto                                | 14508     | 0        |
| libgcc                                   | 2167      | 0        |
| libhal                                   | 37        | 0        |
| liblwip                                  | 30717     | 1596     |
| libmain                                  | 30412     | 708      |
| libnet80211                              | 42675     | 3213     |
| libphy                                   | 48158     | 461      |
| libpp                                    | 43992     | 18013    |
| libwpa                                   | 17240     | 626      |
| mcu_esp8266                              | 4652      | 236      |
| newlib_stub                              | 363       | 0        |
| osal_aos                                 | 706       | 0        |
| rhino                                    | 11529     | 3288     |
| ulog                                     | 573       | 7        |
| vfs                                      | 1420      | 1113     |
| yloop                                    | 1978      | 32       |
| *fill*                                   | 2010      | 108      |
|=================================================================|
| TOTAL (bytes)                            | 287026    | 33465    |
|=================================================================|
Generate standard flash images out/helloworld_demo@esp8266/binary/[email protected]
bin crc: 62e57d3f
Generate Raw OTA image: out/helloworld_demo@esp8266/binary/helloworld_demo@esp8266_ota.bin ...
Generate Compressed OTA image: out/helloworld_demo@esp8266/binary/helloworld_demo@esp8266_ota.bin.xz ...
289220
ffdf368ebd6806544ad0b90d607f2df5
193524
c6cb4ddc7358f0d8e3fe871e66f79736
Build complete: helloworld_demo@esp8266

猜你喜欢

转载自blog.csdn.net/p1279030826/article/details/113575940