• Fix Bugs and Secure Firmware with the MPU

    Many ARM MCUs implement an optional unit, known as the Memory Protection Unit (MPU), which lets you control how regions of memory are accessed. In this article, we will deep dive into the unit and walk through a few practical examples of how it can be used to prevent bad memory accesses and security exploits on Cortex-M devices.

  • 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.

  • Automate Debugging with GDB Python API

    Previously we discussed how a significant portion of developer time is spent debugging firmware and how GDB can be a powerful utility for this. In this article we will discuss how to become more efficient at debugging by leveraging GDB’s Python API.

  • From Zero to main(): Demystifying Firmware Linker Scripts

    Last time, we talked about bootstrapping a C environment on an MCU before invoking our main function. One thing we took for granted was the fact that functions and data end up in the right place in our binary. Today, we’re going to dig into how that happens by learning about memory regions and linker scripts.

  • Tools for Firmware Code Size Optimization

    Every firmware engineer has run out of code space at some point or another. Whether they are trying to cram in another feature, or to make enough space for A/B firmware updates more code space is always better.

    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.

  • GNU Build IDs for Firmware

    In this post, we demonstrate how to use the GNU Build ID to uniquely identify a build. We explain what the GNU build ID is, how it is enabled, and how it is used in a firmware context.

  • Debugging Firmware with GDB

    If I had to choose one significant aspect that I was not aware of before starting my career as a firmware developer, it would be how much time is spent not actually developing, and instead debugging firmware!

  • From Zero to main(): Bare metal C

    Throughout the Zero to main() series of posts, we demystify what happens between when power is applied and your main function is called. In the process, we’ll learn how to bootstrap a C environment, implement a bootloader, relocate code, and more!