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?
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).
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
Oh, sorry, I mistakenly assumed this was wasmtime! I'm not too familiar with WAMR, so someone else might have to step in.
This topic was moved here from #general > Can't use an AOT on an ESP32C3 by fitzgen (he/him).
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: Dec 23 2024 at 12:05 UTC