Site Map | Contact Us

Quantum Leaps - innovating embedded systems

articles   
Building Bare-Metal ARM Systems with GNU
Companion Page to "The Embedded Angle" CUJ Colum
Papers About Statecharts and Finite State Machines
Papers About Active Object Computing
Papers About Object-Oriented Programming in C
Papers About Real-Time Embedded Systems Programming

Building Bare-Metal ARM Systems with GNU

This long, in-depth, 10-part article by Miro Samek of Quantum Leaps has been published on Embedded.com in July/August 2007. The article describes in detail how to use the GNU toolchain for ARM to build real-life embedded systems based on ARM microcontrollers. This article demonstrates Quantum Leaps' commitment to open source and our expertise in the ARM processor. The article is the recommended reading for using QP and QP-nano ports to the ARM processor with GNU.

NOTE: As it turns out, the differences among the various GNU-toolchains for ARM are as big as differences among completely different commercial offerings. This article is based on the Sourcery G++ for ARM GNU-toolchain distribution. Unfortunately, the provided Makefile, linker script, and startup code might not work right away with other GNU-toolchain distributions.

read from Embedded.com Part 1: What's need to get started
read from Embedded.com Part 2: Startup code and the low level initialization
read from Embedded.com Part 3: The Linker Script
read from Embedded.com Part 4: C and C++ compiler options
read from Embedded.com Part 5: Fine-tuning the application
read from Embedded.com Part 6: General Description of Interrupt Handling
read from Embedded.com Part 7: Interrupt Locking and Unlocking
read from Embedded.com Part 8: Low-level Interrupt Wrapper Functions
read from Embedded.com Part 9: C-Level ISRs and Other ARM Exceptions
read from Embedded.com Part 10: Example Application and Testing Strategies
download from Embedded.com The Blinky application in C
download from Embedded.com The Blinky application in C++


Companion Page to "The Embedded Angle" CUJ Colum



Papers About Statecharts and Finite State Machines

HTMLWeb Lo, Lawrence,"Supporting orthogonal regions in practical large-scale projects", Embedded Systems Design, November, 2006.

This article extends the "Orthogonal Component" pattern described in "Practical Statecharts in C/C++". .


HTMLWeb Xin, Jin and Jin Yuanping, "Effective UML mapping for modeling state machines", Embedded.com, July, 2006.

This article describes the StateWizard tool that plugs into the Visual C++.


HTMLWeb Samek, Miro, "UML Statecharts at $10.99", Dr. Dobb's online, May, 2006.

This Dr. Dobb's article describes a method and software for implementing UML statecharts in C, small enough to fit a low-end 8-bit microcontroller. More specifically, it presents a nontrivial UML statechart example, implemented with QP-nano, that runs on the USB Toolstick from Silicon Laboratories with room to spare (8051-derivative, 256 bytes of RAM, 8KB of Flash). The example has been implemented with QDK-nano for 8051.


HTMLWeb Babitsky, Dmitry, "Hierarchical State Machine Design in C++", C/C++ Users Journal, December, 2005.

This article generalizes the classic "State" design pattern [Gamma+ 95]. The approach uses templates, RTTI, and other C++ features.


PDFPDF HTMLWeb Heinzmann, Stefan, "Yet Another Hierarchical State Machine", Overload issue 64 Association of C & C++ Users, December, 2004, pp 14-21.

This article is for advanced C++ users, who want apply modern C++ templates to tackle Hierarchical State Machines. Stefan presents an interesting implementation that a good C++ compiler can turn into excellent code. In particular, all transition chains can be entirely optimized at compile-time. An interesting read...


PDFPDF Douglass, Bruce Powel, "Class 505/525: State machines and Statecharts", Proceedings of Embedded Systems Conference Fall,San Francisco 2001.
HTMLWeb Douglass, Brunce Powel, "UML Statecharts", Embedded Systems Programming, January 1999, pp. 22-42.

Bruce Douglass has been teaching state machines and statecharts for many years. This Embedded Systems Conference paper and ESP article are a good introduction to the subject matter.


PDFPDF Duby, Carolyn, "Class 265: Implementing UML Statechart Diagrams", Proceedings of Embedded Systems Conference Fall, San Francisco 2001.

While there is relatively many introductory or theoretical descriptions of statecharts, concrete implementations are quite rare. This Embedded Systems Conference paper presents a tiny infrastructure and some code for implementing state machines. The state machine code is not highly maintainable, however, because exit and entry actions are coded manually (in form of "transition-action-functions"). The author then recommends automatic code generation with UML tools and leaves the audience with the impression that coding statecharts really requires such tools.


HTMLWeb Mellor, Stephen J., "UML Point/Counterpoint: Modeling Complex Behavior Simply", Embedded Systems Programming, March 2000, pp. 38-42.

This is a very interesting debate between two software gurus. Stephen Mellor presents a case against state hierarchy in statecharts and complexity of UML in general.


HTMLWeb Selic, Bran, "UML Point/Counterpoint: How to Simplify Complexity", Embedded Systems Programming, March 2000, pp. 46-56.

Bran Selic responds with possibly the most eloquent argumentation for state hierarchy ever written, totally dismantling Mellor's case. Read both sides of this debate if you really want to know why statecharts, and state hierarchy in particular, are necessary to effectively describe any non-trivial reactive system.


HTMLWeb Gomez, Martin, "Embedded State Machine Implementation", Embedded Systems Programming, December 2000, pp. 40-50.

This paper describes a traditional implementation of non-hierarchical finite state machines. The author extensively uses function pointers, but defeats the benefits by introducing an unnecessary indirection layer of a jump table. The jump table requires enumerating states and an error-prone initialization step of inserting function pointers at the right indexes of the table. A jump table also degrades performance of the state-handler invocation via a function pointer. Interestingly, this article seems to have stroke a chord with many developers and has been cited quite extensively.


Samek, Miro and Paul Y. Montgomery, "State Oriented Programming", Cover story Embedded Systems Programming, August 2000.

HTMLWeb ESP PDF (199KB)  Code Code (106KB)

This article describes the first version (v1.0) of the implementation that later became the Quantum Event Processor™ (QEP). The article mentions a possibility of using an event-driven framework in conjunction with the hierarchical event processor. Such a framework, which was a predecessor of the Quantum Framework™ (QF), was already working at the time at IntegriNautics Corporation (now Novariant).

PDFPDF Hine, Charles, "How to Reduce State Machine Complexity", Embedded Systems Programming, December 1999, pp. 100-106.

...


HTMLWeb Harel, David, "Biting the Silver Bullet: Toward a Brighter Future for System Development", IEEE Computer, 1992, pp. 8-20.

From the moment of their inception, statecharts have been inseparable from the use of sophisticated code generating tools. This paper shows very clearly that Harel had vary high expectations for the "vanilla framework" combining modeling, automatic code generation, and executability of models. This paper is Harel's rebuttal to the famous Fred Brooks' paper "No Silver Bullet". Perhaps the best way of studying these papers is to start with Brooks.

PDFPDFHTMLWeb Harel, David, "Statecharts: A Visual Formalism for Complex Systems", Science of Computer Programming, 8, 1987, pp. 231-274.
Also available from: David Harel's scanned papers collection

This is the most important paper on the subject that marks the birth of statecharts and is quoted in any subsequent work in this area. An absolute must-read for anybody interested in these fundamental programming concepts.


Papers About Active Object Computing

Samek, Miro "Quantum Programming for Embedded Systems", Cover story of the Real-Time Computing issue of the C/C++ Users Journal, March 2003.

CUJ Article (307KB) 


HTMLWeb Harel, David and Eran Gery, "Executable Object Modeling with Statecharts", IEEE Computer, July 1997, pp. 31-42.

...


PDFPDF Allen, Arthur, "Actor-Based Computing: Vision Forestalled, Vision Fulfilled", Agents'98 2nd International Conference on Autonomous Agents. See also Charis Software Systems, Inc.

...


Papers About Object-Oriented Programming in C

Kreymborg, Ron "Single Inheritance Classes in C: An embedded- system perspective" Dr.Dobbs Journal, January 2006.

DDJ Article
Samek, Miro "Portable Inheritance in C/C++" Embedded Systems Programming, December 1997.

ESP Article (390KB)  Code Accompanying code (27KB)


Papers About Real-Time Embedded Systems Programming

Samek, Miro and Robert Ward "Build a Super Simple Tasker", Cover story Embedded Systems Design, July 2006.

HTMLWeb Code Code (44KB)

This article explains the inner workings of a fully-preemptive, single-stack kernel, which executes tasks in Run-to-Completion (RTC) fashion. Such a kernel is an ideal match for executing state machines. This is exactly how Quantum Kernel™ (QK) works.

PDFPDF Ward, Robert, "Practical Real-Time Techniques", Embedded Systems Conference San Francisco 2003, class 448
See also: Robert Ward's website.

...


to topTop of page


Version: September 06, 2007