Pumpkin, Inc.

Pumpkin User Forums

Problem in configuring salvocfg.h

If you're having difficulty with Salvo's configuration options, post it here.

Problem in configuring salvocfg.h

Postby dirk41 » Thu Feb 21, 2008 5:38 am

Hi guys/aek,

I'm a new Salvo Pro user, and I have a problem in compiling my application. I've read the userguide and followed the instructions on how to integrate salvo with my code. I'm quite confused with regards to the configuration file salvocfg.h. Tutorial 4 under "including salvo.h" in the userguide states that "Including salvo.h will automatically include your project specific version of salvocfg.h"
I'd like to ask if where can i locate this file?

I also understand that I have to make my own salvocfg.h for each new application. i've included my salvocfg in my project tree and also saved it in salvo's inc folder (C:PumpkinSalvoInc). Could you confirm if this is correct?

Below is an example application using salvo and also included is a salvocfg.h file that reflects to the example application. When i compile this, the error points to salvostr.h stating "expected a declaration" This was shown in my previous post here in the forum. I think some of the "ifs" were false or does not complywith the configured salvocfg.h.

I'm using IAR Embedded Workbench v4 and MSP430F2252 microcontroller.

Can you shed some light into this?

thanks so much

*****/ example application/******
#include "msp430x22x2.h"
#include <salvo.h>

void TaskA ()
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1DIR |= 0x01; // P1.0 output
TACCTL0 = CCIE; // TACCR0 interrupt enabled
TACCR0 = 50000;
TACTL = TASSEL_2 + MC_2; // SMCLK, contmode

__bis_SR_register(LPM0_bits + GIE); // Enter LPM0 w/ interrupt

OS_Yield();

}
// Timer A0 interrupt service routine
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
P1OUT ^= 0x01; // Toggle P1.0
TACCR0 += 50000; // Add Offset to TACCR0
}

void TaskB()
{
WDTCTL = WDTPW + WDTHOLD;
P1OUT |= 0x01;

OS_Yield();
}

int main( void )
{
WDTCTL = WDTPW + WDTHOLD;
BCSCTL1 = CALBC1_8MHZ;
DCOCTL = CALDCO_8MHZ;
OSInit();
OSCreateTask(TaskB, OSTCBP(1), 1);
OSCreateTask(TaskA, OSTCBP(2), 2);


while (1)
{
OSSched();
}

}


************************************************************/salvocfg.h/**************

#include <msp430.h>

#define OSEVENTS 1
#define OSEVENT_FLAGS 0
#define OSMESSAGE_QUEUES 0
#define OSTASKS 2

#define OSENABLE_BINARY_SEMAPHORES FALSE

dirk41
 
Posts: 5
Joined: Fri Feb 15, 2008 12:00 am

Re: Problem in configuring salvocfg.h

Postby aek » Thu Feb 21, 2008 9:42 am

salvocfg.h is an application- or project-specific file. IOW, for every Salvo application that you create, it needs a unique salvocfg.h.

All you need to do is set the project's include paths to find salvo.h (In PumpkinSalvoInc) and your project's salvocfg.h (in your project's directory).

Do not put salvocfg.h in PumpkinSalvoInc. Put it in the same folder as your Embedded Workbench project. You can add a path to that folder in EW project options as $PROJ_DIR$ under Options -> C/C++ Compiler -> Preprocessor

Please avoid multiple copies of the same file ... there's never any reason to have more than one copy of any unqiue Salvo header or source file, and violating this rule will cause lots of problems.

lastly, we generally recommend that you include the target-specific header file (in your example, msp430x22x2.h) via salvocfg.h. You'll see that this is how it is done in the Salvo examples (See tut5). Note that you can just use #include <msp430.h> -- that's much simpler.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Problem in configuring salvocfg.h

Postby dirk41 » Fri Feb 22, 2008 2:11 am

Hi aek,

i've tried the things that you instructed but came up with the same results. i also tried to include salvomem.c in my project tree as you suggested in the other thread/post. And also it save in my profect folder. when i compile, it also produces the error "expected a declaration" that points to salvostr.h. Do i have to configure salvostr.h? Can you suggest what are the lacking parameters in my salvocfg.h shown below? Also included is the source file. I think i missed to declare some parameters in the salvocfg.h, that's why the error points to salvostr.h..

thanks so much....

***********/ source file/**************
#include "msp430x22x2.h"
#include <salvo.h>


void TaskA ()
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1DIR |= 0x01; // P1.0 output
TACCTL0 = CCIE; // TACCR0 interrupt enabled
TACCR0 = 50000;
TACTL = TASSEL_2 + MC_2; // SMCLK, contmode

__bis_SR_register(LPM0_bits + GIE); // Enter LPM0 w/ interrupt

OS_Yield();


}

// Timer A0 interrupt service routine
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
P1OUT ^= 0x01; // Toggle P1.0
TACCR0 += 50000; // Add Offset to TACCR0
}

void TaskB()
{
WDTCTL = WDTPW + WDTHOLD;
P1OUT |= 0x01;
OS_Yield();
}


int main( void )
{
WDTCTL = WDTPW + WDTHOLD;
BCSCTL1 = CALBC1_8MHZ;
DCOCTL = CALDCO_8MHZ;
OSInit();
OSCreateTask(TaskB, OSTCBP(1), 1);
OSCreateTask(TaskA, OSTCBP(2), 2);


while (1)
{
OSSched();
}

}
***************************************
**********/ equivalent salvocfg.h /*********


#include "msp430x22x2.h"

#define OSEVENTS 1
#define OSTASKS 2
#define OSEVENT_FLAGS 0
#define OSMESSAGE_QUEUES 0
****************************

dirk41
 
Posts: 5
Joined: Fri Feb 15, 2008 12:00 am

Re: Problem in configuring salvocfg.h

Postby aek » Fri Feb 22, 2008 5:48 am

Your message is not clear as to whether you're building an application with Salvo source code or with a Salvo library (you can do either with Salvo Pro).

Take a look at e.g. the tut5le and tut5pro projects that are supplied as part of the Salvo for MSP430 distribution. There you'll see the different salvocfg.h's required for each kind of project (library build and source-code build, respectively), as well as the Salvo files required (for tut5), and the project options.

Also, I suspect that because you copied a salvocfg.h into your PumpkinSalvoInc directory, this could be causing problems. Delete that one, make sure you have a unique one in your project directory, and put a #error Aha! in it. You should get an error when you build ... this is the quickest way to prove that the salvocfg.h you think your project is using is in fact the one that it is using. Then remove the #error Aha! and continue.

------------------

[This message has been edited by aek (edited February 22, 2008).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Problem in configuring salvocfg.h

Postby aek » Fri Feb 22, 2008 5:49 am

And no, there is no need to modify any source or header files of the Salvo distribution to get your application to build correctly.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Problem in configuring salvocfg.h

Postby Phil W » Mon Feb 25, 2008 3:24 am

Don't forget your tasks need endless loops.....
Phil W
 
Posts: 36
Joined: Tue Jan 14, 2003 12:00 am
Location: penrith nsw australia


Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron