-
Notifications
You must be signed in to change notification settings - Fork 0
Wasm blinky #63
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
base: main
Are you sure you want to change the base?
Wasm blinky #63
Conversation
Add wasm-micro-runtime into west.yml projects. Signed-off-by: TOKITA Hiroshi <[email protected]> Signed-off-by: Wenyong Huang <[email protected]>
Add wasm-micro-runtime as zephyr module and add two samples: a hello world sample to illustrate how to run WASM application with wasm-micro-runtime (WAMR) runtime engine, and an app manager sample to illustrate how to start WAMR app manager in device side which runs on Zephyr OS and then install/uninstall/query WASM apps from host side. Signed-off-by: Wenyong Huang <[email protected]> Signed-off-by: TOKITA Hiroshi <[email protected]>
Add support to run wasm on native_sim. Signed-off-by: TOKITA Hiroshi <[email protected]>
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 1 added project Note: This message is automatically posted and updated by the Manifest GitHub Action. |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
#include <stdlib.h> | ||
#include <string.h> | ||
#include <stdint.h> | ||
#include <stdbool.h> | ||
#include <zephyr/drivers/gpio.h> | ||
#include <zephyr/kernel.h> | ||
#include <zephyr/sys/printk.h> | ||
#include <zephyr/sys/util.h> | ||
|
||
#include <errno.h> |
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.
Include stdio.h before calling printf in wasm blinky host
The host application calls printf
several times (e.g. when printing exceptions and timing data), but the file only includes Zephyr headers. With Zephyr’s default build flags implicit function declarations are errors, so this sample will fail to compile because the prototype for printf
is missing. Add #include <stdio.h>
(or switch to printk
) before invoking the C library printing APIs.
Useful? React with 👍 / 👎.
#include <stdlib.h> | ||
#include <string.h> | ||
#include <zephyr/kernel.h> | ||
#include <zephyr/sys/printk.h> |
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.
Missing stdio include in wasm hello world host
This sample also calls printf
to report exceptions and timing information without including <stdio.h>
. The Zephyr build enables -Werror=implicit-function-declaration
, so the compiler rejects these calls. Include <stdio.h>
(or use printk
) so the host code compiles.
Useful? React with 👍 / 👎.
elseif((CONFIG_WAMR_BUILD_TARGET STREQUAL "RISCV32_ILP32") OR | ||
((${CONFIG_RISCV}) AND (NOT (${CONFIG_64BIT})))) | ||
zephyr_compile_definitions( | ||
BUILD_TARGET_RISCV32_ILP32 | ||
BUILD_TARGET="RISCV32_ILP32" | ||
) | ||
zephyr_library_sources( | ||
${WAMR_DIR}/core/iwasm/common/arch/invokeNative_riscv.S | ||
) | ||
if(${CONFIG_WAMR_AOT}) | ||
zephyr_library_sources( | ||
${WAMR_DIR}/core/iwasm/aot/arch/aot_reloc_riscv.c | ||
) | ||
endif() | ||
zephyr_library_sources( | ||
${WAMR_DIR}/core/iwasm/aot/arch/aot_reloc_riscv.c | ||
) |
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.
Unconditionally compiling RISC-V AOT relocation source
Lines 179‑181 add aot_reloc_riscv.c
outside the surrounding RISC‑V and CONFIG_WAMR_AOT
guards. As written, every build will try to compile this RISC‑V‑specific relocation file even when building for ARM or when AOT support is disabled, which pulls in architecture‑specific constants and can cause non‑RISC‑V builds to fail. The extra zephyr_library_sources
call should be removed or kept inside the RISC‑V/AOT branch.
Useful? React with 👍 / 👎.
No description provided.