-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pkg/wamr: add WAMR to provide WASM support in RIOT #15329
Conversation
Looking forward to trying this out. |
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.
Thanks for the contribution @kfessel, some comments on the makefile
integration. Regarding
the PR description:
Example will be provided
Would you say this PR is still WIP then?
Asking because we need some compile test for merging. |
yes it is WIP I got a RIOT example that is upstreamed to WAMR that to get RIOT as a platform into WAMR should i add that (it is very basic)? |
I got a kernel_type.h include upstream and will try to fix it there. I don't know: if there was a deprecation warning, but i certainly did not see it. |
The example I just uploaded is the one i provided to the WAMR upstream just with the makefile turned around a little. |
The warning kernel_types.h is removed (upstream patched) some how the WPEDANTIC := 0 in the Makefile is ignored (there are warnings About void* to function pointer casts) if the alocator functions are defined. |
@kfessel let me know when this is no longer WIP and I'll take another look :) |
ping @kfessel, is this still WIP ? Can it be reopened ? |
yes it is This has the interpreter running but missing calls to system (Riot) making it more useful than to say i an able to run wasm on riot. i am currently trying to generalise system calls for Riot embedded interpreters since i wasnt able to find something i could tap into |
I like to have this open |
40f5087
to
fb5791e
Compare
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.
A bunch of style nits
Would it be possible that you extend the example so that one is able to recreate the I am aware that generating WASM bytecode isn't really specific to RIOT, but fine-tuning e.g. the stack size, pointing out that WAMR contains a subset of the standard C lib as built ins (e.g. |
* uneventise example
* for which no working assembly invokeNative is provided
I played around a bit with the code here. In general the experience is pretty good and it was easy enough to get things to work and add bindings for calls (saul) to the code. I haven't really tried passing arguments to the code or copy structs to the virtual memory of the runtime. I asked offline for the clarification provided in fc1f44a as my first action was to copy the bits from the iwasm.c file. |
add comment refering to the wasm header instead
Please squash! IMO two commits (one for the pkg, one for the example) are sufficient. |
Yea two commits (one for the pkt, one for the pkg) are fine, we don't need the entire work history in tree. |
everything is prefixed, git log will just show the one-merge commit if it is not fast forwarded. and murdock is done 🟩 |
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.
ACK. Code looks good and works like a charm. Let's not have this delayed over bike shedding regarding commit history.
Congrats @kfessel! |
Contribution description
This PR adds WAMR as a pkg to RIOT to enable Webassembly execution on RIOT
tested on native and nucleo-f767zi
RIOT compatibility is upsteamed
Testing procedure
Example will be provided
references
https://github.com/bytecodealliance/wasm-micro-runtime
bytecodealliance/wasm-micro-runtime#357 < about wasm-memory