embedded software boot camp

Recent Posts

sort by category

Proposed Rule Changes for Embedded C Coding Standard

My book Embedded C Coding Standard began as an internal coding standard of a consulting company and was first published in 2008 by that company (Netrino). In 2013, the book's cover was given a new look and the standard became known as "Barr Group's Embedded C Coding Standard". A 2018 update to the book will be released soon and this will be the first time the substance of the standard has changed in over a decade. The primary motivation for making changes is to better harmonize the rules wi...

C's goto Keyword: Should we Use It or Lose It?

In the 2008 and 2013 editions of my bug-killing Embedded C Coding Standard, I included this rule: Rule 1.7.c. The goto keyword shall not be used. Despite this coding standard being followed by about 1 in 8 professional embedded systems designers, none of us at Barr Group have heard any complaints that this rule is too strict. (Instead we hear lots of praise for our unique focus on reducing intra-team stylistic arguments by favoring above all else C coding rules that prevent bugs.) ...

The Rise of the Full Stack Developers

I'm a connector within our embedded systems design community and, so, my LinkedIn account has more than 15,000 connections. Which is where I recently started to spot what appears to be an emerging industry trend: so-called "full stack developers" have begun to enter the embedded software realm. While many self-identified firmware developers and embedded programmers have come up to the field from the electronics side, often cutting their teeth in electrical engineering and digital design firs...

Survey Says: The Commercial RTOS Business is Doomed

Nearly two decades years ago I was the moderator of an interesting Embedded Systems Conference panel discussion titled "The Great RTOS Debate: Buy or Roll Your Own?" At that time, near the turn of the century, the market for commercial real-time operating systems (RTOSes) was growing rapidly year over year. The big trend then was away from custom-written "proprietary" kernels toward commercial RTOSes typically licensed with a per unit royalty. From 1997 until their merger in 2000, Wind Rive...

C: The Immortal Programming Language

Barr Group's 2018 Embedded Systems Safety & Security Survey is now closed and I am in the midst of analyzing the data. This year a portion of my analysis is focused on multi-year trends. One trend that really stands out to me is that the C programming language refuses to give up the ghost. A longitudinal study of survey data spanning almost a decade and a half shows that C remains the primary programming language of embedded software. Remarkably, in that time C has actually gained market s...

Is it a Bug or an Error?

Probably you've heard the story of how Adm. Grace Hopper attached a moth that was dislodged from a relay in the Harvard Mark II mainframe to an engineering notebook and labeled it the "First actual case of bug being found." Designers of electronics, including Thomas Edison, had been using the term bug for decades. But it was mostly after this amusing 1947 event hat the use of words like "bugs" and "debugging" took off in the emerging software realm. So why is it that if a bridge coll...

Attention Embedded Systems Designers!

It's time again for Barr Group's annual survey of professional designers of embedded systems. If your job involves writing embedded software (aka, firmware) and/or designing electronics, please participate by clicking on this link: Thanks for your help; the survey is now closed. The survey is completely anonymous and should take you only about 5-7 minutes to complete. If you wish to provide your e-mail address (completely optional, at the end) you will receive a free PDF report of ...

New BlueBorne Security Flaw Affects Embedded Systems Running Linux

A major security flaw in the Bluetooth communications protocol was recently discovered and has since been confirmed as exploitable in the real world. It is important that designers of embedded systems are aware of this security issue potentially affecting their products. So-called "BlueBorne" is an attack that can be performed over the air against an estimated 8.2 billion Bluetooth-enabled computers, including those that run operating systems variants such as Microsoft Windows, Apple's OS-X ...

C's strcpy_s(): C11's More Secure Version of strcpy()

Buffer overflows are a well-known port of entry for hackers and attackers of computerized systems. One of the easiest ways to create a buffer overflow weakness in a C program has long been to rely on the strcpy() function of the C standard library to overwrite data. There's a decent explanation of the problem at http://www.thegeekstuff.com/2013/06/buffer-overflow/. But the nutshell version is that you have a buffer of size X somewhere in memory that your code uses strcpy() to overwrite ne...

Did a Cyberattack Cause Recent Crashes of U.S. Naval Destroyers?

Crashes involving naval vessels are rare events. Yet somehow two of the U.S. Navy's guided-missile destroyers have crashed into other ships in as many months: June 17: U.S.S. Fitzgerald Almost Foundered After Collision, Bodies Found August 21: U.S.S. John S. McCain Suffered Flooding After Deadly Collision Might these deadly crashes share a common root cause? Both ships are part of the Seventh Fleet, which is headquartered in Yokosuka, Japan. The word is that the second accident...

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.) ignore whitespace anyway, so why bother? But, as a professional software developer you should not ignore whitespace, because it can cause all sorts of pr...

EEPROM Wear Leveling

A problem that occurs from time to time is the need for an embedded system to keep track of the number of doodads it has processed since it was put in to service. Clearly you can't keep this value in RAM as it will be lost when power is removed. Thus the obvious solution is to store the count in EEPROM. However, common EEPROM  specifications are 10^5 guaranteed write cycles, with 10^6 typical write cycles. If you expect to process say 20 million doodads during the life of your product you clear...

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 with my cross-platform Programmer's Calculator called QCalc. I'm sure that you already have your favorite calculator online or on your smartphone. But can your calculator accept complete ...

Hamming distances

My guess is that most readers of this blog have at least a vague idea of what "Hamming distance" is.  At the most abstract level it is a measure of how different two equal length "strings" are. In the case where the "strings" are actually binary integers, then the the Hamming distance is simply the number of bit positions that differ. Thus if we are comparing 8-bit integers, then the values 0x00 and 0x01 have a Hamming distance of 1, whereas 0xFF and 0x00 have a Hamming distance of 8. So wha...

Cyberspats on the Internet of Things

When you hear the words "weaponization" and "internet" in close proximity you naturally assume the subject is the use of hacks and attacks by terrorists and nation-state actors. But then comes today's news about an IoT garage door startup that remotely disabled a customer's opener in response to a negative review. In a nutshell, a man bought the startup's Internet-connected opener, installed it in his home, was disappointed with the quality, and wrote negative reviews on the company's websit...

Real Men [Still] Program in C

It's hard for me to believe, but it's been nearly 8 years since I wrote the popular "Real Men Program in C" blog post (turned article). That post was prompted by a conversation with a couple of younger programmers who told me: "C is too hard for programmers of our generation to bother mastering." I ended then: If you accept [] that C shall remain important for the foreseeable future and that embedded software is of ever-increasing importance, then you’ll begin to see trouble brewing. Altho...

Modern Embedded Programming: Beyond the RTOS

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 by chance. I'm talking about sequential programming based on blocking. Blocking occurs any time you wait explicitly in-line for somethin...

2016 Survey of Embedded Systems Design Trends

According to a recent survey, there are "10" types of people in this world: those who understand binary and those who don't. As you are presumably (by nature of being reading this niche blog) one of the former and also experienced in the art of embedded systems design, won't you please participate in a quick online survey regarding trends in our industry: 2016 Embedded Systems Design Trends Survey It should only take you a couple of minutes to complete the short survey, after whic...

Most Popular Embedded Gurus Blog Posts of 2015

Below are the top 10 most read blog posts from the Embedded Gurus in 2015. #1: A Tutorial on Signed and Unsigned Integers #2: Don't Follow These 5 Dangerous Coding Standard Rules #3: Efficient C Tip #13: Use the Modulus (%) Operator with Caution #4: Embedded C Programming with ARM Cortex-M Video Course #5: A Tutorial on Lookup Tables in C #6: What Belongs in a C .h Header File? #7: Cutting Through the Confusion with ARM Cortex-M Interrupt Priorities #8: Computing Your Sta...

Peak detection of a time series

I've been doing embedded work for so long now that it's rare that I come across a need that I haven't run into before. Well, it happened the other day, so I thought I'd share it with you. Here's the situation. I have a transducer whose role is to determine a binary condition (essentially X is present / absent).  The transducer is AC coupled and pass band filtered such that what I'm looking for is the presence of a noisy AC signal. My first inclination was to take the pass-band filtered signa...