Hello World Example
Build ameba-rtos
Navigate to the ameba-rtos root, load the build environment, and compile:
Linux / WSL:
$ cd <workdir>/ameba-rtos
$ source env.sh
$ python3 ameba.py soc
$ python3 ameba.py build
Windows:
cd <workdir>/ameba-rtos
call env.bat
python ameba.py soc
python ameba.py build
macOS:
$ cd <workdir>/ameba-rtos
$ source env.sh
$ python3 ameba.py soc
$ python3 ameba.py build
Confirm that the build artifacts exist:
Linux / WSL:
$ ls <workdir>/ameba-rtos/build_RTL8721F/boot.bin
$ ls <workdir>/ameba-rtos/build_RTL8721F/build/project_km4ns/image/km4ns_image2_all.bin
Windows:
dir <workdir>/ameba-rtos/build_RTL8721F/boot.bin
dir <workdir>/ameba-rtos/build_RTL8721F/build/project_km4ns/image/km4ns_image2_all.bin
macOS:
$ ls <workdir>/ameba-rtos/build_RTL8721F/boot.bin
$ ls <workdir>/ameba-rtos/build_RTL8721F/build/project_km4ns/image/km4ns_image2_all.bin
Build the Rust SDK
Run the build command from the Rust SDK root:
Linux / WSL:
$ cd <workdir>/rust
$ cargo xtask build-amebagreen2 --example hello-world --sdk <workdir>/ameba-rtos
Windows:
cd <workdir>/rust
cargo xtask build-amebagreen2 --example hello-world --sdk <workdir>/ameba-rtos
macOS:
$ cd <workdir>/rust
$ cargo xtask build-amebagreen2 --example hello-world --sdk <workdir>/ameba-rtos
Expected output on success:
[package] xip=32B sram=24576B psram=32B total=25760B
[package] build/amebagreen2/km4tz_image2_all.bin
[done] app.bin → build/amebagreen2/app.bin
The flash image is located at build/amebagreen2/app.bin.