Website | Video | Presentation
-
WAMR • All commits
- Platform API implementation for Mbed OS • utsavm9/wasm-micro-runtime@4c5eb14
- CMake file to build WAMR for Mbed • utsavm9/wasm-micro-runtime@aa954a5
- Added mini-product for Mbed • utsavm9/wasm-micro-runtime@0960e82
-
Mbed • All commits
- Remove unnecessary component preventing compilation • utsavm9/mbed-cmake@24248f5
- Seperate build files from source files in CMake • utsavm9/mbed-cmake@51dd694
- Combine build process of WAMR with Mbed • utsavm9/mbed-cmake@593affc
-
Scripts • Folder
- Serial Monitor for Windows
- Compiling C programs to WASM modules in C arrays
- Compiling with Mbed-CMake
builds/
: Contains binary image of WAMR+Mbed for Arduino Nano and STM32 Nucleo boards generated from this project. Also has thoughts on further work needed to flash to Arduino Nano.docs/
: Contains code for website and the presentation.mbed/
: Submodule of USC Mbed-CMakemeasurements/
: Code related to measuring the performance hit of using WASM interpreters on various boardsscripts/
: Helpful scripts used in this projectwasm-micro-runtime/
: Submodule of WAMR
-
Create a folder, say
custom_app
insidembed/
folder to store the source files. Copy Mbed mini-product files insidewasm-micro-runtime/product-mini/platforms/mbed/
to that folder. -
Make a soft-link to the root of WAMR repo, inside the
mbed/
directory and name the soft-link aswamr
.
# Bash
ln -s ~/wasm-micro-runtime/ ~/mbed/wamr
# Powershell run as Admin
New-Item -Name ~/mbed/wamr -ItemType SymbolicLink -Value ~\wasm-micro-runtime\
-
Copy
build_mbed.ps1
insidembed/
. -
The name of the executable specified here in
CMakeLists.txt
should be the same as in thebuild_mbed.ps1
script specified here and here. -
The
CMakeLists.txt
of the current directory determines which project will be built. So,cd custom_app
. -
Compile with
../build_mbed.ps1
. -
A
.bin
file would be generated inside thembed/build/
. This can be copied to the drive to which an Mbed-enabled board mounted to flash the file onto the board.
-
See
scripts/
directory for help on usinggen_wasm.sh
to get C-byte array representing your WASM program. -
Verify that a blinky program can be compiled and flashed to the board. Follow steps in "Getting Started Guide - Zephyr" or latest guide and get blinkly program flashed to board using
west
.- If using the same board as us (Nordic nRF528040), then the target name is
nrf52840dk_nrf52840
- If using the same board as us (Nordic nRF528040), then the target name is
-
Copy the Zephyr mini-product files from
wasm-micro-runtime/product-mini/platforms/zephyr/simple/
to a new folder insidezephyr/samples/
. Assume we copied the mini-product files intozephyr/samples/custom_app
. -
Make a soft-link to the root of WAMR repo, inside the
custom_app
directory and name the soft-link aswamr
.
# Bash
ln -s ~/wasm-micro-runtime/ custom_app/wamr
# Powershell run as Admin
New-Item -Name custom_app/wamr -ItemType SymbolicLink -Value ~\wasm-micro-runtime\
-
Remove all files inside the
custom_app/src
folder and then place these files inside that foler:measurements/nordic-wamr/main.c
measurements/fib_timed.c.wasm
-
With current directory the same as
custom_app
, so that theCMakeList.txt
file is in the current directory, compile the app. A memory map of the program should be shown when successfully compiled.
west build -b nrf52840dk_nrf52840 . -p always -- -DWAMR_BUILD_TARGET=THUMB -DWAMR_BUILD_AOT=0
-
Connect board to USB with power switched on. Flash to the board using
west flash
. -
Use
Serial-Monitor
script to find the associated COM port of the board. With default baud rate of 115200,Serial-Monitor
script can be used to see the output fromprintf()
.
- Recording time to finish computing fibonacci • See file
- Arelys Navarro (arelysnavarro@g.ucla.edu)
- Howard Xie (howardx@cs.ucla.edu)
- Utsav Munendra (utsavm9@g.ucla.edu)