My Embedded Toolbox: Source Code Whitespace Cleanup

In this installment of my “Embedded Toolbox” series, I would like to share with you the free source code cleanup utility called QClean for cleaning whitespace in your source files, header files, makefiles, linker scripts, etc. You probably wonder why you might need such a utility? In fact, the common thinking is that compilers (C, C++, etc.) […]

Read More

My Embedded Toolbox: Programmer’s Calculator

Like any craftsman, I have accumulated quite a few tools during my embedded software development career. Some of them proved to me more useful than others. And these generally useful tools ended up in my Embedded Toolbox. In this blog, I’d like to share some of my tools with you. Today, I’d like to start […]

Read More

Beyond the RTOS: A Better Way to Design Real-Time Embedded Software

An RTOS (Real-Time Operating System) is the most universally accepted way of designing and implementing embedded software. It is the most sought after component of any system that outgrows the venerable “superloop”. But it is also the design strategy that implies a certain programming paradigm, which leads to particularly brittle designs that often work only […]

Read More

Fast, Deterministic, and Portable Counting Leading Zeros

Counting leading zeros in an integer number is a critical operation in many DSP algorithms, such as normalization of samples in sound or video processing, as well as in real-time schedulers to quickly find the highest-priority task ready-to-run. In most such algorithms, it is important that the count-leading zeros operation be fast and deterministic. For […]

Read More

Are We Shooting Ourselves in the Foot with Stack Overflow?

In the latest Lesson #10 of my Embedded C Programming with ARM Cortex-M Video Course I explain what stack overflow is and I show what can transpire deep inside an embedded microcontroller when the stack pointer register (SP) goes out of bounds. You can watch the YouTube video to see the details, but basically when the stack overflows, memory beyond the stack bound […]

Read More

Cutting Through the Confusion with ARM Cortex-M Interrupt Priorities

The insanely popular ARM Cortex-M processor offers very versatile interrupt priority management, but unfortunately, the multiple priority numbering conventions used in managing the interrupt priorities are often counter-intuitive, inconsistent, and confusing, which can lead to bugs. In this post I attempt to explain the subject and cut through the confusion. The Inverse Relationship Between Priority […]

Read More

Dual Targeting and Agile Prototyping of Embedded Software on Windows

When developing embedded code for devices with non-trivial user interfaces, it often pays off to build a prototype (virtual prototype) of the embedded system of a PC. The strategy is called “dual targeting”, because you develop software on one machine (e.g., Windows PC) and run it on a deeply embedded target, as well as on […]

Read More

Embedded C Programming with ARM Cortex-M Video Course

As part of my New Year’s resolution for 2013, I just started to teach an Embedded C Programming Course with ARM Cortex-M on YouTube. The playlist for this course is available at: . The course is intended for beginners and is structured as a series of short, focused, hands-on lessons that teach you how to program […]

Read More

The Best Christmas Present for a Nerd

Christmas is right around the corner and if you wonder about the presents, I have just an idea for you. No, it is not the new iPad, Galaxy S3 phone, or any of the new “ultrabooks”. In fact, this is exactly the opposite. My present idea is to boost your productivity in creating “content”, not merely consuming […]

Read More

RTOS, TDD and the “O” in the S-O-L-I-D rules

In Chapter 11 of the “Test-Driven Development for Embedded C” book, James Grenning discusses the S-O-L-I-D rules for effective software design. These rules have been compiled by Robert C. Martin and are intended to make a software system easier to develop, maintain, and extend over time. The acronym SOLID stands for the following five principles: S: […]

Read More