Pumpkin, Inc.

Pumpkin User Forums

Setup

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

Setup

Postby aek » Wed Nov 17, 2004 1:00 am

Linker error? Compiler error? You're not giving me enough to go by.

My guess is that it's a linker error and you haven't added a Salvo library (which has OSCtxSw() defined in it) to your project.

Also, please be sure to be using App Note 25 and not the earlier one (pre-MPLAB-v6).

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

[This message has been edited by aek (edited November 17, 2004).]

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

Re: Setup

Postby simon11 » Wed Nov 17, 2004 5:50 am

It was a linker issue I missed the adding a library step. So thats fine the only thing that I have currently is a warning saying thatI am calling OSSeched(); without a prototype. It also seems as if when I'm running the simulator that my task never asctually gets called. Here is my relevent code maybe I didnt do something right in this code:
code:
#include "salvo.h"
_OSLabel(TaskDisplay1)
void TaskDisplay (void) {
for(;;){
if (Disp == 1){
WriteDataXLCD(ButtonPress); //write to LCD
Disp = 0; }
OS_Yield(TaskDisplay1); //Yield to Scheduler
}
}

void main (void){
OSInit();

//Creating Tasks ID Priority
OSCreateTask(TaskDisplay, 0, 1);


for (; ;)
OSSched();

}



Thank You for your time.

[This message has been edited by aek (edited November 17, 2004).]

simon11
 
Posts: 20
Joined: Mon Nov 08, 2004 12:00 am
Location: Worcester,MA,usa

Re: Setup

Postby aek » Wed Nov 17, 2004 7:34 am

Should be
code:
OSCreateTask(TaskDisplay, OSTCBP(1), 1);

OSSched()'s prototype is in salvo.h, so as long as you're linking in a library (use an a-config or a t-config -- it'll save you time), you'll be OK.

Calling OSCreateTask() with the wrong parameter for a tcbP (a task control block pointer) results in OSCreateTask() returning an error code, and the task was never created ...

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

[This message has been edited by aek (edited November 17, 2004).]

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

Re: Setup

Postby simon11 » Wed Nov 17, 2004 10:24 am

I am using salvo lite in integration with the microchip compiler C18 in conjunction with MPLAB IDE and am having a difficult time in setting up the Operating System. I went through and added the include path to the build options and yet the compiler still is sending back an error saying it cannot find the .h file. What could I possibly be doing wrong?
simon11
 
Posts: 20
Joined: Mon Nov 08, 2004 12:00 am
Location: Worcester,MA,usa

Re: Setup

Postby aek » Wed Nov 17, 2004 10:50 am

I think this thread will answer your question ...

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

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

Re: Setup

Postby simon11 » Wed Nov 17, 2004 12:22 pm

I followed that link, created the location of the output space to the space where my .mcp file resides and yet i'm still getting an error message saying it cannot locate salvo.h. Im currently stumped
simon11
 
Posts: 20
Joined: Mon Nov 08, 2004 12:00 am
Location: Worcester,MA,usa

Re: Setup

Postby aek » Wed Nov 17, 2004 12:41 pm

Is this your own project, or one in the installation (e.g. tu5)?

When the compiler can't find salvo.h, then c:salvoinc (or wherever you installed Salvo) is not in the include paths of your project. So just add that in and you should solve that error.

If it can't find salvocfg.h, then it's missing the include path to your salvocfg.h, which is usually in your project's folder. So add that in as an additional path and you should have the Salvo include path issues resolved.

The example projects reference multiple Salvo-related include directories, because they pull general Salvo files in from c:salvoinc, general project files in from other places (e.g. salvo ut u1sys?), and project-specific files (e.g. the project's salvocfg.h) from the project directory.

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

[This message has been edited by aek (edited November 17, 2004).]

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

Re: Setup

Postby simon11 » Wed Nov 17, 2004 12:42 pm

Somehow some way it's finding the .H files. SO the combination of the link and a little luck ended in goodness.
simon11
 
Posts: 20
Joined: Mon Nov 08, 2004 12:00 am
Location: Worcester,MA,usa

Re: Setup

Postby aek » Wed Nov 17, 2004 12:47 pm

Great.

As long as it finds them, your'e probably fine.

They key is not to copy any shared Salvo files (e.g. the ones in salvoinc or salvosrc) to your own directory(ies), because that will cause all sorts of problems down the road.

IOW, there should only be one instance of each shared Salvo file on your PC, somewhere under c:salvo, as per the installer.

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

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

Re: Setup

Postby simon11 » Wed Nov 17, 2004 12:54 pm

Now that it's finidng it somehow I'm getting this error on the build

Copyright (c) 2004 Microchip Technology Inc.
Error - could not find definition of symbol 'OSCtxSw' in file 'C:salvoGoldennessButtons.o'.
Errors : 1

I really am not sure why this is occurring.

simon11
 
Posts: 20
Joined: Mon Nov 08, 2004 12:00 am
Location: Worcester,MA,usa

Next

Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 1 guest

cron