-
Notifications
You must be signed in to change notification settings - Fork 728
Port WAMR to ESP-IDF #892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port WAMR to ESP-IDF #892
Conversation
|
👍 |
|
@1c3t3a Thanks a lot for enabling the platform esp-idf! |
11cc6de to
dbe6303
Compare
| os_thread_get_stack_boundary(void) | ||
| { | ||
| BH_FREE(addr); | ||
| return NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, so let's merge the patch firstly, and fix it in the future.
dbe6303 to
a17c32c
Compare
| } | ||
|
|
||
| printf("run main() of the application\n"); | ||
| void *ret = app_instance_main(wasm_module_inst); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had better define the variable at the beginning of the function.
|
@1c3t3a I did several minor changes according to @xujuntwt95329's comments and merged the patch. And more discussion for the commit:
|
Various fixes and beautifications coordinated with @1c3t3a, fixes 2 of the 3 all remaining issues from #892: - enable to os_mmap executable memory - fix os_malloc/os_realloc/os_free issues - implement os_thread_get_stack_boundary - add build scripts to include with esp-idf to use wamr as an ESP-IDF component - update sample and document
This PR introduces an implementation of the WAMR platform APIs for ESP-IDF and enables support for Espressif microcontrollers, and adds the documentation around how to build WAMR for ESP-IDF. This PR is related to the following issues at WAMR: closes bytecodealliance#883, bytecodealliance#628, bytecodealliance#449 and bytecodealliance#668 as well as [#4735](espressif/esp-idf#4735) at the esp-idf repo. It implements most functions required by [platform_api_vmcore.h](https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/core/shared/platform/include/platform_api_vmcore.h). The PR works in interpreter mode on Esp32c3 and Esp32. For the AOT mode, currently errors occur on both platforms with `Guru Meditation Error`. It seems that the AOT code isn't run with shared memory as os_mmap() allocates memory with malloc() API, it is to be fixed in the future.
Various fixes and beautifications coordinated with @1c3t3a, fixes 2 of the 3 all remaining issues from bytecodealliance#892: - enable to os_mmap executable memory - fix os_malloc/os_realloc/os_free issues - implement os_thread_get_stack_boundary - add build scripts to include with esp-idf to use wamr as an ESP-IDF component - update sample and document
This PR introduces an implementation of the WAMR platform API for ESP-IDF and enables support for Espressif microcontrollers.
This PR is related to the following issues at WAMR: closes #883, #628, #449 and #668 as well as #4735 at the esp-idf repo.
This PR implements most functions required by platform_api_vmcore.h only the following functions are left empty:
Furthermore, a lot of functions from platform_api_extension.h are implemented. Only the following functions are missing:
It would be nice to get feedback from someone more familiar with ESP-IDF on how to implement those functions. I am working with ESP-IDF mostly through it's Rust API and I currently don't feel safe implementing these methods without a mentor or someone that looks over my work.
The code in this PR runs on my Esp32c3 and Esp32 in Interpreter mode, the AoT mode currently errors on both platforms with a
Guru Meditation ErrorI think that is becauseos_mprotectisn't implemented.I also added some documentation around how to build WAMR for ESP-IDF.