• Reproducible Firmware Builds

    In this article we will discuss what a Reproducible Build is, walk through the process of updating a firmware project so the build is reproducible, and explore how we can leverage what we have learned for other aspects of development.

  • What we've been reading in November

    Starting this month, we will be sharing with you what we have been reading at the end of each month. This will include blog posts, videos, tools, and libraries that we found insightful or useful.

  • How to debug a HardFault on an ARM Cortex-M MCU

    In this article, we explain how to debug faults on ARM Cortex-M based devices. In the process, we learn about fault registers, how to automate fault analysis, and figure out ways to recover from some faults without rebooting the MCU. We include practical examples, with a step by step walk-through on how to investigate them.

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

  • Using Asserts in Embedded Systems

    By using asserts proactively in embedded systems on debug and production builds, developers can both prevent more bugs before shipping and quickly surface and fix them after shipping. Proper assert handling is also the safest way to handle issues and undefined behavior that occur in production. In this post, we’ll go over best practices with asserts, when to use asserts, and then come up with a production ready custom assert implementation for an ARM Cortex-M device, all while keeping the code size usage to a minimum.

  • ARM Cortex-M RTOS Context Switching

    In this article we will explore how context switching works on ARM Cortex-M MCUs. We will discuss how the hardware was designed to support this operation, features that impact the context switching implementation such as the Floating Point Unit (FPU), and common pitfalls seen when porting an RTOS to a platform. We will also walk through a practical example of analyzing the FreeRTOS context switcher, xPortPendSVHandler, utilizing gdb to strengthen our understanding.

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

  • Embedded C/C++ Unit Testing Basics

    In this post, we go into detail on how to properly build abstractions to stub, fake, and mock out implementations of low level embedded software and provide a full real-world example of a unit test using the CppUTest 3.8 unit test framework.