<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zuodian Hu</title>
    <description>The latest articles on DEV Community by Zuodian Hu (@zhu48).</description>
    <link>https://dev.to/zhu48</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F101997%2Fbfbf844f-22bd-4cac-8624-edd339e8588c.png</url>
      <title>DEV Community: Zuodian Hu</title>
      <link>https://dev.to/zhu48</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zhu48"/>
    <language>en</language>
    <item>
      <title>Using Xilinx SDK to Debug CMake-Defined Executables</title>
      <dc:creator>Zuodian Hu</dc:creator>
      <pubDate>Sat, 01 Dec 2018 04:01:28 +0000</pubDate>
      <link>https://dev.to/zhu48/using-xilinx-sdk-to-debug-cmake-defined-executables-h4j</link>
      <guid>https://dev.to/zhu48/using-xilinx-sdk-to-debug-cmake-defined-executables-h4j</guid>
      <description>&lt;h1&gt;
  
  
  The Thing
&lt;/h1&gt;

&lt;p&gt;After arduously pushing through a number of roadblocks, I can now use Xilinx SDK to debug executables defined through a CMake script.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Background
&lt;/h1&gt;

&lt;p&gt;In the previous posts in this series, I summarized the &lt;a href="https://github.com/AlphaAutomata" rel="noopener noreferrer"&gt;Alpha Automata&lt;/a&gt; project and my journey towards generating Xilinx SDK projects using CMake.&lt;/p&gt;

&lt;p&gt;I want CMake's dependency management and automation, and I want to use Xilinx SDK's debugger. Therefore, I must figure out a way to run executables compiled using CMake-generated build systems in Xilinx SDK's debugger. I have spent a lot of my free time in the past three weeks on figuring out how to do just that.&lt;/p&gt;

&lt;h1&gt;
  
  
  CMake Meets Xilinx System Debugger
&lt;/h1&gt;

&lt;p&gt;Three weeks ago, I had figured out how to generate a Xilinx SDK project using CMake. The last post in this series describes that journey.&lt;/p&gt;

&lt;h3&gt;
  
  
  CMake Invisible
&lt;/h3&gt;

&lt;p&gt;I could import the SDK project, and compile and link and &lt;code&gt;elf&lt;/code&gt; file. However, Xilinx SDK would not give me the option of setting up a debugging profile for the executable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgnct2kym6no9su4b3z96.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgnct2kym6no9su4b3z96.PNG" alt="no_project" width="619" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, Xilinx SDK refuses to acknowledge the existence of my imported project.&lt;/p&gt;

&lt;p&gt;I spent a long time prowling Google without getting a satisfactory answer. In fact, I didn't find many people who were even talking about mashing CMake and Xilinx SDK together. Frustrated with this lack of information, I started experimenting. I created application projects using the Xilinx SDK GUI, and compared the configurations of those projects against the configurations of my imported CMake-generated project. Almost by accident, I found the checkbox I needed to tick:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fip6cs5vfq8ctiija2bxx.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fip6cs5vfq8ctiija2bxx.PNG" alt="proj_ref" width="505" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The imported project must be set to reference the target SoC's Board Support Package project in the imported project's &lt;code&gt;Project Properties&lt;/code&gt;. With this one box checked, Xilinx SDK acknowledged my imported project as a candidate for a debugging profile.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkrl7mpd3dxts735ox3t.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkrl7mpd3dxts735ox3t.PNG" alt="yes_project" width="666" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I could finally designate the executable compiled using the imported, CMake-generated project for debugging.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcrlhgt4h3bt4ehe13apf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcrlhgt4h3bt4ehe13apf.PNG" alt="executable" width="745" height="606"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point, I was ecstatic. As is true for so many things in software, finding the solution took way too long, and the solution turned out to be way too simple.&lt;/p&gt;

&lt;h3&gt;
  
  
  CMSIS vs Zynq
&lt;/h3&gt;

&lt;p&gt;I happily hit the &lt;code&gt;debug&lt;/code&gt; button to run my executable on the target SoC...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovakrfqkxzgol7nfbscb.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovakrfqkxzgol7nfbscb.PNG" alt="load_err" width="534" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...and Xilinx SDK spat in my face just as happily.&lt;/p&gt;

&lt;p&gt;I also looked up the address called out in the error to see if it's a legal address for my particular chip to access, and the answer was a resounding "maybe".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7bxd48xzt9fe17d5mezy.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7bxd48xzt9fe17d5mezy.PNG" alt="addr" width="800" height="151"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;According to the Xilinx documentation, address &lt;code&gt;0x8000_0000&lt;/code&gt; marks the beginning of a programmable logic memory region. In other works, this is one of the address ranges used to read from and write to FPGA logic. Since I hadn't implemented anything in my Zynq SoC's FPGA fabric for this debugging session, my code certainly shouldn't be accessing the FPGA fabric memory range. It just so happens that the CMSIS linker script I was using designates address &lt;code&gt;0x8000_0000&lt;/code&gt; as the beginning of ROM.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2tt8zg60ub658x24j03.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2tt8zg60ub658x24j03.PNG" alt="cmsis" width="681" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point, I groaned to myself. Xilinx SDK automatically generates linker scripts for application projects created using its GUI. And as many times as I hit the &lt;code&gt;Generate linker script&lt;/code&gt; button for my CMake-generated project, Xilinx SDK refused to do anything of the sort. In a wild stab into the dark, I designated no linker script and just let GCC choose where it wanted to place all the binary blocks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh3rrks6wsccdaoqtq05b.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh3rrks6wsccdaoqtq05b.PNG" alt="debug" width="490" height="599"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And it worked. And I grew a whole new appreciation for GCC and ARM's consistent startup behavior.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;All ARM processors immediately fetch the initial stack pointer and initial program counter from a vector table at address &lt;code&gt;0x00000000&lt;/code&gt; or &lt;code&gt;0xFFFF0000&lt;/code&gt;, depending on the specific processor. This vector table can be moved using the Vector Base Address Register (VBAR).&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The State of Alpha
&lt;/h1&gt;

&lt;p&gt;Since last month, not much has changed. I've literally devoted three weeks to get CMake and Xilinx SDK to play nice with each other.&lt;/p&gt;

&lt;h1&gt;
  
  
  Onwards and Upwards
&lt;/h1&gt;

&lt;p&gt;Now that I have a debugger running on real hardware, I expect to make faster progress implementing the RTOS and to spend less time wrestling with my tools.&lt;/p&gt;

&lt;p&gt;I said I would try really hard to post every two weeks, and I did. Things started picking up for me at my real job, and ThanksGiving conspired with my fiance to make me socialize. Hopefully, I'll make one more post before Christmas and my fiance kidnap me.&lt;/p&gt;

</description>
      <category>cmake</category>
      <category>xilinx</category>
      <category>toolchains</category>
      <category>embedded</category>
    </item>
    <item>
      <title>Using CMake to Generate Eclipse Projects</title>
      <dc:creator>Zuodian Hu</dc:creator>
      <pubDate>Sat, 10 Nov 2018 01:43:17 +0000</pubDate>
      <link>https://dev.to/zhu48/alphaautomata---2018-11-09-3j3p</link>
      <guid>https://dev.to/zhu48/alphaautomata---2018-11-09-3j3p</guid>
      <description>&lt;h1&gt;
  
  
  The Thing
&lt;/h1&gt;

&lt;p&gt;As of an &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS/issues/6"&gt;issue&lt;/a&gt;-closing &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS/commit/0a0165c3c98175a44c7848c156de1f5678cc3e18"&gt;commit&lt;/a&gt; today, &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS"&gt;Alpha RTOS&lt;/a&gt; has a build process I'm happy to use to develop it with.&lt;/p&gt;

&lt;p&gt;Using a CMake &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS/blob/master/build/CMakeLists.txt"&gt;project script&lt;/a&gt; with an associated &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS/blob/master/build/toolchain.cmake"&gt;toolchain script&lt;/a&gt;, I am now able to run compilation of the Alpha kernel in the following environments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Xilinx SDK on Windows&lt;/li&gt;
&lt;li&gt;Ubuntu (in the Windows Subsystem for Linux flavor)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm sad that Visual Studio 2017 is not on that list, but for some reason CMake refuses to discover the Microsoft compiler.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Background
&lt;/h1&gt;

&lt;p&gt;In my &lt;a href="https://dev.to/zhu48/alphaautomata---2018-10-03-471f"&gt;first ever post&lt;/a&gt;, I summarized &lt;a href="https://github.com/AlphaAutomata"&gt;Alpha Automata&lt;/a&gt;'s origins, its status at the time, and where I want to develop it into.&lt;/p&gt;

&lt;p&gt;Since this project involves VHDL modules, a lot of my development will occur on a Xilinx Zynq SoC. My current priority is to get the &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS"&gt;Alpha RTOS&lt;/a&gt; kernel running, for several reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I want to deepen my knowledge of real-time operating systems.&lt;/li&gt;
&lt;li&gt;I want to design and implement a somewhat complex, highly modular system that I can be proud of. None of the other &lt;a href="https://github.com/AlphaAutomata"&gt;Alpha Automata&lt;/a&gt; components are nearly as complex as an RTOS.&lt;/li&gt;
&lt;li&gt;A &lt;a href="https://www.youtube.com/watch?v=c9Xt6Me3mJ4&amp;amp;t=2342s"&gt;C++Now 2018 talk&lt;/a&gt; gave me, for the first time, a good example of how to use CMake toolchain files. This inspired me to lay the groundwork for using CI/CD in &lt;a href="https://github.com/AlphaAutomata"&gt;Alpha Automata&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Having a working RTOS makes writing and running test code snippets for every other part of &lt;a href="https://github.com/AlphaAutomata"&gt;Alpha Automata&lt;/a&gt; easier.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last two bullet points in that list led me to create CMake scripts for &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS"&gt;Alpha RTOS&lt;/a&gt; now, instead of just using projects manually set up in Xilinx SDK and leaving CMake for later.&lt;/p&gt;

&lt;h1&gt;
  
  
  The CMaking Of
&lt;/h1&gt;

&lt;p&gt;The &lt;a href="https://www.youtube.com/watch?v=c9Xt6Me3mJ4&amp;amp;t=2342s"&gt;C++Now 2018 talk&lt;/a&gt; showed CMake examples for compiling bare-metal executable images outside of any IDEs. For &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS"&gt;Alpha RTOS&lt;/a&gt;, I want to compile a bare-metal static library in Xilinx SDK. Compiling a static library using Xilinx SDK allows me to skip the tedium of studying the Zynq memory map to create a linker script and trying to figure out how to compile Xilinx libraries that initialize Zynq-specific registers. Using Xilinx SDK forces me to learn how to generate Eclipse projects using CMake.&lt;/p&gt;

&lt;p&gt;I welcomed the chance to learn how to generate Eclipse projects using CMake. When I was in &lt;a href="https://github.com/WisconsinRobotics"&gt;Wisconsin Robotics&lt;/a&gt;, we created a &lt;a href="https://github.com/WisconsinRobotics/BadgerCommandLibrary"&gt;packet library&lt;/a&gt; built using CMake to target Linux and Windows. I wanted the embedded target build system (we used Code Composer Studio at the time) to also use CMake, but we never found the time to make that happen.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS/commit/98c2bcadda4a50ea58bc27492a7510c52723986c#diff-58b29f322932c0c2e13d8ead532526bb"&gt;first version&lt;/a&gt; of the CMake scripts for &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS"&gt;Alpha RTOS&lt;/a&gt; closely mirror the examples from the &lt;a href="https://www.youtube.com/watch?v=c9Xt6Me3mJ4&amp;amp;t=2342s"&gt;C++Now 2018 talk&lt;/a&gt;. This was my first attempt at writing a cross-compiling CMake script, and I only wanted to get it to work at all. The &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS/commit/98c2bcadda4a50ea58bc27492a7510c52723986c#diff-58b29f322932c0c2e13d8ead532526bb"&gt;first version&lt;/a&gt; of these scripts could run compilations targeting the host system, and cross-compile on Linux. However, I couldn't generate an eclipse project using the Eclipse CDT generators provided by CMake. Even if I gave CMake the proper paths to the ARM-target compilers, the CMake Eclipse CDT generators kept making this complaint:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CMake Error: CMake was unable to find a build program corresponding to "Unix
Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a
different build tool.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After some reading and experimentation, I figured out that I needed to point CMake to a proper &lt;code&gt;make&lt;/code&gt; executable. After some more digging around, I found out that Xilinx distributes a bunch of GNU tools, including &lt;code&gt;make&lt;/code&gt; and &lt;code&gt;gcc&lt;/code&gt;, with Xilinx SDK. Armed with this new knowledge, I &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS/commit/036c626aecb7e75f12e8ee96129ba7c6394552ae#diff-58b29f322932c0c2e13d8ead532526bb"&gt;made improvements&lt;/a&gt; to the &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS"&gt;Alpha RTOS&lt;/a&gt; CMake scripts. They toolchain script now makes use of the tools distributed by Xilinx when given a Xilinx SDK version and the Xilinx SDK installation directory.&lt;/p&gt;

&lt;p&gt;This generated Eclipse project files that I could import into Xilinx SDK, but for some weird reason, the project wouldn't compile. The compiler kept complaining about not being able to find any of the &lt;code&gt;#include&lt;/code&gt; files. I scoured the Internet for answers, but found none. Finally, I took the compile command from the SDK console and tried playing around with it in PowerShell. It took me less than ten minutes to figure out what hours of Google searching couldn't tell me: the GCC version distributed by Xilinx doesn't process &lt;code&gt;-I&lt;/code&gt; include paths that have &lt;code&gt;..&lt;/code&gt; in them.&lt;/p&gt;

&lt;p&gt;Running &lt;code&gt;gcc&lt;/code&gt; with this flag works:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-IC:/SVC/AlphaAutomata/AlphaRTOS/api
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Running &lt;code&gt;gcc&lt;/code&gt; with this flag fails:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-IC:/SVC/AlphaAutomata/AlphaRTOS/build/../api
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;My CMake script set parent directories using &lt;code&gt;set&lt;/code&gt; and the &lt;code&gt;..&lt;/code&gt; special directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight cmake"&gt;&lt;code&gt;&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;PARENT_DIR &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CURRENT_DIR&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;/..&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Using &lt;code&gt;get_filename_component&lt;/code&gt; fixed my problem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight cmake"&gt;&lt;code&gt;&lt;span class="nb"&gt;get_filename_component&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;PARENT_DIR &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CURRENT_DIR&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; DIRECTORY&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;With this fix in the [latest version], I can now run compilation using a Xilinx SDK project generated using CMake.&lt;/p&gt;

&lt;h1&gt;
  
  
  The State of Alpha
&lt;/h1&gt;

&lt;p&gt;Since last month, not much has changed. I've defined the &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS"&gt;Alpha RTOS&lt;/a&gt; API and internal architecture some more, but the kernel is nowhere near a usable state. Now that the CMake scripts are working, I hope to make faster progress.&lt;/p&gt;

&lt;h1&gt;
  
  
  Onwards and Upwards
&lt;/h1&gt;

&lt;p&gt;I will continue working on &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS"&gt;Alpha RTOS&lt;/a&gt; to get the kernel running and solidify the API.&lt;/p&gt;

&lt;p&gt;I made a promise to post on Dev every Wednesday, but the last time I posted was a month ago. I can't stick to a weekly schedule because of work and other life pressures, but I will try really hard to post every two weeks.&lt;/p&gt;

</description>
      <category>cmake</category>
      <category>eclipse</category>
      <category>toolchains</category>
      <category>embedded</category>
    </item>
    <item>
      <title>My Pet Project</title>
      <dc:creator>Zuodian Hu</dc:creator>
      <pubDate>Wed, 03 Oct 2018 06:11:10 +0000</pubDate>
      <link>https://dev.to/zhu48/alphaautomata---2018-10-03-471f</link>
      <guid>https://dev.to/zhu48/alphaautomata---2018-10-03-471f</guid>
      <description>

&lt;h1&gt;The Thing&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/AlphaAutomata"&gt;Alpha Automata&lt;/a&gt; is my cute name for my side project - a highly-modular command and control stack for robotics and automation. As of right now, I envision it to eventually have the following components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A ROS package acting as a gateway for higher-level applications&lt;/li&gt;
&lt;li&gt;A physical-layer-agnostic packet protocol for inter-device communications&lt;/li&gt;
&lt;li&gt;An &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS"&gt;RTOS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A set of SOC peripheral drivers&lt;/li&gt;
&lt;li&gt;A set of &lt;a href="https://github.com/AlphaAutomata/rtl_devices/tree/master/pwm/hdl"&gt;VHDL AXI peripherals&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A set of &lt;a href="https://github.com/AlphaAutomata/digital_io"&gt;VHDL I/O modules&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;The Background&lt;/h1&gt;

&lt;p&gt;Back in college, I wrote embedded software for &lt;a href="https://github.com/WisconsinRobotics"&gt;Wisconsin Robotics&lt;/a&gt; and &lt;a href="https://github.com/BadgerRoboticMiningTeam"&gt;Badger Robotic Mining Team&lt;/a&gt;. I wrote my first tasks and drivers for Wisconsin Robotics' &lt;a href="https://www.freertos.org/"&gt;FreeRTOS&lt;/a&gt; applications, and wrote a &lt;a href="https://github.com/BadgerRoboticMiningTeam/LaunchPad"&gt;custom RTOS&lt;/a&gt; for Badger Robotic Mining Team. Through all that development, I found my love for operating systems, hardware-controlling software, and the pillar of good engineering that is abstraction.&lt;/p&gt;

&lt;p&gt;My current job revolves around porting a legacy GUI application to a modern desktop OS while documenting the source code. Having found no creative outlet where I can scratch my itch for embedded systems at work, I have decided to re-architect the RTOS I wrote in college and start building an entire framework around it.&lt;/p&gt;

&lt;h1&gt;The Goal&lt;/h1&gt;

&lt;p&gt;I don't see my framework supplanting FreeRTOS or &lt;a href="https://www.zephyrproject.org/"&gt;Zephyr&lt;/a&gt;. In fact, the Zephyr project does everything I could ever want my own RTOS to do and more, and would be my choice for any serious robotics projects I want to start down the road. I do see the development of my framework, and the writing of my posts here on Dev, honing and expanding my engineering skill set.&lt;/p&gt;

&lt;p&gt;A secondary goal of mine is to flush out all the Dev users who are even mildly interested in embedded systems, hardware hacking, IoT, or other such things. As an embedded systems enthusiast, I find it lonely here on a platform seemingly dominated by web developers.&lt;/p&gt;

&lt;h1&gt;The State of Alpha&lt;/h1&gt;

&lt;p&gt;I have barely begun this ambitious side project. As of right now, almost none of the components I listed earlier are in a presentable state:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A ROS package acting as a gateway for higher-level applications

&lt;ul&gt;
&lt;li&gt;I have never written a single line of code for a ROS package&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;A physical-layer-agnostic packet protocol for inter-device communications

&lt;ul&gt;
&lt;li&gt;I have not made an attempt to start this yet&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;An &lt;a href="https://github.com/AlphaAutomata/AlphaRTOS"&gt;RTOS&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;I have finished stripping the non-portable code from my college RTOS, and have barely worked out what I think the API should be. I aspire to be even half of what Zephyr is, so I'll probably try to magic the Zephyr API, the CMSIS RTOS API, and the POSIX API together into something mildly usable&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;A set of SOC peripheral drivers

&lt;ul&gt;
&lt;li&gt;No attempt to start this, but I am writing drivers for the VHDL AXI peripherals as I go&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;A set of &lt;a href="https://github.com/AlphaAutomata/rtl_devices/tree/master/pwm/hdl"&gt;VHDL AXI peripherals&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;I have tested my PWM module, and it works! I have certainly not tried all the edge cases&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;A set of &lt;a href="https://github.com/AlphaAutomata/digital_io"&gt;VHDL I/O modules&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;My UART, PWM, and quadrature modules all work in functional simulation. Who knows if they will all work on hardware?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Onwards and Upwards&lt;/h1&gt;

&lt;p&gt;I plan on posting my progress here on Dev every Wednesday, and those who are interested can look at my GitHub easily enough.&lt;/p&gt;


</description>
      <category>rtos</category>
      <category>embedded</category>
      <category>operatingsystems</category>
      <category>robotics</category>
    </item>
  </channel>
</rss>
