AliOS-Things 上手体验

官方文档:https://help.aliyun.com/product/123206.html

为了避免出现问题,我们把 Python3 设置为默认的:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
sudo update-alternatives --set python /usr/bin/python3.7

下载源码:

git clone https://gitee.com/alios-things/AliOS-Things.git -b rel_3.1.0
pip3 install aos-cube

创建项目:

export AOS_SDK_PATH=$PWD/AliOS-Things
# -b 板子类型 -t 模板 项目名称
aos create project -b linuxhost -t helloworld_demo myapp

编译测试(失败):

cd myapp
aos make BUILD_TYPE=debug

解决方案:注意到 AliOS-Things/platform/board/linuxhost/aos.mk 使用了 -m32 参数,因此安装 32 位开发包:

sudo apt install gcc-multilib

运行:

$ out/myapp@linuxhost/binary/myapp@linuxhost.elf
cpu num is 1
             Welcome to AliOS Things           
nano entry here!
hello world! count 0 
hello world! count 1 
hello world! count 2 
hello world! count 3 
hello world! count 4 
hello world! count 5

旧版创建项目方法:

cd AliOS-Things
aos make helloworld@linuxhost -c config
aos make
./out/helloworld@linuxhost/binary/helloworld@linuxhost.elf

调试

-exec handle SIG34 nostop noprint 
-exec handle SIGUSR1 nostop noprint 
-exec handle SIGUSR2 nostop noprint 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值