Recent Posts
sort by category
The readers of this blog have certainly noticed that EmbeddedGurus is no longer active.
But the State-Space blog is not dead! The blog has been migrated to state-machine.com, where it will continue. Please check it out!...
If you'd like to understand how Object-Oriented Programming (OOP) really works under the hood, here is a free video course for you:
OOP part-1: Encapsulation: This first lesson on Object-Oriented Programming (OOP) introduces the concept of Encapsulation, which is the ability to package data and functions together into classes. You'll see how you can emulate Encapsulation in C, what kind of code is generated, and how to debug such code. Next, you will translate the C design into C++ using a cl...
If you'd like to understand how a Real-Time Operating System (RTOS) really works, here is a free video course for you:
RTOS part-1: In this first lesson on RTOS you will see how to extend the foreground/background architecture from the previous lesson, so that you can have multiple background loops running seemingly simultaneously:
https://youtu.be/TEq3-p0GWGI
RTOS part-2: In this second lesson on RTOS you will see how to automate the context switch process. Specifically, in this lesson...
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...
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.)
...
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...
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...
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...
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...
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 ...
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 ...
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...
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...
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...
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...
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 ...
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...
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...
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...
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...