Hello World 示例

编译 ameba-rtos

进入 ameba-rtos 根目录,加载编译环境并编译:

Linux / WSL:
$ cd <workdir>/ameba-rtos
$ source env.sh
$ python3 ameba.py soc
$ python3 ameba.py build

编译完成后确认产物存在:

Linux / WSL:
$ ls <workdir>/ameba-rtos/build_RTL8721F/boot.bin
$ ls <workdir>/ameba-rtos/build_RTL8721F/build/project_km4ns/image/km4ns_image2_all.bin

编译 Rust SDK

进入 Rust SDK 根目录执行以下命令:

Linux / WSL:
$ cd <workdir>/rust
$ cargo xtask build-amebagreen2 --example hello-world --sdk <workdir>/ameba-rtos

编译成功后输出:

[package] xip=32B  sram=24576B  psram=32B  total=25760B
[package] build/amebagreen2/km4tz_image2_all.bin
[done] app.bin → build/amebagreen2/app.bin

烧录文件位于 build/amebagreen2/app.bin