Saturday

Creating a Customized Zephyr Project + Arduino core

 Creating a Customized Zephyr Project + Arduino core

Working outside them boxes 

 I currently have 2 Arduino Uno Q boards in my possession, and figured I should use them or at least play around and experiment a bit. Since all of my initial attempts were foiled, I decided to develop my own Arduino core for the MCU side of things.


  The first challenges involved figuring out the initial layout of a custom build. It was surprisingly easy to setup and configure the Zephyr Project SDK and build a working Blinky example. Then I moved onto integrating the Arduino Core and API. This was way more challenging than expected, requiring me to understand the layout of the cores and how it all works together.

Then I moved onto the core Serial functionality, and it was waaay harder than it should have been. First was trying to understand all the links between the Router, the Monitor and Serial. In short, the router handles the comms between the MCU and Linux over RPC, which uses the same uart (lpuart1) as the Monitor and Serial, the difference is that messages of Serial & Monitor are labelled differently from Bridge messages. Fundamentally, they use the same protocol over RPC. They are all aliased together too.

In between attempts at figuring the Router Bridge functions out, I managed to get the LED Matrix library working! That included a big morale boost after struggling so much with the Bridge. It was easier than expected once I found out where they hid the core functions, apart from the main include files.

Then back it was to the Bridge. I found out in the begin function that a pointer was always returning NULL until I configured  CONFIG_DYNAMIC_THREAD_STACK_SIZE=2048 and related settings in my prj.conf file. Then it started to work, but got stuck again, in the begin function. I found out I had to modify another setting in my app.overlay file, to ensure the Bridge uart (lpuart1) started up immediately at boot.

 That's pretty much it for now! I think all the functionality I need is there, and I should be able to add anything that isn't. 

 I will update the repository for this code at https://github.com/TMRh20/Sketches/tree/master/ArduinoQ/ZephyrBuild very soon, to include the new features.

No comments:

Creating a Customized Zephyr Project + Arduino core

 Creating a Customized Zephyr Project + Arduino core Working outside them boxes   I currently have 2 Arduino Uno Q boards in my possession, ...