Simple Automated Log Processing

Steve Branam April 25, 2020

Text log data offers a wealth of information from an embedded system. At least during prototyping and development phases, most systems have some kind of serial log output, or use semihosting methods to log to a serial output channel in a debugger. Then you can capture the logs to a file.

The problem is that they tend to accumulate large volumes of data. Logs can be many thousands of lines long, especially when you run long duration tests. Finding information and evaluating trends in the...

Scorchers, Part 2: Unknown Bugs and Popcorn

Jason Sachs April 5, 20202 comments

This is a short article about diminishing returns in the context of software releases.

Those of you who have been working professionally on software or firmware have probably faced this dilemma before. The scrum masters of the world will probably harp on terms like the Definition of Done and the Minimum Viable Product. Blah blah blah. In simple terms, how do you know when your product is ready to release? This is both an easy and a difficult question to answer.

What makes...

UML Statechart tip: Handling errors when entering a state

Matthew Eshleman March 8, 20204 comments

This is my second post with advice and tips on designing software with UML statecharts. My first entry is here.

It has been nearly 20 years since I first studied UML statecharts. Since that initial exposure (thank you Samek!), I have applied event driven active object statechart designs to numerous projects [3]. Nothing has abated my preference for this pattern in my firmware and embedded software projects. Through the years I have taken note of a handful of common challenges when...

Jaywalking Around the Compiler

Jason Sachs December 9, 20193 comments

Our team had another code review recently. I looked at one of the files, and bolted upright in horror when I saw a function that looked sort of like this:

void some_function(SOMEDATA_T *psomedata) { asm volatile("push CORCON"); CORCON = 0x00E2; do_some_other_stuff(psomedata); asm volatile("pop CORCON"); }

There is a serious bug here — do you see what it is?

Embedded Programming Video Course Shows How OOP Works Under the Hood

Miro Samek September 29, 2019

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

Watchdog Timer Anti-patterns

Alexandru Lazar June 8, 2019

The humble watchdog timer has been an essential part of our reliability tool chest for decades now. The way it works is straightforward and easy to understand, and most practical designs are easy to interface with.

There is a wealth of reference material that covers both the theory behind watchdog timers and practical design tips. But what we'll talk about today is of a slightly different nature.

Despite its straightforward operation and long history, the watchdog timer does occasionally get...

Linux Kernel Development - Part 1: Hello Kernel!

Denis Cavalli June 2, 20192 comments

Our very first program in every language or framework usually is the notorious "Hello World" program. For this Linux Kernel Modules Development introduction we will follow the same concept, but instead of the usual "Hello World" we will make a "Hello Kernel!" and you will understand the reason in a few moments. Note that in this article I will not focus on a deep explanation about this topic for the moment, since this is only the introduction.

But before we dive into code we need to have the...

A brief overview of flight control software

Igor Mišić May 3, 20193 comments

It has been a long time since the first drones appeared. If you are interested in such a topic, you may be confused about how and where to jump in. Since I went through the same phase, I'd like to write my findings here and help others.

For this blog post, I've created chart and table with all open source flight control programs I've been able to find.

The chart shows the course of development of the existing software. It is separated in years and you can see when which project...

VHDL tutorial - A practical example - part 2 - VHDL coding

Gene Breniman May 27, 2011

In part 1 of this series we focused on the hardware design, including some of the VHDL definitions of the I/O characteristics of the CPLD part.  In part 2, we will describe the VHDL logic of the CPLD for this design.

With any design, the first step to gather the requirements for the job at hand.  From part 1 of this article, I have copied two sections that address some of the requirements for the CPLD design.

The data acquisition engine has the...

Important Programming Concepts (Even on Embedded Systems) Part V: State Machines

Jason Sachs January 5, 20158 comments

Other articles in this series:

Oh, hell, this article just had to be about state machines, didn’t it? State machines! Those damned little circles and arrows and q’s.

Yeah, I know you don’t like them. They bring back bad memories from University, those Mealy and Moore machines with their state transition tables, the ones you had to write up...

Data Hiding in C

Stephen Friederichs April 20, 201317 comments

Strictly speaking, C is not an object-oriented language. Although it provides some features that fit into the object-oriented paradigm it has never had the full object-oriented focus that its successor C++ offers. C++ introduced some very useful concepts and abilities that I miss when I’m developing in ANSI C. One such concept is protected member variables and functions.

When you declare a class in C++ you can also declare member variables and functions as part of that class. Often, these...

Unit Tests for Embedded Code

Stephen Friederichs March 5, 201411 comments

I originate from an electrical engineering background and my first industry experience was in a large, staid defense contractor. Both of these experiences contributed to a significant lack of knowledge with regards to software development best practices. Electrical engineers often have a backwards view of software in general; large defense contractors have similar views of software and couple it with a general disdain for any sort of automation or ‘immature’ practices.  While there...

Learning Rust For Embedded Systems

Steve Branam November 12, 2021
The Motivational Portion

Based on recommendations from Kevin Nause, the VolksEEG project is considering using Rust as the embedded system programming language. So I've been off on a tear skimming books and e-books and watching videos at 2x to evaluate it.

My conclusion? Do it!

Most of the rest of us participants are primarily C/C++ embedded developers. I had previously been sensitized to Rust for embedded systems by 

Embedded Toolbox: Programmer's Calculator

Miro Samek June 27, 20178 comments

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

Implementing State Machines

Stephen Friederichs January 18, 20145 comments

State machines are a great way to design software but they can be difficult to implement well.To illustrate this I’ll develop a simple state machine then increase the complexity to demonstrate some of the difficulties

We’ve all washed dishes before - it’s easy isn’t it? Scrub, rinse, dry, scrub, rinse dry. Scrub the dish until all of the gunk is off of it, rinse until the soap is off, put it in the drying rack. If you want to design software to implement this you have options. You...

Important Programming Concepts (Even on Embedded Systems) Part IV: Singletons

Jason Sachs November 11, 20142 comments

Other articles in this series:

Today’s topic is the singleton. This article is unique (pun intended) in that unlike the others in this series, I tried to figure out a word to use that would be a positive concept to encourage, as an alternative to singletons, but

Android for Embedded Devices - 5 Reasons why Android is used in Embedded Devices

Maharajan Veerabahu November 6, 20173 comments

The embedded purists are going to hate me for this. How can you even think of using Android on an embedded system ? It’s after all a mobile phone operating system/software. 

Sigh !! Yes I did not like Android to begin with, as well - for use on an Embedded System. But sometimes I think the market and needs decide what has to be used and what should not be. This is one such thing. Over the past few years, I have learned to love Android as an embedded operating system....