Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
CAF on RIOT
RIOT is an operating system for embedded devices and is hosted on GitHub as well. We are currently working to get CAF running on RIOT. There basically two big parts to port,
Where we are
Here is a little todo list with our progress:
- enable usage of thread, mutex and condition variable
- port to RIOT native
- port to board (stm32f4discovery)
- implement a transactional interface for actor communication
- multiplexing with the new RIOT network stack
- implement the network stack for CAF (UDP, 6LoWPAN, CoAP)
Get everything merged and ease the usage
- CAF side
- RIOT side
- do lots of testing
For testing we use the RIOT native port and the stm32f4discovery boards, as they have a large amount of memory!
There are some things to prepare before diving in.
- compiler (for embedded devices try
gcc-arm-none-eabifound on launchpad)
- opencd (for flashing)
First, checkout both repositories and the according branches. Then, configure CAF with the following flags:
./configure --for-riot=path/to/riot --with-toolchain-file=cmake/Toolchain-arm-stm32f4.cmake --no-compiler-check
The toolchain files sets some paths and the compiler (which you may need to change if you use a different one). CMake does some tests with the selected compiler, which will fail, and can be skipped with the according option.
Usage on RIOT
The RIOT fork includes an example folder with two examples using CAF,
riot_and_caf. Those should work on the native port as well as the stm32f4discovery.
If you want to build your own application, there are a few flags and paths to set in a Makefile. Some of these will be moved to a more fitting location later. For now you need to consider the following steps:
- The Makefile includes a
CAF_HOMEvariable that needs to point to your CAF root directory.
CXXEXFLAGSflags need to include the following:
- Include the
CXXEXTRALIBS += $(CAF_HOME)/build/lib/libcaf_core_static.a
GCC will probably complain about the lib include. Wrapping the
CXXEXTRALIBS above will (hopefully) fix the problem:
CXXEXTRALIBS += -Wl,--whole-archive CXXEXTRALIBS += $(CAF_HOME)/build/lib/libcaf_core_static.a CXXEXTRALIBS += -Wl,--no-whole-archive