thelsing / knx

knx stack (TP, IP and RF) for arduino and linux, Can be configured with ETS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zephyr Integration

scholzi100 opened this issue · comments

Zephyr is a RTOS, targeting some what IoT systems, it supports a lot of boards and is included in the Linux foundation.

Website: https://www.zephyrproject.org/

Code Examples:
https://docs.zephyrproject.org/latest/samples/index.html#samples-and-demos

Are there any plans to integrate with Zephyr or any other RTOS for better hardware support?

I started a port. Initial port is not difficult, but in order to take advantage of zephyr features you'd need to make significant changes. Also having to use C++ makes the binary pretty large. I had to disable some features to fit it into 128kB for a stm32 g0. Didn't proceed further as I also wanted to wait for the 256kB version of the g0.

Concerning the large binary:
Have you disabled RTTI, exception handling and the stdlib while compiling the C++ code?

C++ in this project is not using the STL and does not make use of RTTI and exceptions.
Dynamic memory allocations are used with new, but in a very "controlled" manner.
Also not STL containers (std::vector, etc.) are used.

I can recommend reading this: https://arobenko.github.io/bare_metal_cpp/#_know_your_compiler_output

Basically it boils down to the following compiler flags for C++:
-fno-exceptions -fno-unwind-tables -fno-rtti

In the CC1310 port I am additionally using; -std=c++11 -fno-threadsafe-statics .

If somebody wants to further reduze the footprint of the lib with further tweaks from the article. Feel free to submit a pull request.

Regarding the topic: I have no plans to port the lib to other OSs. But pull requests are welcome.

I started a port. Initial port is not difficult, but in order to take advantage of zephyr features you'd need to make significant changes. Also having to use C++ makes the binary pretty large. I had to disable some features to fit it into 128kB for a stm32 g0. Didn't proceed further as I also wanted to wait for the 256kB version of the g0.

Well, lead times are endless long because of the "chip shortage". I am also waiting on a ST G0B1RE board for testing with NCN5130. Thankfully async uart for stm32 got merged into zephyr back in January. One less thing to worried about.