wasm-micro-runtime icon indicating copy to clipboard operation
wasm-micro-runtime copied to clipboard

Zephyr: fix the product mini compilation issue

Open lucasAbadFr opened this issue 4 months ago • 2 comments

This pull request present a fix to #4628.

It introduces the following changes:

  • Add a new os_nanosleep API.
  • Provide a naive but documented Zephyr implementation of os_nanosleep.
  • Add documentation for previously introduced os_ APIs in platform_api_extension.h.
  • Fix build issues so that the simple-file and simple-http samples compile again.

[!NOTE] At first I intended to change os_ioctl return type but didn't in the end.

lucasAbadFr avatar Sep 15 '25 14:09 lucasAbadFr

If it's alright, could I inquire about your experience with: How to set up CI on a Zephyr platform using GitHub Actions? Since there is no board, a simulation is required. So, which is better: nsim or QEMU?

lum1n0us avatar Sep 16 '25 00:09 lum1n0us

I @lum1n0us ! Thank you for the quick review.

Honestly, I don't have any real experiences for setting a CI on the Zephyr platform using Github Actions. But I may share my insights about native sim vs QEMU.

From my understanding about simulation tools:

  • native_sim / native_posix: They should be used for "smoke tests" because they build and run very quickly and are executed as a Linux process. But they don't fully replicate the Hardware (I don't think it is really a problem for WAMR). They are great for functional and build validation. IMO we should build and run the samples. Also I identified that the samples won't work as is but we need to modify the WAMR_BUILD_TARGET. We might have a specific CI configuration suited to the runner.

  • QEMU: It emulates real hardware, so it is closer to actual devices. From what I see it is already supported in Zephyr see the revelant documentation. It will be an heavier setup and maintenance effort (I think). The builds and runs will mechanicaly be slower.

  • Renode: I find this project facinating but didn't really use it yet. It's a simulator that emulates boards and peripherals. The complexity is even heavier than QEMU but it offers detailled hardware modeling. It's probably overkill as zephyr already test there board here.

Also the WAMR project could select a few (embedded) Hardware platforms to support for each of the (RTOS) paltforms supported. It could be aligned with the embedded SIG targeted (hardware) platforms.

But in any case at least trying to compile and run the samples should be pretty simple to put in place, and we should begin by that.

lucasAbadFr avatar Sep 16 '25 09:09 lucasAbadFr