Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Explore Lingua Franca on Zephyr #1262

Closed
Soroosh129 opened this issue Jun 30, 2022 · 10 comments · Fixed by #1536
Closed

Explore Lingua Franca on Zephyr #1262

Soroosh129 opened this issue Jun 30, 2022 · 10 comments · Fixed by #1536
Assignees
Labels
feature New feature good first issue Good for newcomers new project

Comments

@Soroosh129
Copy link
Contributor

Soroosh129 commented Jun 30, 2022

It would be a nice exploratory project to try to get Lingua Franca running in some capacity on Zephyr. Afterward, we should explore how we could utilize the features offered by Zephyr to enhance parallelism, guarantee deadlines, etc.

A potential good starting point would be to experiment with the native POSIX execution first.

@Soroosh129 Soroosh129 added enhancement Enhancement of existing feature good first issue Good for newcomers labels Jun 30, 2022
@Soroosh129 Soroosh129 self-assigned this Jun 30, 2022
@lhstrh
Copy link
Member

lhstrh commented Jun 30, 2022

Is there any particular hardware platform you would recommend we do this on?

@Soroosh129
Copy link
Contributor Author

This sounds like a nice starting point.

@lhstrh
Copy link
Member

lhstrh commented Jul 1, 2022

Hm, this page appears to describe a Windows FreeRTOS port?

@Soroosh129
Copy link
Contributor Author

The first sentence is misleading. See the section titled "Building and Executing the Demo on Linux" on that page.

@georgedlu
Copy link

Would you entertain Zephyr? https://docs.zephyrproject.org/latest/boards/posix/native_posix/doc/index.html

Zephyr also supports devicetree like Linux.

@Soroosh129
Copy link
Contributor Author

FreeRTOS was suggested by @edwardalee. It looks like Zephyr is also actively developed and supports quite a variety of hardware. @edwardalee, do you have a preference between FreeRTOS and Zephyr?

@edwardalee
Copy link
Collaborator

Zephyr looks very interesting. The protocol stacks it supports will prove quite useful, I think.

@Soroosh129 Soroosh129 changed the title Explore Lingua Franca on FreeRTOS Explore Lingua Franca on Zephyr Jul 4, 2022
@lhstrh lhstrh added feature New feature new project and removed enhancement Enhancement of existing feature labels Jul 7, 2022
@lhstrh lhstrh assigned erlingrj and unassigned Soroosh129 Sep 28, 2022
@erlingrj
Copy link
Collaborator

Thanks for pointing me to this. Zephyr can also be used for single-threaded. You just use 1 thread. In fact, Nordic is going full Zephyr now. Their new nRF Connect SDK is based on Zephyr and UART library etc are Zephyr device drivers. They argue that people wanting bare-metal can use Zephyr with 1 thread which gives minimal overhead. If I understand them correctly they don't support bare-metal software on their newer nRF53 chips. There is also support for an impressive number of boards already. Also the newer Arm-based Arduinos.

This might be the "platform-independent" API on which we might want to build our Reactor library. Moreover, a LF microkernel implementation could be a fork/extension of Zephyr where we re-implement threads or extend it with a new concurrent execution context, namely a Reactor.

This would, however, really tie us to Zephyr for the embedded systems. I have never programmed anything in Zephyr yet, but it seems to be a lot of hype and that it is aiming for being the Linux of MCUs,

Have you looked into Zephyr before @cmnrd ?

@erlingrj
Copy link
Collaborator

erlingrj commented Sep 29, 2022

This might have been premature excitement. I have spent the afternoon playing around with Zephyr and thinking about how to run LF ontop of it, which I don't think will be very hard. The big problem is that it is not very straightforward to get accurate timing. The OS uses the systick timer for timing and sleeps etc are in msec granularity.

@erlingrj
Copy link
Collaborator

erlingrj commented Oct 1, 2022

That might have been premature rejection haha. In any case, I have started the process of implementing the platform API for Zephyr. I have run simple LF programs using the Single Threaded API on the NRF52. I track the progress here. AFter discussion with Edward we think that it might indeed be promising as a "wrapper" for the most common embedded platforms. Will continue working on this.

@erlingrj erlingrj linked a pull request Jan 13, 2023 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature New feature good first issue Good for newcomers new project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants