Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Examples of QM Graphical state machine modeling and code generation on: January 09, 2014, 10:37:57 am
Some QP examples are available from:

2  Development / Other Software Development / Graphical Modeling and Automatic Code Generation for Arduino on: June 02, 2013, 03:30:03 pm
The latest version of the free QM modeling tool now allows you to build, upload, and run Arduino projects directly from the QM tool, thus replacing the standard Arduino IDE.

There is a new YouTube video that explains how to get started with the latest QM on Arduino:

More information is available from the updated Arduino Playground article "QP state machine framework for Arduino":
3  Development / Other Software Development / Yet another command-line Arduino make script on: June 02, 2013, 03:12:21 pm
There is a new, portable command-line make script for building Arduino code, which implements all the steps described in the standard Arduino build process, as documented in

The arduinomake.tcl build script is written in TCL. The script still requires the standard Arduino software to be installed, but you no longer need to launch the Arduino IDE to build and upload the code to the Arduino board. Please note the the TCL shell interpreter is already included in the standard Arduino distribution for Windows (<Arduino>\hardware\tools\avr\bin\tclsh84.exe) and on other platforms, such as Linux, the TCL interpreter is available by default.

The arduinomake.tcl build script is designed to be called from the directory containing the Arduino sketch (.ino file). From this directory, you call the script as follows:

    tclsh arduinomake.tcl <BARD> "<LIBS>" ["<DEFINES>"]

For example, to build a sketch for the UNO board, using the QP library as well as the Ethernet library and
providing the definitions for the symbols BAR and FOO=25, you call the arduinomake.tcl build script as

    tclsh arduinomake.tcl UNO "qp Ethernet" "BAR FOO=25"

NOTE: The arduinomake.tcl build script requires the environment variable ARDUINO_HOME to
be defined and point to the installation directory of the standard Arduino software.

The arduinomake.tcl build script works as follows:

1. Builds the specified Arduino libraries using the avr-gcc compiler included in the standard Arduino
distribution. The libraries must exist in the <Arduino>\libraries\ directory and must be structured
according the the Arduino standard. The source code in the libraries can be located in the library
directory as well as the utility\ sub-directory. The compiled libraries (.a files) are created in the
lib\ sub-directory of the project directory.

2. Generates the dependency files for all .ino, .cpp, and .c source code files found in the project
directory. The dependency files (.d files) contain the information of all files included a given source
file, so that if any of these files changes, the dependent source file can be recompiled. The
dependency files are generated in the bin\ sub-directory of the project directory.

3. Parses the <Arduino>\hardware\arduino\boards.txt to determine the exact MCU type, the
AVR core, the Build variant, etc. needed to build the code. This information is extracted from the
boards.txt file based on the Arduino board parameter provided to the arduinomake.tcl build

4. Builds the object files for all .ino, .cpp, and .c source code files that need recompilation. The
object files are generated in the bin\ sub-directory of the project directory.

5. Links the object files (.o files) in the bin\ sub-directory and the libraries (.a files) in the lib\ sub-
directory to form the <project>.elf file in the bin\ sub-directory of the project directory, where
<project> is the name of the project directory. The naming of the compiled image is chosen for
compatibility with the standard Arduino build process in the Arduino IDE.

6. Generates the HEX file (.hex file) from the .elf file in the bin\ sub-directory, which is used for
uploading the image to the Arduino board.

The arduinomake.tcl build script can be downloaded from , as part of the QP for Arduino distribution.

4  Development / Other Software Development / QP state machine framework for Arduino on: September 06, 2012, 11:42:03 am
The QP state machine framework for Arduino has been updated to the latest QP version 4.5.02 and is compatible with the latest graphical QM modeling tool version 2.2.02. The main improvement in these version is compliance of the source code with the strict MISRA-C++:2008 guidelines. 

The QP framework is described in the updated Arduino Playground article, which describes how to download the code and tools.

5  Development / Other Software Development / Re: QP framework problem on: January 13, 2012, 09:18:31 am
I've notified Oleg Mazurov, the author of the FSA_EOS, PTP and USB host shield libraries, about the incompatibilities with the new QP 4.3.00 and Arduino IDE 1.0. It seems that his help would be needed to bring all these software components up to date.

6  Development / Other Software Development / Re: QP framework problem on: January 11, 2012, 11:00:45 am
Hi BlackBird,

First, let's clarify that the examples in the latest really have the problem that you report, because they work fine for me. Please note that you need to copy the \libraries\qp\ subdirectory to the arduino\libraries\ folder and the \examples\qp\ subdirectory to the arduino\examples\ folder. All this is described in the Application Note available online at

Now, regarding the EOS cameras project, it is using the previous version of QP. To bring it up to QP 4.3.00, you need to change the QF::onIdle() function in the bsp.cpp file as follows:

void QF::onIdle() {


    SMCR = (0 << SM0) | (1 << SE);  // idle sleep mode, adjust to your project

    // never separate the following two assembly instructions, see NOTE2
    __asm__ __volatile__ ("sei" "\n\t" :: );
    __asm__ __volatile__ ("sleep" "\n\t" :: );

    SMCR = 0;                                              // clear the SE bit


Please make a post to this forum when you find out what's wrong with the QP examples and to confirm that the fix to the EOS cameras project works.
7  Development / Other Software Development / QP framework update for Arduino-1.0 and QP 4.3.00 on: December 16, 2011, 06:04:44 pm
The QP framework for Arduino has been updated for the new Arduino-1.0 and the latest QP version 4.3.00. This version adds also an example, which demonstrates preemptive multitasking on Arduino.

The updated code is available at and the documentation at
8  Development / Other Software Development / Re: QP framework problem on: September 26, 2011, 08:10:16 am
The new release (4.2.04) of the QP framework for Arduino fixes the problem with "WProgram.h" in the examples. Please download the new file from
9  Development / Other Software Development / Re: QP state machine framework for Arduino on: February 09, 2011, 08:51:15 am
The broken link in the article has been corrected.
10  Development / Other Software Development / Re: QP state machine framework for Arduino on: February 08, 2011, 05:18:04 pm
The book "Practical UML Statecharts in C/C++, Second Ed." (PSiCC2) has not been written with the beginner in mind. As the author of this book I just don't want anybody to get disappointed, especially because Arduino itself is targeted for non-specialists in embedded software development.

So, before you rush to buy the book based on some buzzwords, like "UML", "statecharts", or "ARM Cortex-M3", please play with the provided examples on your Arduino (see and take a closer look at the code. You can also read the introduction and the first chapter of the PSiCC2 book online at This first chapter is designed as a quick tutorial.

Event-driven programming can feel very unnatural for many people. That's alright. You have other alternatives, like the traditional RTOS, the venerable superloop with polling, protothreads (which are specifically designed to avoid state machines), and so on.

On the other hand, some studies indicate that event-driven programming introduced early in the teaching of software development can be beneficial (see "Event-driven Programming can be Simple Enough for CS 1" at So, if you like the event-driven approach, you would need an event-driven framework. QP is one of such frameworks and the PSiCC2 book is the ultimate resource for it.
11  Development / Other Software Development / QP state machine framework for Arduino on: February 05, 2011, 05:59:10 pm
The QP state machine framework has been just released (see

The QP framework very nicely complements the Arduino platform and provides everything you need to build well-structured, responsive, robust, and power-efficient Arduino programs based on modern hierarchical state machines. In many ways the open source QP state machine framework is like a modern real-time operating system (RTOS) specifically designed for executing event-driven state machines.

The QP development kit for Arduino provides also an example model for the free QM graphical modeling tool. QM takes Arduino programming to the next level, by eabling automiatic code generation of complete Arduino sketches.

The extensive Application Note "Event Driven Arduino Programming with QP" describes the main concepts and how to get started.

An Arduino port of the QP framework has been requested in this forum (see,38787.0.html), but it is no longer possible to post responses to the older forum.
Pages: [1]