Weekly Progress Report: Replace GBridge

This is the Weekly Report page for the Replace GBridge Project.

Blog: https://programmershideaway.xyz/

Hello everyone. I just wanted to provide a brief project description along with Week 0 Progress update.

Project Goals

  • Introduce a Platform Driver that facilitates communication between AM6254 and CC1352 in BeaglePlay over UART.
  • Move SVC and APBridge roles from GBridge into CC1352 firmware.
  • Eliminate GBridge and other components that are no longer necessary.
  • Add a tutorial to the documentation to use the new setup.

Week 0

Accomplishments

  • Install Debian on BeaglePlay.
  • Explore BeaglePlay with ssh and hosted vscode.
  • Boot a custom Kernel on BeaglePlay.
  • Interact with BeagleConnect Freedom using tio
  • Interact with BeagleConnect Freedom sensors using micropython.
  • Write Introductory Blog Post
  • Post Introductory Video
  • Write a Hello World Kernel Module for BeaglePlay.

Upcoming Targets

  • Study the basics of the device tree.
  • Flash BeagleConnect Freedom with bcf greybus node firmware.
  • Implement serial device initialization.
  • Write a CI to check that the module compiles.
3 Likes

Week 1

Accomplishments

  • Write a serdev driver that uses AM62 to CC1352 serial port.
  • Apply a device tree overlay to BeaglePlay.
  • Write “HelloWorld” from Linux to CC1352.
  • Recieve “HelloWorld” from CC1352 to Linux. (Currently just used samples/drivers/uart/echo_bot)
  • Flash hello world zephyr to BeaglePlay CC1352.
  • Write a blog post to setup BeaglePlay.
  • Opened issue regarding broken cc2538 script.

Upcoming Targets

  • Write a CI to check that the module compiles.
  • Copy UART handling code to Zephyr Application.
  • Have an actual format for UART communication. Currently just writing arbitrary binary from both sides.
1 Like

Week 2

Accomplishments

Potential Blockers

  • Zephyr DNS resolver might not support mDNS discovery.

Upcoming Targets

  • Run some more Zephyr Greybus examples.
  • Setup Zephyr application logging into Linux Driver.
  • Use static address to connect to node for now.

Week 3

Accomplishments

Upcoming Targets

  • Open socket connection to Greybus Node.
  • Get greybus manifest from the node.

Week 4

Accomplishments

  • Establish socket connection with Cport 0 of greybus node.
  • Build a reliable way to keep track of all nodes and their respective cports.
  • Implement asynchronous processing of greybus operations (messages to send and responses to receive).
  • Switch to using static threads.
  • Send Greybus control requests from BeaglePlay CC1352 (ping, svc protocol version request and get manifest size request).
  • Receive a response from greybus node (for all of the above).
  • Use a unique id for each greybus operation.

Upcoming Targets

  • Get manifest from the Greybus node.
  • Establish connection with other cports of bcf node.
  • Implement more control operations.

Potential Blockers

  • Zephyr DNS resolver might not support mDNS discovery.

Week 5

Accomplishments

  • Parse Greybus manifest.
  • Connect to all CPorts after using data from Manifest
  • Refactor Code. Made things more thread-safe.
  • Switch to using Workqueue where it makes more sense.
  • Write a new blog post about concurrency primitives in Zephyr.

Upcoming Targets

  • HDLC over UART communication with Linux Driver.
  • Try using MCUmgr over HDLC for Zephyr application management.

Potential Blockers

  • Zephyr DNS resolver might not support mDNS discovery.
  • No userspace tool for checking hdlc implementation from userspace.

Week 6

Accomplishments

  • HDLC over UART working.
  • Logging over HDLC is also working (even faults).
  • Expose MCUmgr tty.
  • Initial MCUmgr support. Echo and Reset work.
  • Initial greybus communication between AP and SVC.

Upcoming Targets

  • Complete SVC-AP interactions
  • Complete connection nodes with AP.

Potential Blockers

  • Zephyr DNS resolver might not support mDNS discovery.
  • MCUboot on beagleplay cc1352 is quite complicated.
1 Like

Week 7

Accomplishments

  • Most of the SVC interactions working
  • APBridge is also working.
  • Connections with all Cports working.
  • BCF Node sensors show up on Linux hosts as devices.
  • MCUmgr tty taskstat working

Upcoming Targets

  • Fix bug that causes greybus to start failing after a few minutes
  • Cleanup Linux driver for upstreaming
  • Optimize Beagleplay CC1352 application

Potential Blockers

  • Zephyr DNS resolver might not support mDNS discovery.
  • MCUboot on Beagleplay cc1352 is quite complicated.

Week 8

Accomplishments

  • Fix HDLC bug in Linux driver
  • Refactor Linux Driver
  • Fix destroy connection in SVC.
  • Optimize APBridge

Upcoming Targets

  • Make MCUmgr support configurable
  • Cleanup Linux driver for Upstreaming
  • Create a demo with the new Architecture

Potential Blockers

  • Zephyr DNS resolver might not support mDNS discovery.
  • MCUboot on Beagleplay cc1352 is quite complicated.

Week 9

Accomplishments

  • Make MCUmgr support configurable in zephyr application
  • Format Zephyr application according to checkpatch
  • Format Linux driver according to checkpatch
  • Create a demo.
  • Initial implementation for dns-sd based discovery of bcf nodes
  • Setup things for sending patch to linux kernel mailing list

Upcoming Targets

  • Move dns-sd based discovery to main zephyr application.
  • Improve Linux driver for upstreaming.

Potential Blockers

  • MCUboot on Beagleplay cc1352 is quite complicated.
  • Leaving node idle seems to cause disconnection.

Week 10

Accomplishments

  • Implement dns-sd based greybus node discovery.
  • Fix resume after suspend for greybus node.

Upcoming Targets

  • Try using the Linux HDLC module in the driver.
  • Allow sending/receiving general networking packets to the 6LoWPAN network.

Potential Blockers

  • MCUboot on Beagleplay cc1352 is quite complicated.

Week 11

Accomplishments

  • Polish Zephyr application and fix bugs.
  • Allow starting and stopping SVC and APBridge without resetting CC1352.
  • Fix bug that caused system to hang on removing Linux driver.
  • Make Linux Driver gracefully start and stop SVC.

Upcoming Targets

  • Make HDLC implementation more suitable for upstreaming.
  • Refactor Zephyr application operations code.
  • Allow sending/receiving general networking packets to the 6LoWPAN network.

Potential Blockers

  • MCUboot on Beagleplay cc1352 is quite complicated.
2 Likes

Week 12

Accomplishments

  • Move away from System Heap. Allows finer control over heap memory requirements.
  • Fix some memory leaks.
  • Remove Module removal from the discovery code. This was causing reliability problems since sometimes nodes do not respond when under load. Now can easily withstand > 5 mins of continuous sensor reading with < 50ms latency for each read.
  • Extract node discovery to separate thread with lower priority.
  • Optimize node discovery. Now using binary search to search current nodes.
  • Some performance testing. Was able to get a latency of around 45ms when reading the temp sensor value. (tested with around 10k requests)

Upcoming Targets

  • Make HDLC implementation more suitable for upstreaming.
  • Allow sending/receiving general networking packets to the 6LoWPAN network.
  • Create a conclusion video and blog post.

Potential Blockers

  • Finding alternate to MCUboot for flashing without restart.
2 Likes