Stream: wamr

Topic: Can't use an AOT on an ESP32C3


view this post on Zulip Rusty (Dec 10 2023 at 04:36):

I'm on an ESP32C3, a riscv board. I'm trying to run an AOT wasm file. I find that os_mmap fails in espidf_memmap.c, specifically, heap_caps_malloc returns null when mem_caps is MALLOC_CAP_EXEC. When I replace MALLOC_CAP_EXEC with MALLC_CAP_DEFAULT, the initialization works fine. How can I get it to work?

view this post on Zulip Afonso Bordado (Dec 10 2023 at 10:03):

The ESP32-C3 uses a RISC-V 32 bit core, which is currently unsupported by wasmtime. We have discussed adding support for a very similar system (ESP32-C6) in this thread: https://github.com/bytecodealliance/wasmtime/issues/7311

The main missing parts are that cranelift, the compiler that wasmtime uses, supports RISC-V 64bit, but not 32bit. Adding support for that is quite a chunk of work.

If you need a WASM runtime in the meanwhile I would probably point you towards WAMR, that should work in that enviornment (RISC-V32 + ESP-IDF).

my co-worker told me that wasmtime project wanted to hear use-cases/demands/requirements for embedded scenarios. here is FYI about our requirements. Feature support embedded environment by "embedde...
WebAssembly Micro Runtime (WAMR). Contribute to bytecodealliance/wasm-micro-runtime development by creating an account on GitHub.

view this post on Zulip Rusty (Dec 10 2023 at 18:48):

Afonso Bordado said:

The ESP32-C3 uses a RISC-V 32 bit core, which is currently unsupported by wasmtime. We have discussed adding support for a very similar system (ESP32-C6) in this thread: https://github.com/bytecodealliance/wasmtime/issues/7311

The main missing parts are that cranelift, the compiler that wasmtime uses, supports RISC-V 64bit, but not 32bit. Adding support for that is quite a chunk of work.

If you need a WASM runtime in the meanwhile I would probably point you towards WAMR, that should work in that enviornment (RISC-V32 + ESP-IDF).

The problem is in WAMR

view this post on Zulip Afonso Bordado (Dec 10 2023 at 19:04):

Oh, sorry, I mistakenly assumed this was wasmtime! I'm not too familiar with WAMR, so someone else might have to step in.

view this post on Zulip Notification Bot (Dec 11 2023 at 19:08):

This topic was moved here from #general > Can't use an AOT on an ESP32C3 by fitzgen (he/him).

view this post on Zulip Hytak (Apr 02 2024 at 22:34):

I got AOT working with ESP32C3 by writing a minimal platform layer that calls into rust to do the allocation. I don't know how to write C so I can't help you there.


Last updated: Oct 23 2024 at 20:03 UTC