Tag: toolchain

  • Differences Between ELF-32 and ELF-64

    The ELF object file format is one of the most commonly used today. Most build systems provide an output to this format, and ELF is commonly used to output coredumps. The format varies in subtle ways for 32-bit and 64-bit targets though, which can present problems for tools supporting both. This post will highlight the main differences and is intended as a quick reference for these differences.

  • MCU Peripheral Forwarding

    PC applications that interact with MCUs are used by developers for a number of reasons, such as data visualization, monitoring during testing campaigns, and command and control via a GUI. In this article, we’ll explore mapping an MCU’s peripherals to your personal computer to simplify development of PC applications built for embedded systems.

  • A Modern C Development Environment

    In this article we’ll go over how to set up a containerized development environment for C projects. We’ll touch on setting up a build system using CMake, a testing environment using Unity, and even how to use our containerized environment in our CI pipeline!

  • Pocket article: Debug vs. Release Builds Considered Harmful

    Separate “debug” and “release” builds are very common in embedded development. Typically the notion is improved debug capabilities (less aggressive compiler optimizations, more debugging information like logs) vs. highly optimized and hardened production release builds. I’m here to describe disadvantages to this practice, and why it might make sense to consolidate to a single build!

  • Pocket article: How to implement and use `.noinit` RAM

    This pocket article will describe how a non-initialized region of memory works, how to implement it, and how it can be used in a typical embedded system.

  • Automatically format and lint code with pre-commit

    This article provides some background and guidelines for using pre-commit to automatically format and lint C-language firmware codebases. We’ll cover general guidelines and go over an example set of checks that can be helpful when working on firmware code.

  • Peeking inside CMSIS-Packs

    In this article, we’ll take a look at what CMSIS-Packs are, and how they can be useful!

  • Profiling newlib-nano's memcpy

    This article takes a look at one of the commonly used functions provided by the Newlib C library: memcpy. We’ll examine the default nano implementation and the performance implications, comparing it against the faster non-default implementation.

  • Pocket article: Undefined Behavior Sanitizer Trap on Error

    This post is a brief overview on how the Undefined Behavior Sanitizer can be used to trap unintentional or error prone parts of a C program. We’re going to look at how it’s used on a desktop program, as well as a way to use it in small embedded programs!

  • Firmware Static Analysis with CodeChecker

    In this post, I go over how to set up CodeChecker on a firmware project to reap the benefits of static analysis. I’ll also cover ways to deal with false positives, and configure your assert functions to be analysis-friendly.

  • Seamless firmware development with PlatformIO

    In this post, I’d like to introduce PlatformIO. I will go over what PlatformIO is, how you can use it for your project, and what it is good at. I also highlight a few shortcomings worth keeping in mind.

  • Separating Unique Parameters from Firmware Binaries

    In this post, we take a look at a method for separating unique parameters such as keys and IDs from firmware. This enables us to program these parameters separately from the firmware, making our setup much more scalable and suitable for use in production.

  • Better Firmware with LLVM/Clang

    In this article, I hope I can convince you that adding a Clang build target to your project can be a relatively simple and useful endeavor. We will cover how to take advantage of some of the rich features shipped with the toolchain and identify some memory leaks and mutex deadlocks in an example project at compile time! We will also walk through a step-by-step example of updating a GCC based ARM Cortex-M project to cross-compile with LLVM/Clang.

  • A Shallow Dive into GNU Make

    This article explains general concepts and features of GNU Make and includes recommendations for getting the most out of a Make build! Consider it a brief guided tour through some of my favorite/most used Make concepts and features 🤗.

  • From Zero to main(): Bootstrapping libc with Newlib

    In this post, we will add RedHat’s Newlib to our firmware and highlight some of its features. We will implement syscalls, learn about constructors, and finally print out “Hello, World”! We will also learn how to replace parts or all of the standard C library.

  • The Best and Worst GCC Compiler Flags For Embedded

    In this article we will explore some of the best and worst compiler flags for GCC (and Clang). Our focus will be on flags used for embedded projects but the reasoning applies to other development environments as well. We will explore the impact each flag has by walking through practical C code examples.

  • Get the most out of the linker map file

    In this article, I want to highlight how simple linker map files are and how much they can teach you about the program you are working on.

  • Tools for Firmware Code Size Optimization

    In this series of posts, we’ll explore ways to save code space and ways not to do it. We will cover compiler options, coding style, logging, as well as desperate hacks when all you need is another 24 bytes.

    But first, let’s talk about measuring code size.