Pumpkin, Inc.

Pumpkin User Forums

Pic18 + C18 + OSDelay (major trouble)

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®).

Pic18 + C18 + OSDelay (major trouble)

Postby Daani4all » Wed Dec 01, 2010 4:35 pm

Hello,
After reading a LOT and almost the entire user manual and several chapters in my book that covers salvo very superficial I have no one else to ask than here, hopefully someone have encauntered something similiar.

I installed Salvo lite with C18 compiler, using MPLAB.
Got the RTOS to work with smaller examples. No errors until today. Needed to get going with OS_Delay();
This is what the compiler says:

Error - could not find definition of symbol 'OSDelay' in file './main.o'.
Errors : 1

#pragma config OSC = INTIO67, FCMEN = OFF, IESO = OFF, PWRT = OFF, BOREN = SBORDIS, BORV = 3, WDT = OFF
#pragma config WDTPS = 32768, MODE = MC, ADDRBW = ADDR20BIT, DATABW = DATA16BIT, WAIT = OFF, CCP2MX = PORTC
#pragma config ECCPMX = PORTE, LPT1OSC = OFF, MCLRE = ON, STVREN = ON, LVP = OFF, BBSIZ = BB2K, XINST = OFF

#include <salvo.h>
#undef OSC
#include <p18f8722.h>
#include <stdio.h>
#include "portmap.h"
#include "Init.h"
#include "isr.h"
#include <timers.h>


void Count_Task( void );


_OSLabel(Count_Task1)
_OSLabel(Display_Task1)
_OSLabel(delay1)
_OSLabel(delay2)

void main( void )
{


Init();
OSInit();

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

while(1)
{

OSSched();
}
}

void Count_Task( void )
{


while(1)
{
LED1status = 1;

OS_Delay(2, delay1);

LED1status = 0;

OS_Delay(6, delay2);

OS_Yield(Count_Task1);
}
}
Daani4all
 
Posts: 14
Joined: Wed Dec 01, 2010 4:29 pm

Re: Pic18 + C18 + OSDelay (major trouble)

Postby aek » Thu Dec 02, 2010 10:22 am

To debug your problem, one needs a few more pieces of information, namely:

1) Your salvocfg.h
2) Your project's build settings. Specifically -- which Salvo library are you linking to?

I suspect you are linking to -- and your salvocfg.h is configured for -- a "-m" Salvo library, which is multitasking only. You need a Salvo library that supports delays. The "-t" libraries support all Salvo functionality. The salvocfg.h must match the library choice.

Alternatively, you may have failed to link a Salvo library altogether. However, since you're not throwing errors for OSInit(), OSCReateTask() or OSSched(), I don;t think this is the issue.

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

Re: Pic18 + C18 + OSDelay (major trouble)

Postby RufusVS » Thu Dec 02, 2010 10:55 am

In some cases you call it OS_Delay, and in others OSDelay.

Does it have an underscore or not? (this could be the only problem).

Or does Salvo actually use both forms?

Rufus
RufusVS
 
Posts: 2
Joined: Thu Dec 02, 2010 10:53 am

Re: Pic18 + C18 + OSDelay (major trouble)

Postby aek » Thu Dec 02, 2010 11:50 am

RufusVS wrote:In some cases you call it OS_Delay, and in others OSDelay.

Does it have an underscore or not? (this could be the only problem).

Or does Salvo actually use both forms?

Rufus

It is never referred to as OSDelay in any Salvo documentation.

The user is to use OS_Delay().

There is a function called OSDelay() inside the RTOS -- it is not a user function.
-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Pic18 + C18 + OSDelay (major trouble)

Postby RufusVS » Thu Dec 02, 2010 2:31 pm

Oops, misunderstanding.

In my message, the "you" was meant to refer to the OP (Daani4all),

not aek.

In the Original Message, it was spelled both ways. That might have explained
why one way wasn't found. The OP may have tried calling OSDelay() by accident.

Rufus

aek wrote:
RufusVS wrote:In some cases you call it OS_Delay, and in others OSDelay.

Does it have an underscore or not? (this could be the only problem).

Or does Salvo actually use both forms?

Rufus

It is never referred to as OSDelay in any Salvo documentation.

The user is to use OS_Delay().

There is a function called OSDelay() inside the RTOS -- it is not a user function.
RufusVS
 
Posts: 2
Joined: Thu Dec 02, 2010 10:53 am

Re: Pic18 + C18 + OSDelay (major trouble)

Postby Daani4all » Mon Dec 06, 2010 4:10 am

Thanks for the replies guys.

In my project I have added the salvocfg.h basically I copied it from salvo\\demo\\d1\\sysf\\salvocfg.h to my project folder, the same with
mem.c file, taken from salvo\\src\\mem.c

as I have been guided through the entire setup according to the book I got i find it very strange getting this errors.
after I added the two files I mentioned I also linked to the salvo library could that be a problem? the two files I added are placed in my project folder while my linking is pointing to salvos library on another harddrive? (partion)?

Very thankful for all help I can get
Daani4all
 
Posts: 14
Joined: Wed Dec 01, 2010 4:29 pm

Re: Pic18 + C18 + OSDelay (major trouble)

Postby aek » Mon Dec 06, 2010 11:29 am

Post the exact salvocfg.h

Post the exact name of the library you're linking to

Post the entire Build Results window from MPLAB.

Without them, there's not much I can do to help you.
-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Pic18 + C18 + OSDelay (major trouble)

Postby Daani4all » Tue Dec 07, 2010 3:01 pm

[size=85]----------------------------------------------------------------------
Release build of project `D:\Tekniska H
Daani4all
 
Posts: 14
Joined: Wed Dec 01, 2010 4:29 pm

Re: Pic18 + C18 + OSDelay (major trouble)

Postby aek » Wed Dec 08, 2010 9:25 am

Your salvocfg.h is completely wrong (it's for a Salvo Pro source-code build -- you are doing a library build), and you are using an -m library, that does not support delays.

Please follow the salvocfg.h examples in the reference manual: http://www.pumpkininc.com/content/doc/m ... -mcc18.pdf , page 7, "Salvo Lite Library Build".
-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Pic18 + C18 + OSDelay (major trouble)

Postby Daani4all » Wed Dec 08, 2010 12:44 pm

Thanks for the really fast answers.

In the reference manual for library build there is this short example?

#define OSUSE_LIBRARY TRUE
#define OSLIBRARY_TYPE OSF
#define OSLIBRARY_GLOBALS OSF
#define OSLIBRARY_CONFIG OSA
#define OSTASKS 2
#define OSEVENTS 4
#define OSEVENT_FLAGS 0
#define OSMESSAGE_QUEUES


I mean? how do I know wich salvocfg.h file I should include? there are a lot in the salvo folder to choose from?
and about the -m library? what library should I use? this is quite messy because I installed and configure it according to the chapters in "Designing embedded systems in PIC microcontroller" and this is where I got..

Thanks for all the help
Daani4all
 
Posts: 14
Joined: Wed Dec 01, 2010 4:29 pm

Next

Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 0 guests

cron