Upstream Greybus module for Zephyr

Introduction

Currently, greybus module for zephyr is a out of tree Zephyr module to bring Greybus support to Zephyr. This makes it hard to maintain, and makes it almost impossible for other people to test and contribute.

The goal of the project is to get greybus and BeagleConnect Technology ecosystem to a point that is easier to test and maintain. It can be considered a continuation of Replace GBridge Project from 2023

Basic Goals

  • Clean up and revive the testing infrastructure already present in module.
  • Make MikroBUS manifest optional. Since MikroBus manifest is not officially part of the Greybus spec, the current module will not work without a modified kernel even if we are not using MikroBUS boards.
  • Upstream the module as an official Zephyr module
  • Use greybus abstractions from the module in greybus-host firmware

Hardware Skills: basic wiring
Software Skills: device-tree, C, ZephyrRTOS, Linux, TCP.
Possible Mentors: @ayush1325 , @jkridner ,
Expected size of project: 350 hour
Rating: medium

Resources

1 Like

Hello @ayush1325 ,

I am interested in contributing to this project and would love to get started. From what I understand, the goal is to upstream the Greybus module for Zephyr, clean up the existing testing infrastructure, and make MikroBUS manifest optional. This would make it easier for developers to maintain and contribute to the project.

I have experience in embedded systems and C programming and have worked with STM32 (L476RG), handling various communication protocols. Additionally, I have explored AI/ML models and their deployment on edge devices, and I am eager to expand my knowledge of Zephyr RTOS and Kernel Development through this project.

Since I was looking for a good Zephyr RTOS project, this one looks interesting, and I would like to start contributing. I would appreciate any guidance on how to begin. Are there any initial tasks I should look into? Should I start by exploring the current Greybus module and its testing infrastructure, or are there other areas you recommend?

Looking forward to your guidance and excited to contribute!

Best,
Sahil Jaiswal

For initial tasks, you can just try the following:

  1. Get familiar with Zephyr if you are not already. If you have any supported board (does not need to be a BeagleBoard) just try playing around with zephyr and get a feel for things. You can also use the qmeu targets, or I think there are other emulated targets, in case you do not have a board.
  2. Cleaning up unnecessary stuff in the source. It was originally ported from Nuttx (I think), and probably still contain stuff that we can substitute with Zephyr provided stuff. I think I did some cleanup last year.
  3. Explore Zephyr device tree side of things. You will be interacting with it a lot in greybus module.
  4. Look at how Zephyr twister tests run since that is what we will need to use to run tests.

Ok I will go through all this tasks and give you a update…

I have successfully set up Zephyr, installed the SDK, and built/running samples using QEMU. I explored different targets and tested basic applications.

Now, I am moving on to cleaning up unnecessary legacy components in the source code. I will identify and replace any Nuttx-specific elements with Zephyr-native implementations where applicable. I’ll also verify functionality by testing after modifications.

Let me know if there are any specific areas I should focus on or any guidance on potential components that may still have legacy dependencies.

1 Like

Hi @ayush1325
I am facing following issue while setting up grebus-for-zephyr using upstream zephyr

FATAL ERROR: Malformed manifest file: /home/sahil/greybus-zephyr/greybus/west.yml
Schema file: /home/sahil/zephyrproject/.venv/lib/python3.12/site-packages/west/manifest-schema.yml
Hint: project greybus-for-zephyr path “greybus” is taken by the manifest repository

I think you already fixed the issue but the pr is not merged that one

Can you please check once…

Thanks

Hi, can you check out the gitlab-ci file for how I am building it in CI?

greybus for zephyr needs to be present as a zephyr module, else it will not work. I think that is the error you are getting, but cannot be sure.

Hi @ayush1325,

Just wanted to share a quick update on my progress with the project. I have successfully integrated Greybus with Zephyr by adding Greybus as a module. I also made necessary changes in prj.conf and updated west.yml to properly include the module. After resolving some Kconfig dependencies, I was able to build the project successfully using west.

During this process, I encountered and resolved several issues, such as:

  • Kconfig dependency conflicts (e.g., GREYBUS dependencies not being met)
  • Ensuring proper device tree integration for BeagleConnect Freedom
  • Cleanup of unnecessary configurations inherited from the original Nuttx port

Now that the basic integration is working, what should I focus on next for GSoC ? Should I start making proposal ?

Yeah. You can start working on the proposal. While writing the proposal, try to have a good amount of detail regarding how you are planning on doing a task.
Also, feel free to put a link to your fork of greybus module in this forum thread. You can also just use this thread to document how you resolved the issues you pointed out. It’s best to put as much out in the open as possible since that is the spirit of working in open.

1 Like

Hi @ayush1325,

I have successfully completed the “Hello World” prerequisite task for GSoC and cross-compiled the program to run on an ARM Linux environment using QEMU. I have also updated the source code to print my name and submitted a pull request to the repository.

Here is the PR link: GSOC 2025 - Sahil Jaiswal by Sahil7741 · Pull Request #202 · jadonk/gsoc-application · GitHub

Best,
Sahil

Hi @ayush1325,

I’ve drafted my GSoC proposal and would really appreciate your feedback. I’ve tried to incorporate the discussions we’ve had so far and structured the proposal with detailed planning.

Here’s the link to my draft: https://openbeagle.org/Sahil7741/gsoc.beagleboard.io/-/blob/main/proposals/2025/Sahil%20Jaiswal/sahil_jaiswal.rst

Here’s the link to PR of drafted proposal: https://openbeagle.org/gsoc/gsoc.beagleboard.io/-/merge_requests/59

Could you please review it and let me know if there are any improvements or missing aspects? Your insights would be really valuable in refining it before submission.

Thanks in advance!

Hi @ayush1325

Thank you for encouraging openness—I’m genuinely excited to embrace it! I’ve started working and am first focused on making Greybus functional with the current Zephyr 4.1.0 and its kernel. I’ll be documenting everything here, starting with initial challenges like the toolchain setup (no SDK installed at first, resolved with Zephyr SDK 0.17.0) and missing network support (fixed by adding overlay-qemu_cortex_m3_eth.overlay). Right now, I’m excited to tackle ongoing issues, especially the Greybus binding failure where device_get_binding(“greybus0”) returns NULL despite a valid DTS entry, and share the journey transparently as I progress. Updates will follow soon! Also, are the resources you shared initially sufficient, or are there additional ones that could help me complete the project ?

Here’s my fork of the Greybus module: Sahil Jaiswal / greybus-for-zephyr · GitLab.

Hi @ayush1325

I was exploring about Greybus and Zephyr for my GSoC project and found a great video by another project mentor @vaishnav explaining Greybus. What I understood is its a super cool protocol that makes remote wireless devices, like those in IoT, appear locally connected to the host via fast, low-latency communication—perfect for BeagleConnect! I’m excited to dive into its integration with Zephyr’s device model. If you have any additional resources or insights on Greybus’s inner workings or its role in Zephyr, I’d love to hear them!

1 Like

Hi @ayush1325 @vaishnav @moto-timo ,

I did setup of zephyr development locally and build hello world for beagleconnect_freedom succesfully and now I was trying to setup Greybus by using its README.rst also I tried steps in gitlab-ci but could not be able to do it, so I need your help can you guide me with steps ?

So, that repo is sadly completely broken. You need to use the repo from this PR: Allow building using upstream Zephyr (!20) · Merge requests · BeagleConnect / Zephyr / greybus-for-zephyr · GitLab

1 Like

Thanks @ayush1325

I have successfully setup Greybus and I was trying to build it for beagleconnect_freedom, but getting error after running west build -p always -b beagleconnect_freedom ../modules/greybus/samples/subsys/greybus/net

– west build: making build dir /home/sahil/zephyrproject/zephyr/build pristine
– west build: generating a build system
Loading Zephyr default modules (Zephyr base).
– Application: /home/sahil/zephyrproject/modules/greybus/samples/subsys/greybus/net
– CMake version: 4.0.2
– Found Python3: /home/sahil/zephyrproject/.venv/bin/python3 (found suitable version “3.12.3”, minimum required is “3.10”) found components: Interpreter
– Cache files will be written to: /home/sahil/.cache/zephyr
– Zephyr version: 4.1.99 (/home/sahil/zephyrproject/zephyr)
– Found west (found suitable version “1.3.0”, minimum required is “0.14.0”)
– Board: beagleconnect_freedom, qualifiers: cc1352p7
– ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
– Found host-tools: zephyr 0.17.0 (/home/sahil/zephyr-sdk-0.17.0)
– Found toolchain: zephyr 0.17.0 (/home/sahil/zephyr-sdk-0.17.0)
– Found Dtc: /home/sahil/zephyr-sdk-0.17.0/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version “1.6.0”, minimum required is “1.4.6”)
– Found BOARD.dts: /home/sahil/zephyrproject/zephyr/boards/beagle/beagleconnect_freedom/beagleconnect_freedom.dts
– Found devicetree overlay: /home/sahil/zephyrproject/modules/greybus/samples/subsys/greybus/net/boards/beagleconnect_freedom.overlay
node ‘/resources’ compatible ‘test,greybus-i2c’ has unknown vendor prefix ‘test’
– Generated zephyr.dts: /home/sahil/zephyrproject/zephyr/build/zephyr/zephyr.dts
– Generated pickled edt: /home/sahil/zephyrproject/zephyr/build/zephyr/edt.pickle
– Generated devicetree_generated.h: /home/sahil/zephyrproject/zephyr/build/zephyr/include/generated/zephyr/devicetree_generated.h
– Including generated dts.cmake file: /home/sahil/zephyrproject/zephyr/build/zephyr/dts.cmake

warning: The choice symbol NET_L2_IEEE802154_RADIO_ALOHA (defined at
subsys/net/l2/ieee802154/Kconfig.radio:36) was selected (set =y), but no symbol ended up as the
choice selection. See
Kconfig Search — Zephyr Project Documentation and/or look
up NET_L2_IEEE802154_RADIO_ALOHA in the menuconfig/guiconfig interface. The Application Development
Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
might be helpful too.

/home/sahil/zephyrproject/modules/greybus/samples/subsys/greybus/net/prj.conf:7: warning: attempt to assign the value ‘y’ to the undefined symbol POSIX_CLOCK

/home/sahil/zephyrproject/modules/greybus/samples/subsys/greybus/net/prj.conf:8: warning: attempt to assign the value ‘y’ to the undefined symbol PTHREAD_IPC

/home/sahil/zephyrproject/modules/greybus/samples/subsys/greybus/net/prj.conf:24: warning: attempt to assign the value ‘y’ to the undefined symbol NET_SOCKETS_POSIX_NAMES

/home/sahil/zephyrproject/modules/greybus/samples/subsys/greybus/net/prj.conf:26: warning: attempt to assign the value ‘16’ to the undefined symbol POSIX_MAX_FDS

/home/sahil/zephyrproject/modules/greybus/samples/subsys/greybus/net/prj.conf:71: warning: attempt to assign the value ‘16’ to the undefined symbol MAX_PTHREAD_COUNT
Parsing /home/sahil/zephyrproject/zephyr/Kconfig
Loaded configuration ‘/home/sahil/zephyrproject/zephyr/boards/beagle/beagleconnect_freedom/beagleconnect_freedom_defconfig’
Merged configuration ‘/home/sahil/zephyrproject/modules/greybus/samples/subsys/greybus/net/prj.conf’
Merged configuration ‘/home/sahil/zephyrproject/modules/greybus/samples/subsys/greybus/net/boards/beagleconnect_freedom.conf’

error: Aborting due to Kconfig warnings

CMake Error at /home/sahil/zephyrproject/zephyr/cmake/modules/kconfig.cmake:365 (message):
command failed with return code: 1
Call Stack (most recent call first):
/home/sahil/zephyrproject/zephyr/cmake/modules/zephyr_default.cmake:131 (include)
/home/sahil/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
/home/sahil/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
CMakeLists.txt:4 (find_package)

– Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/home/sahil/zephyrproject/.venv/bin/python3 -B/home/sahil/zephyrproject/zephyr/build -GNinja -DBOARD=beagleconnect_freedom -S/home/sahil/zephyrproject/modules/greybus/samples/subsys/greybus/net

Can you help me understand what the error is and some resource to fix this ?
@ayush1325 , @vaishnav , @moto-timo

It seems like upstream zephyr might have changed/removed some kconfig symbols since the last time. Can you try tracking down if the kconfig variables shown in the error as undefined exist?

@ayush1325 , @vaishnav , @moto-timo

@ayush1325 Thanks for pointing out the potential Kconfig symbol changes in upstream Zephyr! You’re right—Zephyr 4.1.0 deprecated several POSIX-related symbols, causing errors in my greybus_net build for BeagleConnect Freedom. The undefined symbols were NET_SOCKETS_POSIX_NAMES, POSIX_CLOCK, PTHREAD_IPC, POSIX_MAX_FDS, and MAX_PTHREAD_COUNT. Here’s what I found:

  • NET_SOCKETS_POSIX_NAMES: Undefined, deprecated with POSIX API removal. I Commented out it.
  • POSIX_CLOCK: Deprecated, replaced by CONFIG_POSIX_TIMERS.
  • PTHREAD_IPC: Deprecated, replaced by CONFIG_POSIX_THREADS.
  • POSIX_MAX_FDS: Deprecated, replaced by CONFIG_ZVFS_OPEN_MAX.
  • MAX_PTHREAD_COUNT: Deprecated, replaced by CONFIG_POSIX_THREAD_THREADS_MAX.

I used Zephyr’s migrate_posix_kconfigs.py script to automate these replacements:

cd ~/zephyrproject/zephyr
python scripts/utils/migrate_posix_kconfigs.py -r ../modules/greybus/samples/subsys/greybus/net

This updated prj.conf, and I commented out NET_SOCKETS_POSIX_NAMES manually. This fixed Kconfig errors.

Buid output from:

west build -p always -b beagleconnect_freedom ../modules/greybus/samples/subsys/greybus/net

1 Like