Go Down

Topic: QP framework problem (Read 5786 times) previous topic - next topic



I'm trying to use the new QP framework for Arduino, but I'm getting some kind of compilation problem.

I followed the Playground tutorial, and It fails on compiling the dpp example. I've copied the libraries and the examples just like is said in the tutorial.

I got this message:

'Serial' was not declare in this scope.
bsp.cpp:31:22: error: Wprogram.h: No such file or directory
bsp.cpp: In function 'void BSP_init()':
bsp.cpp:61: error: 'Serial' was not declared in this scope
bsp.cpp: In function 'void BSP_displyPhilStat(uint8_t, const char*)':
bsp.cpp:99: error: 'Serial' was not declared in this scope
bsp.cpp:100: error: 'DEC' was not declared in this scope

Looks like any kind of library problem, but i can't get it working. Any idea?

I'm using Arduino-022 IDE over Ubuntu 9.04.

Thank you.

Coding Badly

I just installed the library and examples on a Windows Vista computer.  Both examples compile trouble-free.  The problem appears to be unrelated to QP.

Have you selected the appropriate board?

Are you able to build a simple Sketch that makes use of Serial?


May 03, 2011, 08:57 pm Last Edit: May 03, 2011, 09:08 pm by mdb2084 Reason: 1
Thank you for your reply.

I´ve compiled the examples in windows without any problem. Still no luck in Ubuntu.

Yes, I can compile sketches using the serial library under the same configuration, in Ubuntu.It only fails with these examples and I cant understand why the compiler cant find the  libraries.

I would like to find a solution to this problem, as I´m developing primary under Linux. On the other hand, I will have no problem using Windows. It just looks annoying.

Thank you again for your help.

Coding Badly

May 03, 2011, 09:15 pm Last Edit: Sep 03, 2011, 08:28 pm by Coding Badly Reason: 1
In bsp.cpp, change this line...

#include "Wprogram.h"

...to this...

#include <WProgram.h>

...does that make a difference?

Edit: Changed per hixhix's post.


No, sorry, doesn´t work that way, but you gave me a great idea.

I commented the "Wprogram.h" and added the HardwareSerial.h library. The new headers definition in the bsp.cpp looks like this:

#include "qp_port.h"
#include "dpp.h"
#include "bsp.h"
//#include "Wprogram.h"
#include "HardwareSerial.h"

Now it compiles, :). Whatever, I don´t understand why it didn´t work with the original declarations.

Thank you for your help.


The problem is with the qp example files, the include statement refers to a non existing file, at least on case sensitive Linux.

The file to be included is named WProgram.h, please note that the first two letters are upper-case.
qp tries to include a file named Wprogram.h, which is something else on Linux.



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 qp_arduino.zip file from http://www.state-machine.com/arduino/qp_arduino.zip.
Quantum Leaps, LLC


The QP framework http://arduino.cc/playground/Code/QP 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 http://www.state-machine.com/arduino/qp_arduino.zip and the documentation at http://www.state-machine.com/arduino/AN_Event-Driven_Arduino.pdf.
Quantum Leaps, LLC



I want to build the Focus stacking assistant for EOS cameras project (site : http://www.circuitsathome.com/camera-control/focus-stacking-assistant-for-eos-cameras) with an Arduino Uno, they use QP framework.
When compiling with Arduino IDE v1.0 and the latest qp_arduino.zip, I have the following error :

bsp.cpp:185: error: variable or field 'onIdle' declared void
bsp.cpp:185: error: 'QF_INT_KEY_TYPE' was not declared in this scope

When I compile the examples from qp pack : qm_pelican, qp_pelican and qp_dpp, I have the same error. I tried to compile the project with Arduino IDE 0022, and have the same error.
My knowledge of language C/C++ is very very basic and don't see what is wrong. Can you help me.

Thanks and Happy New Year.


Hi BlackBird,

First, let's clarify that the examples in the latest http://www.state-machine.com/arduino/qp_arduino.zip 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 http://www.state-machine.com/arduino/AN_Event-Driven_Arduino.pdf.

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:

Code: [Select]

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.
Quantum Leaps, LLC



Qp examples run fine, my problem was that the librairies FSA_EOS, PTP and USB host shield were in the arduino librairy, now I put them in the sketchbook library, what is normal. (I am newbie with Arduino).
But I think that Arduino Ide 1.0 has made modification, not documented. I think that the projet Focus stacking assistant for EOS cameras from Circuits@Home was made with a previous version (0022 or 0023) and may be with a previous version of QM state machine framework. With my bad knowledge of language C/C++ it will be difficult to find why Focus stacking doesn't work. Thanks for your help.


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.

Quantum Leaps, LLC


Many thanks for your help.


I updated FSA and PTP to work with IDE 1.0 and QP 4.30



Does anyone have the QP 4.30 for arduino 1.0.x laying around? I really need it to use the PTP_2.0 Lib...

Could anyone upload it for me please?

Thanks  a lot!!!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131