-
Notifications
You must be signed in to change notification settings - Fork 24
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
Zephyr federated support #232
base: main
Are you sure you want to change the base?
Conversation
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.
Looks good, but can we find a better way of dealing with the regex functionality? If I understand correctly, it is used in validate_host
and validate_user
. Silje, you want to remove these functions from the Zephyr port, why arent they needed for Zephyr?
Also, are you sure that the regex library isn't available for Zephyr? Some googling indicates that it is available in Newlib (the C library implementation we use on Zephyr)
Good points. I think you are right; the regex library should be included in Newlib. However, I am getting linker errors when using the regex functions:
Any ideas? It is similar to zephyrproject-rtos/zephyr#8502 - could it be a bug in Zephyr? Or maybe some configuration option I have missed? |
Could be a configuration issue. How can I reproduce it here? |
Try to build any zephyr program with -b mimxrt1170_evk_cm7 and the option CONFIG_NEWLIB_LIBC=y. This should not be able to compile, since regcomp takes parameters. With this program I am not getting a linker error, but another error in regex.h. So it seems the linker error was my fault. But still I am getting the error shown below.
EDIT: it seems like the error above comes from that regex.h depends on sys/types.h. When I add both in net_util.h, I am getting still getting linker errors in net_util.c. |
Did you resolve it? |
No, I am still getting a linker issue, even if the correct library files are included. It could be related to linker flags, maybe. I guess you should be able to reproduce it properly now, with the new pull request in lf-west-template. |
The problem is resolved by using picolibc rather than newlibc. But I remember picking newlibc because I had problems with the other C library options. But you could try changing form newlibc to picolibc in the prj.conf file that is in the lingua-franca repository. It is somewhere under resources/platform/zephyr I think |
@siljesu What is the status on this? Will you have time to finalize it? |
To get this merged we need to do the following:
|
Could be a nice project. I have seen that Zephyr supports Sockets over USB, so it should, in theory, be possible to run federated LF programs spanning a Pico and a Linux PC connected by USB. The Pico would be a better example platform for Federated Embedded LF as it is more common. The boards Silje were using are more rare, and in general, ethernet on microcontroller boards is not that common. By what time should I propose a project? |
No hurry with this, but what you describe sounds great. I think students will figure out their project sometime next month... |
To be able to run federates on Zephyr, the following changes must be made to reactor-c. Notice that #220 has been merged into this PR as well. This is because Zephyr does not offer support for the obsolete gethostbyname(). So, if #220 is not approved, then this PR must add a macro separating the two implementations.
In the Zephyr platform-specific functions, macros are added to allow for static thread stack definition for federated execution.
Additionally, the regex library is not supported by Zephyr.