Follow our illustrated blog on Embedded Software Architecture

How to build a hybrid solar/wind energy harvester?

Object-orientation in C — Part 1

Object-orientation Object-orientation is about classes and objects. A class is an abstract data type: data type: because it defines a new type to work with by providing data and operations on this data, but also abstract: because it encapsulates this data and hides implementation details behind an hopefully nice and clean interface. An object then […]

Share

How procedural code evolves to object-oriented code

Introduction Most (real :-)) embedded software is written in C. Although C is a general-purpose procedural programming language, it is perfectly possible and useful to write object-oriented code in it. Object-orientation – well, GOOD object-orientation – allows for better code maintenance by managing code complexity. Actually, there are two ways to manage software complexity: abstractions, […]

Share

Painless CRC for your embedded device

We cannot take credit for any of the code – which is public domain – but we found it to be so valuable that we dedicate this blog post to it. A CRC or cyclic redundancy check algorithm is used to detect errors or changes in raw data. It is good at detecting unintentional changes […]

Share

Embedded device boot

Eventually an embedded device’s micro controller or processor is expected to execute the designed-for-the-purpose software. But before that happens, some vendor specific voodoo is required. Only then, it understands it should run your code, which is located at the place where you put it. First-level boot-loader Most modern micro-controllers nowadays have first-level boot-loaders. They initialize […]

Share

Hardware-Software partitioning

Embedded Systems have reached such a complexity that it has become impossible to design them “from scratch”. That above statement [Seminar “Embedded Systems”, Hardware/Software Partitioning, Frederick Dufour – 2006, July 3rd] is maybe the proverbial bridge too far. Since every problem can be decomposed into smaller problems, it IS possible to design a system from […]

Share

Programs, processes and threads – Part 2

This post is Part 2 of the series. Part1, which explains Programs and Processes, can be found here. Thread A thread is a single path of execution and schedulable by the CPU. It has its own stack, program counter and set of registers. A process (living program and container of all resources — see Part1) has one […]

Share

Programs, processes and threads – Part 1

Introduction Especially process and thread are terms which have many different definitions and implementations. And therefor, it is easy to get confused, and hard to get the concepts crystallized in your mind. Just do some googling and you will find plenty of sources which more or less contradict each other. We will add another source […]

Share

Memory management in embedded devices: Stack or heap?

Understanding memory management is a very important aspect of embedded software development. With a broad and simplified generalization, we will divide memory allocation schemes into 2 categories: allocation on the stack, and allocation on the heap. For the purpose of this discussion, the current subject will refer to embedded systems with RAM (either SRAM or […]

Share

Mutexes and semaphores: the FreeRTOS implementation

Let us start with an interesting quote from the FreeRTOS web site: Binary semaphores are used for both mutual exclusion and synchronisation purposes. The quote clearly makes a distinction between the two use cases we saw in part 1: mutual exclusion: how to serialize access to shared data, and synchronization: how does a producer notify […]

Share

User level spin locks revisited

This article was written – quite a few years ago – but recent activities made it worthwhile to take another look at it,  revise the content and give it an overhaul to alleviate and clear up some of the inaccuracies. It starts with a quote and excerpt from the book Inside Microsoft Windows 2000, Third […]

Share