This repository demonstrates the use of WebAssembly Micro Runtime (WAMR) on M5Stamp C3 to run WebAssembly applications.
get_idf or (Windows) ESP-IDF command prompt
# Linux or macOS ->
$ alias get_idf='. $HOME/esp/esp-idf/export.sh'
$ get_idf
# <-
Detecting the Python interpreter
... snip ...
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
$ echo ${IDF_PATH}
/home/hiromasa/devel/toolchain/esp/esp-idf
$ riscv32-esp-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv32-esp-elf-gcc
... snip ...
gcc version 12.2.0 (crosstool-NG esp-12.2.0_20230208)
- git clone and build (Please add
--recursive
)
git clone --recursive https://github.com/h1romas4/m5stamp-c3warm
cd m5stamp-c3warm
idf.py build
- Write Partition table
idf.py partition-table-flash
- Write WebAssembly(.wasm) to SPIFFS
parttool.py write_partition --partition-name=wasm --partition-subtype=spiffs --input resources/spiffs_wasm.bin
- Write main program to go!
idf.py flash monitor
python ${IDF_PATH}/components/spiffs/spiffsgen.py 0x20000 resources/wasm resources/spiffs_wasm.bin
$ cat partitions.csv | grep spiffs
wasm, data, spiffs, 0x310000, 0x20000
(WIP) This repository does not yet support loading of riscv32 AOT file.
$ wamrc --version
wamrc 2.1.1
$ cd resources/wasm/
$ wamrc --target=riscv32 -o 3dcube-riscv32.aot 3dcube.wasm
Create AoT compiler with:
target: riscv32
target cpu:
target triple: riscv32-pc-linux-ilp32d
cpu features: +d
opt level: 3
size level: 3
output format: AoT file
Compile success, file 3dcube-riscv32.aot was generated.
https://github.com/h1romas4/m5stamp-c3dev
https://github.com/h1romas4/m5stamp-c3wamr/tree/target-m5stack
Thanks for all the open source.
Name | Version | License |
---|---|---|
esp-idf | release/v5.1 |
BSD License |
arduino-esp32 | 3.0.2 |
LGPL-2.1 License |
WebAssembly Micro Runtime (WAMR) | 2.1.1 |
Apache-2.0 License |
AssemblyScript | 0.27.29 |
Apache-2.0 License |
Adafruit_GFX | 1.11.9 |
BSD License |
Adafruit_BusIO | 1.14.5 |
MIT License |
Adafruit-ST7735-Library | 1.10.3 |
MIT License |
MIT License