Embedded systems software developers are faced with a difficult challenge in today’s world: how can we build systems at a high quality with increasingly tight schedules? Our systems are getting more complex, and it always feels like we have less time to build them. We need to find a way to turn the tables on this situation.
At Embedded Artistry, we believe that one solution is to increase the capabilities of embedded systems developers and teams. We can increase everyone’s output quality and productivity by leveraging tools and creating reusable software components. We need to make it easier to do a good job by default.
For the past four years, we’ve been focused on just that. As consultants and contract developers, we had a vested interest in finding ways to work faster while simultaneously improving quality: it allowed us to complete projects quickly and to provide ambitious service guarantees to our clients. We found these concepts to be so helpful in our work that we must share what we’ve learned with you. Our hope is that you can improve your own capabilities by following our process. Or, even better: carry these ideas further by adding improvements of your own.
This course is the first in a series that outlines our approach to increasing your embedded software development capabilities.
The foundational step is to master a modern build system, such as Meson or CMake. These tools massively simplify the process of constructing software. They are also powerful: we can easily support multiple toolchains and operating systems with one set of build rules. They help us reduce the burden of managing and integrating external dependencies and tools. They allow us to integrate our unit testing programs and quality enforcement steps (e.g., static analysis and auto formatting) into our build process. That’s what we’ll focus on in this course.
Once you’ve mastered a build system and implemented support for projects, the next step is to modularize our commonly-used build modules and create a reusable project skeleton. Having a project skeleton allows you to quickly bring up new projects with out-of-the-box support for static analysis, code formatting, unit testing, and continuous integration. You can take this a step further and automate the deployment of a project skeleton, which enables you to set up new projects and install dependencies on fresh systems with a single command.
These are merely the first steps on the journey of increasing your effectiveness.
Course Overview
Meson is Embedded Artistry’s primary build system, beating out even the widely popular CMake in our eyes. We find its syntax and dependency management much easier to work with than CMake’s. Meson also has a superior approach to cross-compilation, enabling us to manage both cross-compiled and build-machine-only targets (like unit tests) in a single build folder.
If you already use Meson, or don’t want to follow along with our approach to learning the language, you might prefer to skip ahead to Building a Reusable Project Skeleton with Meson, which showcases some advanced uses of Meson while creating a modular build system and reusable project skeleton.
We provide a hands-on approach for learning to use Meson. You’ll create a complex build system from scratch, learning the language as you go. Most tutorials (for any new language) typically provide you with only the most basic examples, which never seem to be instructive enough for the complexity of real-world needs. We will teach you all of the necessary skills for managing complex projects that must support multiple processor architectures, build with multiple toolchains, and work on multiple OSes.
In this course, you will learn to:
- Create complex build systems with Meson in a way that works for embedded projects
- Cross-compile your software for multiple embedded processors (using
arm-none-eabi-gcc) - Support multiple toolchains without needing to modify your build files (Clang, GCC, even different versions of GCC)
- Support multiple operating systems (MacOS, Linux, Windows with WSL)
- Integrate external tools into your build process, such as automated code formatting, static analysis, and
objcopyfor.binand.hexfile creation - Create a standardized build interface that can be used across all of your projects
At the end of this course, you will be comfortable using Meson to create new build systems from scratch. You will be ready to use Meson for your own projects and prepared to tackle a variety of complex build scenarios.
You will also have a working build system that can serve as a reference, or that can be refactored into a reusable project skeleton that will enable you to quickly bring up new projects.
Time Commitment
Using an average reading speed of 250 wpm, we estimate that the course will require:
- Reading: 6 hours
- Exercises: 8 hours
Prerequisites
This course assumes you are conceptually familiar with build systems and building software outside of an IDE. The course does not cover what a build system is, how software is constructed by the compiler and linker, or what cross-compiling actually means. Our focus is on introducing Meson and teaching you how to apply the language to create a complex, embedded-focused project. If you are not familiar with these topics, we recommend starting with our prerequisite course: Introduction to Build Systems.
No hardware is required for this course, although we do cross-compile the software for an nRF52 and two STM32 processors.
Support
We’re here to help you if you get stuck! Our course is designed to be as comprehensive as possible, but also challenging. You can always ask questions or get help in the Course Support section of the forum, through private messages in the course interface, and also through private messages in the forum.
