Skip to content

cfriedt/greybus-for-zephyr

Repository files navigation

Greybus for Zephyr

Build Status

Overview

This repository contains a Greybus module for the Zephyr Real-Time Operating System.

Building and Running

First, ensure that all required tools are installed by following Zephyr's Getting Started Guide.

Next, clone and synchronize repositories.

west init -m https://github.com/cfriedt/greybus-for-zephyr.git zephyrproject
cd zephyrproject
west update

While that is updating, choose a board from Zephyr's list of Supported Boards.

Next, update git submodules. Currently, there is a git submodule for the manifesto utility.

cd greybus
git submodule init
git submodule update
cd ..

Lastly, flash firmware for the chosen $BOARD using the commands below.

cd zephyr
source zephyr-env.sh
git apply ../greybus/zephyr-gpio-get-direction.patch
git apply ../greybus/zephyr-sys-byteorder-posix.patch
git apply ../greybus/zephyr-dynamic-pthread-stacks.patch
west build -b $BOARD -t flash ../greybus/samples/subsys/greybus/net

A number of patches are required until respective functionality is added upstream in the Zephyr Project.

Note, there may be an overlay required for the connectivity options that a particular board supports.

IEEE 802.15.4 Overlay

In that case, say for IEEE 802.15.4 support, the west build command above should be modified as shown below.

west build -b $BOARD -t flash ../greybus/samples/subsys/greybus/net \
    -- -DOVERLAY_CONFIG="overlay-802154.conf"

Bluetooth Low Energy Overlay

In that case, say for BLE support, the west build command above should be modified as shown below.

west build -b $BOARD -t flash ../greybus/samples/subsys/greybus/net \
    -- -DOVERLAY_CONFIG="overlay-ble.conf"

Network Configuration

While Greybus is capable of operating over any reliable transport, the focus of this project is TCP/IP (although quite an assortment of physical and data-link layers are supported in Zephyr).

Depending on the board that was chosen and the available connectivity options, some additional steps may be required for network connectivity.

Once network connectivity is established, it should be possible to use an mDNS browser such as Avahi to scan for service discovery.

avahi-browse -t -r _greybus._tcp
+ lowpan0 IPv6 zephyr              _greybus._tcp        local
= lowpan0 IPv6 zephyr              _greybus._tcp        local
   hostname = [zephyr.local]
   address = [2001:db8::1]
   port = [4242]
   txt = []

Client-Side Software Requirements

A Linux machine is required in order to connect to and control our Zephyr device via Greybus so be sure to follow Linux Software Requirements.

Using Greybus for I/O

At this point, we should be ready to perform some I/O on our remote devices using Greybus. Currently, this module supports the protocols below.

Contribute Back

In case a board was chosen that does not yet support Greybus, consider submitting a DeviceTree overlay file similar to cc1352r_sensortag.overlay and a board-specific configuration file similar to cc1352r_sensortag.conf.

The contribution guidelines for this module follow the Zephyr Contribution Guidelines.

To summarize,

  1. Create an Issue
  2. Code up your contribution
  3. Code up any tests and samples as required
  4. Ensure that tests pass and samples run as expected
  5. Make a Pull Request

Additional Information

Additional Information about Greybus including videos, slide presentations, and deprecated demo instructions can be found here.

A compiled version of the Greybus Specification is available here.

About

Greybus Module for the Zephyr Real-Time Operating System

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages