Pumpkin, Inc.

Pumpkin User Forums

Salvo - Compile Errors

If you're having difficulty installing Salvo, post it here.

Salvo - Compile Errors

Postby Guru_Wanabee » Tue Dec 19, 2006 1:53 am

I am getting the following error message and cannot figure it out.

code:
"MPLINK 4.06, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - could not find definition of symbol 'OSlostTicks' in file 'init.o'.
Errors : 1

"
MPLab version: 7.50
MPASM(TM) Assembler version: 5.02
MPLinker version: 4.02
C18 version: 3.02
Salvo Lite version: 3.2.3


I am using the C18 compiler and an 18F4520 processor. I have two tasks and have included the salvo.h, mem.c, 18f4520.lkr and sfc18sna.lib files in my project definition.

I have upgraded the installation with the rev -c.zip which did solve some of my earlier issues, but this one has me stumped.

I have attached my config file below in case the issue is there.

code:
#define OSTARGET              OSPIC18
#define OSUSE_LIBRARY TRUE
#define OSLIBRARY_TYPE OSF
#define OSLIBRARY_GLOBALS OSN
#define OSLIBRARY_CONFIG OSA
#define OSLIBRARY_VARIANT OSNONE
#define OSEVENTS 5
#define OSEVENT_FLAGS 1
#define OSENABLE_BINARY_SEMAPHORES TRUE
#define OSTASKS 3

I know that the issue is with Salvo and not the <included> files because I wrote the <included> files in advance and they all work as expected. It is only when I try to compile the salvo project that I run into the issues identified above.

I would really appreciate some help

Thank you in advance

[This message has been edited by aek (edited December 20, 2006).]

Guru_Wanabee
 
Posts: 11
Joined: Tue Dec 19, 2006 12:00 am

Re: Salvo - Compile Errors

Postby Guru_Wanabee » Wed Dec 20, 2006 2:22 am

The following skeleton project does the exact same thing.

/*************** INCLUDE FILES *****************/
#include <p18f4520.h>
#include "main.h"
#include <salvo.h>

/*************** TASK FUNCTIONS *****************/
void Task1(void); //TASK1
void Task2(void); //TASK2

/**************** TASK LABELS *******************/
_OSLabel(Task1_1)
_OSLabel(Task2_1)

/*************** SUPPORTING FUNCTIONS ***********/
void IntVector(void);


/**************** GLOBAL VARIABLES **************/

void main(void)
{

OSInit();

//Set up the TMR0 Module
T0CONbits.T0CS=0;
T0CONbits.PSA=0;
T0CONbits.T0PS2=1;
T0CONbits.T0PS1=1;
T0CONbits.T0PS0=1;
T0CONbits.T08BIT=1;
T0CONbits.TMR0ON=1;

//Enable the interrupts & Flagging
INTCONbits.T0IE=1;
INTCONbits.GIE=1;

//Create the tasks within the operating system
OSCreateTask(Task1,TASK1,10);
OSCreateTask(Task2,TASK2,15);

//Create the Semaphores within the operating system
OSCreateBinSem(SEM_COMM,0);

while(1)
{
OSSched();
}

}

void Task1(void)
{
while(1)
{
OS_Delay(50,Task1_1);
}
}

void Task2(void)
{
while(1)
{
OS_Delay(50,Task2_1);
}
}

#pragma code high_vector = 0x00008
void high_ISR (void)
{
_asm goto IntVector _endasm
}
#pragma code


void IntVector(void)
{
/************************************
*If the TMR0 overflow interrupt occurs
*then reset the TMR0 counter to the reload
*value and contiune. This determines the
*tick rate of the operating system.
************************************/
if(INTCONbits.T0IE && INTCONbits.T0IF)
{
INTCONbits.T0IF = 0;
TMR0L -=TMR0_RELOAD;
OSTimer();
}
if(PIR1bits.RCIF)
{
OSSignalBinSem(SEM_COMM);
}
}


Here is the build error:

Clean: Deleting intermediary and output files.
Clean: Deleted file "D:ElectronicsProjectsC18_(18F4520)Skeletondelay.o".
Clean: Deleted file "D:ElectronicsProjectsC18_(18F4520)Skeletonmain.o".
Clean: Deleted file "D:ElectronicsProjectsC18_(18F4520)Skeletonmem.o".
Clean: Deleted file "D:ElectronicsProjectsC18_(18F4520)SkeletonSkeleton.mcs".
Clean: Done.
Executing: "C:MCC18inmcc18.exe" -p=18F4520 /i"C:MCC18h" -I"D:ElectronicsProjectsC18_(18F4520)SumpMonitorFirmware" -I"C:salvoinc" "delay.c" -fo="delay.o" -Opa-
MPLAB C18 v3.02 (demo)
Copyright 1999-2005 Microchip Technology Inc.
Days remaining until demo becomes feature limited: 56
Executing: "C:MCC18inmcc18.exe" -p=18F4520 /i"C:MCC18h" -I"D:ElectronicsProjectsC18_(18F4520)SumpMonitorFirmware" -I"C:salvoinc" "main.c" -fo="main.o" -Opa-
MPLAB C18 v3.02 (demo)
Copyright 1999-2005 Microchip Technology Inc.
Days remaining until demo becomes feature limited: 56
Executing: "C:MCC18inmcc18.exe" -p=18F4520 /i"C:MCC18h" -I"D:ElectronicsProjectsC18_(18F4520)SumpMonitorFirmware" -I"C:salvoinc" "mem.c" -fo="mem.o" -Opa-
MPLAB C18 v3.02 (demo)
Copyright 1999-2005 Microchip Technology Inc.
Days remaining until demo becomes feature limited: 56
Executing: "C:Program FilesMicrochipMPASM SuiteMPLink.exe" /l"C:MCC18lib" -L"C:salvolib" /k"C:MCC18lkr" "C:MCC18lkr18f4520.lkr" "D:ElectronicsProjectsC18_(18F4520)Skeletondelay.o" "D:ElectronicsProjectsC18_(18F4520)Skeletonmain.o" "D:ElectronicsProjectsC18_(18F4520)Skeletonmem.o" "C:salvolibsfc18sna.lib" /m"Skeleton.map" /o"Skeleton.cof"
MPLINK 4.06, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - could not find definition of symbol 'OSlostTicks' in file 'init.o'.
Errors : 1


Any ideas would really be appreciated. I think I have the correct builds (versions) of the software.

Thank you

Guru_Wanabee
 
Posts: 11
Joined: Tue Dec 19, 2006 12:00 am

Re: Salvo - Compile Errors

Postby aek » Wed Dec 20, 2006 2:29 am

I can't tell from your project -- where is the mem.c that the project is referencing? Is it a local copy, or in c:Salvomem.c?

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

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

Re: Salvo - Compile Errors

Postby aek » Wed Dec 20, 2006 2:36 am

quote:
The following skeleton project does the exact same thing.
That's still too much code for test -- what happens if your main.c is just
code:
#include <p18f4520.h>
#include <salvo.h>

_OSLabel(Task1_1)

void Task1(void)
{
while(1)
{
OS_Yield(Task1_1);
}
}

void main(void)
{
OSInit();

OSCreateTask(Task1,OSTCBP(1),10);
}


in a project that has only main.c, Salvo's mem.c, and the Salvo library.

And what is delay.c?

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

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

Re: Salvo - Compile Errors

Postby aek » Wed Dec 20, 2006 2:52 am

Here's a quick build of the project ... works fine.
salvocfg.h:
code:
#define OSUSE_LIBRARY	      TRUE
#define OSLIBRARY_TYPE OSF
#define OSLIBRARY_GLOBALS OSN
#define OSLIBRARY_CONFIG OSA
#define OSLIBRARY_VARIANT OSNONE
#define OSEVENTS 5
#define OSEVENT_FLAGS 1
#define MESSAGE_QUEUES 1
#define OSTASKS 3


main.c:
code:
#include <p18f4520.h>
#include <salvo.h>

_OSLabel(Task1_1)

void Task1(void)
{
while(1)
{
OS_Delay(50,Task1_1);
}
}

void main(void)
{
OSInit();

OSCreateTask(Task1,OSTCBP(1),10);

while(1)
{
OSSched();
}
}



Output:
code:
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:salvoexamplegurumain.o".
Clean: Deleted file "C:salvosrcmem.o".
Clean: Deleted file "C:salvoexampleguruguru.cof".
Clean: Deleted file "C:salvoexampleguruguru.cod".
Clean: Deleted file "C:salvoexampleguruguru.hex".
Clean: Deleted file "C:salvoexampleguruguru.lst".
Clean: Done.
Executing: "C:mcc18inmcc18.exe" -p=18F4520 /i"C:salvoexampleguru" /i"c:salvoinc" "main.c" -fo="main.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:mcc18inmcc18.exe" -p=18F4520 /i"C:salvoexampleguru" /i"c:salvoinc" "mem.c" -fo="mem.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:mcc18inmplink.exe" /l"C:mcc18lib" "C:mcc18lkr18f4520.lkr" "C:salvoexamplegurumain.o" "C:salvosrcmem.o" "C:salvolibmcc18v3sfc18sna.lib" /o"guru.cof" /M"C:salvoexampleguruguru.map"
MPLINK 4.02, Linker
Copyright (c) 2006 Microchip Technology Inc.
Errors : 0

MP2COD 4.02, COFF to COD File Converter
Copyright (c) 2006 Microchip Technology Inc.
Errors : 0

MP2HEX 4.02, COFF to HEX File Converter
Copyright (c) 2006 Microchip Technology Inc.
Errors : 0

Loaded C:salvoexampleguruguru.cof.
BUILD SUCCEEDED: Wed Dec 20 16:06:42 2006


Note: main.c and c:salvomem.c are the only source files. Include path includes only project directory and c:salvoinc. Using Salvo library from c:salvomccv3 (or wherever you placed the Salvo libraries for MCC18 v3).

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

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

Re: Salvo - Compile Errors

Postby aek » Wed Dec 20, 2006 2:55 am

Looking at your build results, you have a local copy of Salvo's mem.c and perhaps one of delay.c (?!?!?) as well ... my guess is that you modified mem.c and now this is leading to those errors.

As per the Salvo user manual, there is never any reason to copy or modify Salvo's source files. Make sure you have added the original, unaltered mem.c to you project by Add Files ...

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

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

Re: Salvo - Compile Errors

Postby Guru_Wanabee » Wed Dec 20, 2006 4:19 am

I used the following skeleton program (Same as yours)

#include <p18f4520.h>
#include <salvo.h>

void Task1(void);

_OSLabel(Task1_1)


void main(void)
{
OSInit();
OSCreateTask(Task1,OSTCBP(1),10);
while(1)
{
OSSched();
}

}

void Task1(void)
{
while(1)
{
OS_Delay(50,Task1_1);
}
}

I still get the same error:

Clean: Deleting intermediary and output files.
Clean: Deleted file "D:ElectronicsProjectsC18_(18F4520)Skeletonmain.o".
Clean: Deleted file "D:ElectronicsProjectsC18_(18F4520)Skeletonmem.o".
Clean: Done.
Executing: "C:MCC18inmcc18.exe" -p=18F4520 /i"C:MCC18h" -I"D:ElectronicsProjectsC18_(18F4520)Skeleton" -I"C:salvoinc" "main.c" -fo="main.o" -Opa-
MPLAB C18 v3.02 (demo)
Copyright 1999-2005 Microchip Technology Inc.
Days remaining until demo becomes feature limited: 56
Executing: "C:MCC18inmcc18.exe" -p=18F4520 /i"C:MCC18h" -I"D:ElectronicsProjectsC18_(18F4520)Skeleton" -I"C:salvoinc" "mem.c" -fo="mem.o" -Opa-
MPLAB C18 v3.02 (demo)
Copyright 1999-2005 Microchip Technology Inc.
Days remaining until demo becomes feature limited: 56
Executing: "C:Program FilesMicrochipMPASM SuiteMPLink.exe" /l"C:MCC18lib" -L"C:salvolib" /k"C:MCC18lkr" "C:MCC18lkr18f4520.lkr" "D:ElectronicsProjectsC18_(18F4520)Skeletonmain.o" "D:ElectronicsProjectsC18_(18F4520)Skeletonmem.o" "C:salvolibsfc18sna.lib" /m"Skeleton.map" /o"Skeleton.cof"
MPLINK 4.06, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - could not find definition of symbol 'OSlostTicks' in file 'init.o'.
Errors : 1

I copied mem.c out of the src directory and placed it in my project directory. Unzipped the -c.zip and placed the files in the salvo lib folder directly (Overwriting any existing files from the original .exe).

$incdir = C:MCC18h;D:ElectronicsProjectsC18_(18F4520)Skeleton;C:salvoinc

$Libdir = C:MCC18lib;C:salvolib

$Lkrdir = C:MCC18lkr

My project tree has:
Source Files - Main.c & Mem.c
Header Files - salvo.h
Library Files - sfc18sna.lib
Linker Scripts - 18f4520.lkr

I don't have any idea why it won't compile for me?

Guru_Wanabee
 
Posts: 11
Joined: Tue Dec 19, 2006 12:00 am

Re: Salvo - Compile Errors

Postby aek » Wed Dec 20, 2006 7:00 am

quote:
I copied mem.c out of the src directory and placed it in my project directory.
Nowhere in any Salvo documentation does it say to copy mem.c to your local dir. Ever. Delete it (the one in your project) and when you Add Files, browse to salvosrcmem.c.
quote:
$incdir = C:MCC18h;D:ElectronicsProjectsC18_(18F4520)Skeleton;C:salvoinc
Use only $incdir = D:ElectronicsProjectsC18_(18F4520)Skeleton;C:salvoinc
quote:
$Libdir = C:MCC18lib;C:salvolib
Use only $Libdir = C:MCC18lib.

Only header file should be salvcocfg.h.

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

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

Re: Salvo - Compile Errors

Postby aek » Wed Dec 20, 2006 7:06 am

What happens when youi try to build a project that is supplied with Salvo (needs a $(BINDIR) set to the project directory)? Does that build?

I think what is happening is that there is a mismatch between what the project is picking up in the header files, and what is in that library. This can happen if you have other salvocfg.h's that are picked up (by accident). Put a #error Hi There! in your salvocfg.h and re-build -- should generate an error.

Or maybe your path (has a "_(18F4250)" in it) is somehow breaking the compiler.

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

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

Re: Salvo - Compile Errors

Postby aek » Wed Dec 20, 2006 7:07 am

Note also that your optimizations are more aggressive than mine -- might want to turn them off for now ...

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

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

Next

Return to Installation

Who is online

Users browsing this forum: No registered users and 1 guest

cron