--作者:燕十三(flyingcys)
-- blog:http://blog.csdn.net/flyingcys
--QQ:294102238
文件夹名称 | 内容描述 |
board | 评估板(如STM32L496G-Discovery) |
build | 编译框架 |
device | 连接MCU/SoC的外设,比如支持使用AT命令的WiFi系列模组 |
example | 代码示例,通过了完备测试的应用程序(比如Alink) |
framework | IoT 通用组件 |
include | 系统头文件 |
kernel | 包括Rhino和协议栈 |
platform | 芯片架构支持的相关文件 |
security | 包括TLS,TFS, TEE在内的安全组件 |
tools | 命令行界面(CLI)和用于建立远程设备中心的testbed工具 |
utility | IoT通用软件库,比如 cJSON |
test | UT测试用例 |
sudo apt-get install -y python gcc-multilib libssl-dev libssl-dev:i386 libncurses5-dev libncurses5-dev:i386 libreadline-dev libreadline-dev:i386 python-pip minicom
2.安装aos-cube,用python包管理器pip安装aos-cube和相关依赖包
pip install setuptools wheel aos-cube
请确认pip环境是基于python 2.7的,如果遇到权限问题,可能需要sudo来执行
git clone https://github.com/alibaba/AliOS-Things.git
Alios Things仓库比较大,下载需要一些时间。
usage: aos [-h] [--version] ...
Code management tool for aos - https://code.aliyun.com/aos/aos
version 0.2.42
Use 'aos -h|--help' for detailed help.
Online manual and guide available at https://code.aliyun.com/aos/aos-cube
optional arguments:
-h, --help show this help message and exit
--version print version number and exit
Commands:
new Create new aos program or component
ls List cube info, default components info
import Import program from URL
add Add component from AOS_SDK_PATH or URL
rm Remove component
deploy Find and add missing components and source codes
codes Import the optional component from the remote repository
publish Publish program or component
update Update to branch, tag, revision or latest
sync Synchronize aos component references
status Show version control status
make Make aos program/component
scons Make aos program/component by scons
makelib Compile static library
config Tool configuration
upload Upload aos image
monitor Serial port monitor
upgrade Upgrade aos-cube to latest
help This help screen
Usage: make [download] [run | debug] [JTAG=xxx] [total] [VERBOSE=1] [BINS=app/framework/kernel]
make run
One each of the following mandatory [and optional] components separated by '@'
* Application (apps in example)
* Board (cy8ckit-149 mk1101 gd32f4xx mk3080 mk3060 mk3239 stm32f429zi-nucleo xr871evb r5f565ne frdmkl27z stm32f769i-discovery lpcxpresso54102 rda8955 linuxhost uno-91h r5f100lea stm32l496g-discovery starterkit mk3165 atsame54-xpro eml3047 developerkit stm32l432kc-nucleo pca10056 esp32devkitc bk7231devkitc mk3166 esp8266 stm32l073rz-nucleo b_l475e rk1108 cb2201 amebaz_dev pca10040 bk7231udevkitc stm32l476rg-nucleo stm32l433rc-nucleo dh5021a_evb cy8ckit-062)
* [debug | release] Building for debug or release configurations
[download]
Download firmware image to target platform
[run]
Reset and run an application on the target hardware
[total]
Build all targets related to this application and board
[JTAG=xxx]
JTAG interface configuration file from the tools/OpenOCD dirctory
Default option is jlink_swd
[VERBOSE=1]
Shows the commands as they are being executed
[BINS=app/framework/kernel]
Build bins: app or framework or kernel
Notes
* Component names are case sensitive
* 'rhino' and 'debug' are reserved component names
* Component names MUST NOT include space or '@' characters
* Building for debug is assumed unless '@release' is appended to the target
Example Usage
Build for Debug
make helloworld@mk3060
Build, Download and Run using the default USB-JTAG programming interface
make helloworld@mk3060 download run
Build for Release
make helloworld@mk3060@release
Reset and run an application on the target hardware
make run
Clean output directory
make clean. Stop.
执行aos make helloworld@linuxhost,目标文件在根目录out目录下对应目录下out/helloworld@linuxhost/binary。
vcall init auto_component
kernel_version:AOS-R-1.3.1
app_version:app-1.0.0-20180615.0148
app_version:app-1.0.0-20180615.0148
kernel_version:AOS-R-1.3.1
Build AOS Now
TOOLCHAIN_PATH=/home/share/samba/application/AliOS-Things/build/compiler/gcc-arm-none-eabi/Linux64/bin/
Compiling alicrypto
Compiling board_amebaz_dev
Compiling auto_component
Compiling cli
Compiling digest_algorithm
Compiling framework
Compiling hal
Compiling kernel_init
Compiling vfs_device
Compiling newlib_stub
Compiling log
Compiling kv
Compiling netmgr
Compiling netmgrapp
Compiling armv7m
Compiling rtl8710bn
Compiling rtl8710bn_Peripheral_Drivers
Compiling rtl8710bn_SDK
Compiling net
Compiling rhino
Compiling vcall
Compiling vfs
Compiling yloop
Making out/netmgrapp@amebaz_dev/libraries/alicrypto.a
Making out/netmgrapp@amebaz_dev/libraries/board_amebaz_dev.a
Making out/netmgrapp@amebaz_dev/libraries/auto_component.a
Making out/netmgrapp@amebaz_dev/libraries/cli.a
Making out/netmgrapp@amebaz_dev/libraries/digest_algorithm.a
Making out/netmgrapp@amebaz_dev/libraries/framework.a
Making out/netmgrapp@amebaz_dev/libraries/hal.a
Making out/netmgrapp@amebaz_dev/libraries/kernel_init.a
Making out/netmgrapp@amebaz_dev/libraries/vfs_device.a
Making out/netmgrapp@amebaz_dev/libraries/newlib_stub.a
Making out/netmgrapp@amebaz_dev/libraries/log.a
Making out/netmgrapp@amebaz_dev/libraries/kv.a
Making out/netmgrapp@amebaz_dev/libraries/netmgr.a
Making out/netmgrapp@amebaz_dev/libraries/netmgrapp.a
Making out/netmgrapp@amebaz_dev/libraries/armv7m.a
Making out/netmgrapp@amebaz_dev/libraries/rtl8710bn.a
Making out/netmgrapp@amebaz_dev/libraries/rtl8710bn_Peripheral_Drivers.a
Making out/netmgrapp@amebaz_dev/libraries/rtl8710bn_SDK.a
Making out/netmgrapp@amebaz_dev/libraries/net.a
Making out/netmgrapp@amebaz_dev/libraries/rhino.a
Making out/netmgrapp@amebaz_dev/libraries/vfs.a
Making out/netmgrapp@amebaz_dev/libraries/yloop.a
Making out/netmgrapp@amebaz_dev/libraries/vcall.a
Making netmgrapp@amebaz_dev.elf
Making netmgrapp@amebaz_dev.xip2.elf
Making netmgrapp@amebaz_dev.hex
Making netmgrapp@amebaz_dev.bin
Can't parse memory configure, memory info get fail!
Making netmgrapp@amebaz_dev.xip2.bin
Linux64 /home/share/samba/application/AliOS-Things netmgrapp amebaz_dev /home/share/samba/application/AliOS-Things/build/compiler/gcc-arm-none-eabi/Linux64/bin/
Generate Standard Flash Images: out/netmgrapp@amebaz_dev/binary/netmgrapp@amebaz_dev.all.bin
Build complete
Making .gdbinit
由上可见,默认编译显示编译信息较精简,可通过执行aos make VERBOSE=1 netmgrapp@amebaz_dev 来查看详细的编译过程。
void main(void)
{
aos_init();
krhino_task_dyn_create(&g_aos_init, "aos-init", 0, AOS_DEFAULT_APP_PRI , 0, AOS_START_STACK, (task_entry_t)sys_init_func, 1);
SysTick_Config(SystemCoreClock/RHINO_CONFIG_TICKS_PER_SECOND);
aos_start();
return;
}