Help with custom OpenThread simulation #11178
Replies: 1 comment 1 reply
-
I can try to provide some inputs that I hope may help you. OpenThread defines a set of platform APIs ( When integrated into Zephyr, all OT platform APIs are provided by the OS (Zephyr). OpenThread itself provides a "simulation platform" example that implements all of the platform APIs. This is located under If you want to run simulations under Zephyr, I expect certain OT platform APIs to still be provided/emulated by Zephyr. For example, alarms (timers) and tasklets are tied to the OS and it makes sense for them to be part of Zephyr. However, you may want to emulate So, the way I would go about this is to expand the Zephyr platform shim/drivers to include emulation of OT platform APIs. These can be similar to what the OpenThread "simulation platform" example does. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to set up my project so that I can build OpenThread to either run on hardware or run in a simulator on a Linux PC using the same application code. The project uses Zephyr. I'm having trouble getting things to link properly. (I can't use babblesim since some of my devices won't be running Zephyr)
Zephyr's networking stack looks like this (when using Openthread):
I know OpenThread provides simulation on posix targets. From my understanding that looks like this:
That makes me think it should be possible to do the following since Zephyr supports a native_sim target that runs on posix platforms:
One of my biggest problems right now is I can't seem to figure out what targets I need to link against in order to get that OpenThread Posix platform shim/drivers layer. I'm currently trying to link against openthread-ftd and openthread-simulation, but I'm going wrong somewhere. Zephyr can't find <openthread-system.h>. If anyone can tell me whether this approach is just dumb or what I'm doing wrong, it would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions