<?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>Forem: Kate</title>
    <description>The latest articles on Forem by Kate (@embeddedk8).</description>
    <link>https://forem.com/embeddedk8</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%2F3542931%2Fe4741c11-7a13-4b56-980c-bddf49680308.png</url>
      <title>Forem: Kate</title>
      <link>https://forem.com/embeddedk8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/embeddedk8"/>
    <language>en</language>
    <item>
      <title>Initializing C and C++ projects with cmake-init</title>
      <dc:creator>Kate</dc:creator>
      <pubDate>Tue, 10 Feb 2026 18:12:37 +0000</pubDate>
      <link>https://forem.com/embeddedk8/initializing-c-and-c-projects-with-cmake-init-18cg</link>
      <guid>https://forem.com/embeddedk8/initializing-c-and-c-projects-with-cmake-init-18cg</guid>
      <description>&lt;p&gt;When I was starting new C or C++ projects, my usual approach was either googling for a “C project template”, digging through my old templates saved on my PC (because I stored them, didn't I?) or just building a fresh project from scratch: like set up directories, add initial source files and write a simple CMake. After that, the project structure would evolve naturally as I added tests, CI/CD, and other features.&lt;/p&gt;

&lt;p&gt;This setup used to take a large chunk of my time, &lt;br&gt;
and sometimes configuring additional quality tools felt like a real challenge. &lt;br&gt;
Yet, I had never heard of any real shortcuts beyond reusing my old templates.&lt;/p&gt;

&lt;p&gt;Does it sound like you? If yes, I have something that will literally change how you kick off a new project.&lt;/p&gt;
&lt;h3&gt;
  
  
  Just use the CMake project initializer
&lt;/h3&gt;

&lt;p&gt;It turns out the ideal solution has been around for four years, but I somehow didn't know about it, and I only just discovered it now.&lt;/p&gt;

&lt;p&gt;Meet &lt;a href="https://github.com/friendlyanon/cmake-init" rel="noopener noreferrer"&gt;cmake-init&lt;/a&gt; — an awesome open-source project &lt;br&gt;
that can completely tale care of creating your C/C++ projects with a professional structure, ready-made CMake setup, testing, and more.&lt;/p&gt;
&lt;h2&gt;
  
  
  What &lt;code&gt;cmake-init&lt;/code&gt; can do
&lt;/h2&gt;

&lt;p&gt;With a very short setup (just answer a few simple questions) we receive a perfect C or C++ project structure with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Advanced CMake structure&lt;/li&gt;
&lt;li&gt;Built-in versioning&lt;/li&gt;
&lt;li&gt;Unit tests template&lt;/li&gt;
&lt;li&gt;CI/CD on GitHub Actions running linters, coverage, sanitizers, and tests on Windows, Linux, and macOS&lt;/li&gt;
&lt;li&gt;Debug and release builds&lt;/li&gt;
&lt;li&gt;Doxygen documentation&lt;/li&gt;
&lt;li&gt;Package manager integration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s basically everything you need to start developing your project without wasting time on setup.&lt;/p&gt;

&lt;p&gt;What really surprised me was how smoothly it just worked. &lt;br&gt;
Usually, my experience with random open-source tools is that they require a fair bit of fighting before anything actually works.&lt;br&gt;
But this one just worked, effortlessly.&lt;/p&gt;
&lt;h2&gt;
  
  
  A quick setup note for Ubuntu 24.04
&lt;/h2&gt;

&lt;p&gt;The instruction mentions to install &lt;code&gt;cmake-init&lt;/code&gt; via the &lt;code&gt;pip install&lt;/code&gt; command, &lt;br&gt;
but Ubuntu 24.04 does not accept installing packages globally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kate@kate-Legion-Y540-15IRH-PG0:~$ pip install cmake-init
error: externally-managed-environment

× This environment is externally managed
╰─&amp;gt; To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python 
installation or OS distribution provider. You can override this, at 
the risk of breaking your Python installation or OS, by passing 
--break-system-packages.
hint: See PEP 668 for the detailed specification.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To install &lt;code&gt;cmake-init&lt;/code&gt;, I had to create a python virtual environment and &lt;br&gt;
install &lt;code&gt;cmake-init&lt;/code&gt; inside it. My project didn't need python virtual environment, but &lt;br&gt;
you only need to run &lt;code&gt;cmake-init&lt;/code&gt; once, so it's not a big cost for what you get.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install cmake-init
source myenv/bin/activate
pip install cmake-init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The new project created with &lt;code&gt;cmake-init&lt;/code&gt; is here: &lt;a href="https://github.com/embeddedk8/mini_armv6_emulator" rel="noopener noreferrer"&gt;mini_armv6_emulator&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>c</category>
      <category>cpp</category>
    </item>
    <item>
      <title>Testing embedded projects: automate builds and simulate execution with Github Actions and Wokwi simulator</title>
      <dc:creator>Kate</dc:creator>
      <pubDate>Fri, 21 Nov 2025 18:25:16 +0000</pubDate>
      <link>https://forem.com/embeddedk8/testing-embedded-projects-automate-builds-and-simulate-execution-with-github-actions-and-wokwi-350o</link>
      <guid>https://forem.com/embeddedk8/testing-embedded-projects-automate-builds-and-simulate-execution-with-github-actions-and-wokwi-350o</guid>
      <description>&lt;p&gt;Testing embedded projects often turns into a slow, manual routine—compile locally, flash hardware, then hope nothing breaks. And while hardware testing will always be important, developers shouldn’t need to rely on physical boards just to verify every small change.&lt;/p&gt;

&lt;p&gt;Introducing automation into embedded project is life-changing!&lt;/p&gt;

&lt;p&gt;In my full article, I show a practical workflow that automatically builds and tests Arduino projects using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arduino CLI for command-line builds&lt;/li&gt;
&lt;li&gt;GitHub Actions for CI/CD&lt;/li&gt;
&lt;li&gt;Wokwi for fast hardware simulation and automated behavior checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This setup means every push to GitHub gets compiled and executed in a simulator—no more broken builds going unnoticed.&lt;/p&gt;

&lt;p&gt;👉 Full tutorial: &lt;a href="https://www.embeddedk8.com/posts/2025/arduino-github-actions-with-wokwi/" rel="noopener noreferrer"&gt;Running wokwi simulation on CI/CD&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🛠️ What the Pipeline Does&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build Arduino firmware with Arduino CLI&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitHub Actions spins up a Linux runner, installs arduino-cli, grabs the board core (like arduino:avr), and compiles your sketch. If the build fails, you know immediately.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run the firmware in Wokwi&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Wokwi acts as a virtual Arduino Uno/Nano/Mega.&lt;br&gt;
You can assert expected serial output—for example, passing only if the simulated device prints some expected output, or otherwise —&lt;br&gt;
fail on some specific output.&lt;/p&gt;

&lt;p&gt;Every commit is checked automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧩 Why This Approach Helps&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No need to attach physical boards for quick checks&lt;/li&gt;
&lt;li&gt;Immediate detection of broken commits&lt;/li&gt;
&lt;li&gt;Easy to extend with more complex simulation setups&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;📝 Want the full version?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The complete article includes:&lt;/p&gt;

&lt;p&gt;✔ full workflow YAML&lt;br&gt;
✔ Wokwi project setup (wokwi.toml, diagram.json)&lt;br&gt;
✔ command examples&lt;br&gt;
✔ local simulation setup&lt;br&gt;
✔ complete build/test pipeline&lt;/p&gt;

&lt;p&gt;👉 Read the full guide here: &lt;a href="https://www.embeddedk8.com/posts/2025/arduino-github-actions-with-wokwi/" rel="noopener noreferrer"&gt;Running wokwi simulation on CI/CD&lt;/a&gt;&lt;/p&gt;

</description>
      <category>arduino</category>
      <category>embedded</category>
      <category>wokwi</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>Why using arduino-cli is better than building from Arduino IDE</title>
      <dc:creator>Kate</dc:creator>
      <pubDate>Sun, 16 Nov 2025 10:13:53 +0000</pubDate>
      <link>https://forem.com/embeddedk8/why-using-arduino-cli-is-better-than-building-from-arduino-ide-3c44</link>
      <guid>https://forem.com/embeddedk8/why-using-arduino-cli-is-better-than-building-from-arduino-ide-3c44</guid>
      <description>&lt;p&gt;&lt;em&gt;Detailed version of this article is published on &lt;a href="https://www.embeddedk8.com/posts/2025/arduino-cli-compilation/" rel="noopener noreferrer"&gt;EmbeddedK8&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Did you know you don’t need the Arduino IDE to build and upload sketches? With the Arduino CLI, you can compile and upload directly from the command line—using the same underlying process as the IDE.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use Arduino CLI?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;- Configuration flags and custom &lt;code&gt;#define&lt;/code&gt; options&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Control compiler flags, board settings, and custom #define values per project without touching configuration files. This allows fine-grained control for each board or sketch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Automated builds and CI/CD integration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Scripts for building, uploading, and testing can run on headless systems like Docker containers. This enables seamless integration into CI/CD pipelines for fully automated Arduino workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Reproducible builds across machines&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Everyone on your team can build with the same setup and dependencies, eliminating the classic “it works on my machine” problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- IDE flexibility&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Work in your favorite editor instead of the Arduino IDE.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Per-project library version control&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Specify exact library versions for each project, avoiding conflicts when multiple projects require different versions of the same library.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example Makefile
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# FQBN for your board (change if needed)
FQBN := arduino:renesas_uno:unor4wifi

# Serial port (change if needed)
PORT := /dev/ttyACM0

# Build dirs
BUILD_DEBUG := build/debug
BUILD_RELEASE := build/release

# Arduino CLI executable
ARDUINO_CLI := arduino-cli

# Default build release
all: release

debug:
    $(ARDUINO_CLI) compile \
        --fqbn $(FQBN) \
        --build-path $(BUILD_DEBUG) \
        --optimize-for-debug \
        --verbose

release:
    $(ARDUINO_CLI) compile \
        --fqbn $(FQBN) \
        --build-path $(BUILD_RELEASE) \
        --verbose

upload-debug: debug
    $(ARDUINO_CLI) upload \
        -p $(PORT) \
        --fqbn $(FQBN) \
        --input-dir $(BUILD_DEBUG)

upload-release: release
    $(ARDUINO_CLI) upload \
        -p $(PORT) \
        --fqbn $(FQBN) \
        --input-dir $(BUILD_RELEASE)

monitor:
    $(ARDUINO_CLI) monitor -p $(PORT)

clean:
    rm -rf build


.PHONY: all debug release upload-debug upload-release clean monitor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the Arduino CLI together with a simple Makefile makes building, uploading, and managing Arduino projects faster, more reproducible, and easier to automate. Whether you’re working solo or in a team, it gives you full control over compiler options, board settings, and dependencies—all without relying on the Arduino IDE. &lt;/p&gt;

&lt;p&gt;Give it a try, and you’ll see how much smoother your Arduino workflow can become!&lt;/p&gt;

</description>
      <category>embedded</category>
      <category>arduino</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Understanding the Arduino IDE build process</title>
      <dc:creator>Kate</dc:creator>
      <pubDate>Tue, 21 Oct 2025 06:42:28 +0000</pubDate>
      <link>https://forem.com/embeddedk8/understanding-the-arduino-ide-build-process-step-by-step-g61</link>
      <guid>https://forem.com/embeddedk8/understanding-the-arduino-ide-build-process-step-by-step-g61</guid>
      <description>&lt;p&gt;Have you tried Arduino and already built your first sketch with a single click? Or maybe you’re just starting to explore embedded devices and see Arduino as the easiest way to begin. Either way, understanding the internals of the build process is a great way to boost your skills!&lt;/p&gt;

&lt;p&gt;In this post, I’ll summarize the Arduino build process. &lt;/p&gt;

&lt;p&gt;For the full article, check out &lt;a href="https://www.embeddedk8.com/posts/2025/arduino-ide-build-process/" rel="noopener noreferrer"&gt;my guide on my blog&lt;/a&gt;, which contains more detailed explanation.&lt;/p&gt;

&lt;p&gt;The Arduino sketch build process follows the typical embedded/C++ application build steps, with additional Arduino-specifics.&lt;/p&gt;

&lt;p&gt;Since the Arduino IDE 2.0, the IDE uses Arduino CLI underneath for the build process. Steps will be the same when building directly via CLI.&lt;/p&gt;

&lt;h2&gt;
  
  
  General C/C++ application build process
&lt;/h2&gt;

&lt;p&gt;The general build process is shown below. Let’s take a closer look at how the Arduino environment adapts it.&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%2Fbfc7pt7mgngxk13a7h2i.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%2Fbfc7pt7mgngxk13a7h2i.png" alt="General C application build process" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Preprocessing – preparing the sketch
&lt;/h3&gt;

&lt;p&gt;This stage includes most of the Arduino-specific steps, designed to make development as easy as possible for beginners.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Combining files&lt;/strong&gt;: All &lt;code&gt;.ino&lt;/code&gt; files in the sketch folder are merged into a single &lt;code&gt;.cpp&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Detecting used libraries&lt;/strong&gt;: Libraries included via &lt;code&gt;#include&lt;/code&gt; are identified and stored for compilation and linking. This saves you the need to manually configure used libraries, like in other embedded development environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adding headers&lt;/strong&gt;: If &lt;code&gt;#include &amp;lt;Arduino.h&amp;gt;&lt;/code&gt; is missing, the Arduino environment adds it automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Function prototypes&lt;/strong&gt;: Missing prototypes are generated automatically. Thanks to this, you don't need to type them during development, and can add functions in any order.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Line directives&lt;/strong&gt;: &lt;code&gt;#line&lt;/code&gt; directives are added to maintain accurate line numbers in error messages. This is necessary because your code is written in &lt;code&gt;.ino&lt;/code&gt; files, which are automatically converted into &lt;code&gt;.cpp&lt;/code&gt; files during preprocessing, and the original line numbers are not matching the line numbers from post-processed &lt;code&gt;ino.cpp&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expanding code&lt;/strong&gt;: Expands macros and processes includes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Compilation
&lt;/h3&gt;

&lt;p&gt;Compilation is changing the human-readable code into assembly code, which later gets transformed into machine code. Modern compilers perform both compilation and assembly in one step.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sketch compilation&lt;/strong&gt;: The sketch is compiled using the board-specific compiler.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Library compilation&lt;/strong&gt;: All libraries detected in previous step are compiled.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Core compilation&lt;/strong&gt;: The Arduino core for the selected board is compiled.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Linking
&lt;/h2&gt;

&lt;p&gt;All compiled object files, used libraries and the Arduino core libraries are linked into a single &lt;strong&gt;ELF file&lt;/strong&gt; (Executable and Linkable Format).&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Generating binary files
&lt;/h2&gt;

&lt;p&gt;The ELF file is converted into &lt;strong&gt;HEX&lt;/strong&gt; and &lt;strong&gt;BIN&lt;/strong&gt;. The sketch is ready to upload to Arduino board.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: To see detailed compilation steps, enable &lt;strong&gt;"Show verbose output"&lt;/strong&gt; in Arduino IDE. This lets you track every step of the build process.&lt;/p&gt;

</description>
      <category>arduino</category>
      <category>build</category>
      <category>programming</category>
      <category>embedded</category>
    </item>
  </channel>
</rss>
