This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 5d03e1a3b44d6f3d1d532e3aa42f479e8fee0a21
Author: YAMAMOTO Takashi <yamam...@midokura.com>
AuthorDate: Wed May 25 12:33:03 2022 +0900

    esp32-devkitc: Document wamr_wasi_debug config
---
 .../xtensa/esp32/boards/esp32-devkitc/index.rst    | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git 
a/Documentation/platforms/xtensa/esp32/boards/esp32-devkitc/index.rst 
b/Documentation/platforms/xtensa/esp32/boards/esp32-devkitc/index.rst
index 919c3ae7e4..4fb26b312b 100644
--- a/Documentation/platforms/xtensa/esp32/boards/esp32-devkitc/index.rst
+++ b/Documentation/platforms/xtensa/esp32/boards/esp32-devkitc/index.rst
@@ -315,6 +315,44 @@ To test it, just run the following::
 
 Where x in the watchdog instance.
 
+wamr_wasi_debug
+---------------
+
+This config is an example to use wasm-micro-runtime.
+It can run both of wasm bytecode and AoT compiled modules.
+
+This example uses littlefs on ESP32's SPI flash to store wasm modules.
+
+1. Create a littlefs image which contains wasm modules.
+
+   https://github.com/jrast/littlefs-python/blob/master/examples/mkfsimg.py
+   is used in the following example.
+
+  % python3 mkfsimg.py \
+    --img-filename ..../littlefs.bin \
+    --img-size 3080192 \
+    --block-size 4096 \
+    --prog-size 256 \
+    --read-size 256 \
+    ..../wasm_binary_directory
+
+2. Write the NuttX image and the filesystem to ESP32.
+
+  % esptool.py \
+    --chip esp32 \
+    --port /dev/tty.SLAB_USBtoUART \
+    --baud 921600 \
+    write_flash \
+    0x1000 ..../bootloader-esp32.bin \
+    0x8000 ..../partition-table-esp32.bin \
+    0x10000 nuttx.bin \
+    0x180000 ..../littlefs.bin
+
+3. Mount the filesystem and run a wasm module on it.
+
+  nsh> mount -t littlefs /dev/esp32flash /mnt
+  nsh> iwasm /mnt/....
+
 efuse
 -----
 

Reply via email to