Pages: [1] 2   Go Down
Author Topic: QP framework problem  (Read 4009 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13036
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: May 03, 2011, 02:08:44 pm by mdb2084 » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13036
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: September 03, 2011, 01:28:10 pm by Coding Badly » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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, smiley. Whatever, I don´t understand why it didn´t work with the original declarations.

Thank you for your help.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Hixhix
Logged

Chapel Hill, NC, USA
Offline Offline
Newbie
*
Karma: 5
Posts: 12
Quantum Leaps, LLC provides lightweight, open source active object frameworks and graphical modeling tools for real-time embedded systems, such as single-chip microcontrollers. We bring quantum leaps of innovation to embedded systems programming by making
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Chapel Hill, NC, USA
Offline Offline
Newbie
*
Karma: 5
Posts: 12
Quantum Leaps, LLC provides lightweight, open source active object frameworks and graphical modeling tools for real-time embedded systems, such as single-chip microcontrollers. We bring quantum leaps of innovation to embedded systems programming by making
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

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

Chapel Hill, NC, USA
Offline Offline
Newbie
*
Karma: 5
Posts: 12
Quantum Leaps, LLC provides lightweight, open source active object frameworks and graphical modeling tools for real-time embedded systems, such as single-chip microcontrollers. We bring quantum leaps of innovation to embedded systems programming by making
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
void QF::onIdle() {

#ifdef SAVE_POWER

    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

#else
    QF_INT_ENABLE();
#endif
}

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


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

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

Chapel Hill, NC, USA
Offline Offline
Newbie
*
Karma: 5
Posts: 12
Quantum Leaps, LLC provides lightweight, open source active object frameworks and graphical modeling tools for real-time embedded systems, such as single-chip microcontrollers. We bring quantum leaps of innovation to embedded systems programming by making
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

--Miro
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Many thanks for your help.
Regards
Logged

Louisville, CO
Offline Offline
Full Member
***
Karma: 2
Posts: 174
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

https://github.com/felis/FSA-EOS
https://github.com/felis/PTP_2.0
Logged

/felis

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!!!
Logged

Pages: [1] 2   Go Up
Jump to: