EmbeddedRelated.com

Embedded Toolbox: Windows GUI Prototyping Toolkit

Miro Samek July 7, 20172 comments

In this installment of my "Embedded Toolbox" series, I would like to interest you in the free Windows GUI Toolkit called QWin for prototyping, developing and debugging embedded C or C++ code on Windows.

If you work on devices with non-trivial user interfaces consisting of LCDs (segmented or graphic), buttons, LEDs, etc., QWin could be just the tool for you. It has improved my productivity in such projects dramatically. I personally consider it a gem in my "Embedded...


Tenderfoot: Recommended Reading

Matthew Eshleman June 28, 20171 comment

Twenty years ago I read Code Complete by Steve McConnell. And then read it again. And again. And again. Of all the books I have read during my career, I believe this was the book that catapulted me from a young electrical engineer to a young and aspiring embedded software engineer. So to all the ‘tenderfoots’ embarking upon an embedded systems and especially embedded software and firmware career, this entry is for you.

First, I would certainly recommend that all engineers read and read...


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


Tenderfoot: Introduction to Magic (Numbers that is...)

Matthew Eshleman May 10, 20173 comments

Once upon a time, while participating in a source code review, I stumbled across the following C code in a header file:

struct Foo { //various structure fields char string_buffer[45+3]; //buffer requires about 45 bytes };

My right eyebrow raised, I took a note, and continued with the code review, only to later stumble into this line of code in the body of a C function:

char * temp_string_buffer = (char*) malloc(45+3);

Again, I took a note on this function, and continued...


Donald Knuth Is the Root of All Premature Optimization

Jason Sachs April 17, 20172 comments

This article is about something profound that a brilliant young professor at Stanford wrote nearly 45 years ago, and now we’re all stuck with it.

TL;DR

The idea, basically, is that even though optimization of computer software to execute faster is a noble goal, with tangible benefits, this costs time and effort up front, and therefore the decision to do so should not be made on whims and intuition, but instead should be made after some kind of analysis to show that it has net...


Zebras Hate You For No Reason: Why Amdahl's Law is Misleading in a World of Cats (And Maybe in Ours Too)

Jason Sachs February 27, 20171 comment

I’ve been wasting far too much of my free time lately on this stupid addicting game called the Kittens Game. It starts so innocently. You are a kitten in a catnip forest. Gather catnip.

And you click on Gather catnip and off you go. Soon you’re hunting unicorns and building Huts and studying Mathematics and Theology and so on. AND IT’S JUST A TEXT GAME! HTML and Javascript, that’s it, no pictures. It’s an example of an


Favorite Tools: C++11 std::array

Matthew Eshleman February 26, 20172 comments

Many embedded software and firmware projects must be developed to high standards of reliability. To meet these reliability requirements, firmware project teams will consider many design tradeoffs. For example, an engineering team may avoid or outright ban the use of dynamic memory allocation, a feature typically accessed via the C library call "malloc" or the C++ allocator "new". When authoring software under such...


Vala applications on Embedded Linux: maybe a clever choice [part 1]

Felipe Lavratti December 19, 2016

Vala is a sexy, open source, high level programming language that appeared in 2006, it counts with a modern typing system, is object oriented, compiled and statically typed, it has a almost identical syntax to C# and is maintained by GNOME. The language was created as a power abstraction of the GLib and GTK libraries, two considerably lightweight and powerful libraries written in C, and it is used in projects such as GNOME Clocks, Shotwell, GXml and Elementary OS.

namespace...

Favorite Tools: C++11 User-defined literals

Matthew Eshleman November 14, 20161 comment

In many software domains units of measurement are frequently critical to the software's data processing requirements. Those same units, or rather the use of the wrong units, are often the source of bugs and disastrous mistakes. Although useful for other purposes, user-defined literals are an excellent addition to the C++11 standard and handy when working with units of measurement.

Suppose a device measures velocity. To help prevent errors, the software specification requires...


Surprising Linux Real Time Scheduler Behavior

Matthew Eshleman November 5, 2016

I have recently been helping with embedded software design and development for a data acquisition and visualization device. The software executes within an embedded Linux context and consists of various animated user interfaces rendering the acquired data.

The data is received via a UART and a SPI connection. During project development we noticed poor UART data latency issues during heavy user interface animations. For this product to properly meet its acquisition requirements, the UART...


Developing software for a safety-related embedded system for the first time

Michael J. Pont October 31, 20151 comment

I spend most of my working life with organisations that develop software for high-reliability, real-time embedded systems. Some of these systems are created in compliance with IEC 61508, ISO 26262, DO-178C or similar international standards.

When working with organisations that are developing software for their first safety-related design, I’m often asked to identify the key issues that distinguish this process from the techniques used to develop “ordinary” embedded software.

...

Modern Embedded Systems Programming: Beyond the RTOS

Miro Samek April 27, 20167 comments

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


C to C++: 3 Proven Techniques for Embedded Systems Transformation

Jacob Beningo February 7, 20234 comments

For 50 years, the C programming language has dominated the embedded software industry. Even today, more than 80% of embedded projects are using C; however, over the last few years, many teams have begun transitioning from C to C++. C++ offers embedded developers a robust, modern set of tools that can be used to write flexible, scalable, and reusable applications. As embedded applications become more complex and connected, teams need a more modern language to help them deal with the software...


Dark Corners of C - The Comma Operator

Stephen Friederichs July 23, 20158 comments

I've been programming in C for 16 years or so and the language has existed for much much longer than that. You might think that there'd be nothing left to surprise me after so long - but you'd be wrong. Imagine my surprise the first time I saw a line of code that looked something like this:

if (!dry_run && ((stdout_closed = true), close_stream (stdout) != 0))

My mind couldn't parse it - what's a comma doing in there (after...


Get your microcontroller and PC to talk

Jayaraman Kiruthi Vasan August 15, 20115 comments

(and get it done free ‘n’ easy!)

 

The Need

Specifications can dynamically change during the product development cycle. Bosses/clients suddenly approach us with additional requirements, which, however simple, can put us in a fix.  One such requirement could be to have a PC based design interface for a standalone microcontroller project.

On many occasions, the required PC software has to just behave like a slave...


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


How Embedded Linux is used in Spacecrafts !

George Emad February 1, 20246 comments

This article dives into the application of Linux in spacecraft, examining the challenges it poses and proposing potential solutions. Real-life examples will be discussed, while also addressing the drawbacks of employing Linux in safety-critical missions.


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


Coding Step 4 - Design

Stephen Friederichs November 24, 2015

Articles in this series:

The last article in this series discussed how to write functional high-level requirements: specifications for what your software is supposed to do. Software design is the other side of the coin....


Libgpiod - Toggling GPIOs The Right Way In Embedded Linux

Mohammed Billoo January 24, 2023
Overview

We all know that GPIO is one of the core elements of any embedded system. We use GPIOs to control LEDs and use them to monitor switches and button presses. In modern embedded systems, GPIOs can also be used as pins for other peripheral busses, such as SPI and I2C. Similar to the previous article on interacting with peripherals on an SPI bus in userspace via SPIdev (https://www.embeddedrelated.com/showarticle/1485.php), we can also control GPIOs from userspace on an embedded...