Pumpkin, Inc.

Pumpkin User Forums

Help me Regarding OSCreate()

If you have a general question or comment regarding Salvo, post it here.

Help me Regarding OSCreate()

Postby Sathishkumar » Tue Nov 18, 2008 2:13 am

Hi,
i'm just wrote a blinking Program but there is some bugs come, i couldn't rectify that , so Please help me.

My code is...

#if !defined (MAKE_WITH_FREE_LIB) && !defined (MAKE_WITH_STD_LIB)

/* */
/* configuration options for project that's made using the */
/* source files. */
/* */
#define OSCOMPILER OSHT_PICC
#define OSEVENTS 0
#define OSTARGET OSPIC18
#define OSTASKS 2
#define OSLOC_ALL

#else

/* */
/* configuration options for projects that are made using */
/* either the freeware or standard libraries. Multitasking */
/* with delays and events, events services called only */
/* from background. */
/* */
#define OSUSE_LIBRARY TRUE
#ifdef MAKE_WITH_FREE_LIB
#define OSLIBRARY_TYPE OSF
#elif defined(MAKE_WITH_STD_LIB)
#define OSLIBRARY_TYPE OSL
#endif
#define OSLIBRARY_CONFIG OSM
#define OSLIBRARY_VARIANT OSNONE

#endif

//******************************
//******final.h*********

#include "mem.c"
#include "inittask.c"
#include "init.c"
#include "delay.c"
#include "task.c"
#include "chk.c"

#define MAKE_WITH_STD_LIB TRUE


#define PORT PORTE

#define Init() do{ TRISE = 0X00;
PORTE = 0X00;
}while(0)


__CONFIG(1, HS);


//******************************************
//********Main program**************

#include "salvo.h"
#include "final.h"

#define Task1_P OSTCBP(1)
#define Task2_P OSTCBP(2)

void TaskBlink(void);
void TaskShow(void);

_OSLabel(TaskBlink1)
_OSLabel(TaskShow1)

void TaskBlink(void){
OS_Delay(50,TaskBlink1);
PORT^=~0x02;
OS_Delay(50,TaskBlink1);
}

int main(void) {
Init();

OSInit();
OSCreateTask(TaskBlink, Task1_P,1);
OSCreateTask(TaskShow, Task2_P,1);

for(;
OSSched();
}


After compiling the project igot error as...

Warning[361] C:Documents and Settings each-3Desktopexfinal.c 16 : function declared implicit int
Error[192] C:Documents and Settings each-3Desktopexfinal.c 25 : undefined identifier "OStcbArea"
Error[981] C:Documents and Settings each-3Desktopexfinal.c 25 : pointer required
Error[981] C:Documents and Settings each-3Desktopexfinal.c 25 : pointer required
Warning[359] C:Documents and Settings each-3Desktopexfinal.c 25 : illegal conversion between pointer types
Error[981] C:Documents and Settings each-3Desktopexfinal.c 26 : pointer required
Error[981] C:Documents and Settings each-3Desktopexfinal.c 26 : pointer required
Warning[359] C:Documents and Settings each-3Desktopexfinal.c 26 : illegal conversion between pointer types
Halting build on first failure as requested.

Sathishkumar
 
Posts: 6
Joined: Tue Oct 28, 2008 11:00 pm
Location: Couimbatore,Tamil Nadu,INDIA

Re: Help me Regarding OSCreate()

Postby aek » Tue Nov 18, 2008 8:24 am

1) Looks like you have not included Salvo's mem.c in your project.

2) You've repeated (i.e., used) the label "TaskBlink1" twice -- each label must only be used once.

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

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

Re: Help me Regarding OSCreate()

Postby Sathishkumar » Wed Nov 19, 2008 2:06 am

quote:
Originally posted by aek:
1) Looks like you have not included Salvo's mem.c in your project.

2) You've repeated (i.e., used) the label "TaskBlink1" twice -- each label must only be used once.


Sathishkumar
 
Posts: 6
Joined: Tue Oct 28, 2008 11:00 pm
Location: Couimbatore,Tamil Nadu,INDIA

Re: Help me Regarding OSCreate()

Postby Sathishkumar » Wed Nov 19, 2008 2:16 am

quote:
Originally posted by Sathishkumar:

Thank you very much..
By GOD's grace the problem rectified..

But there is one error occur, I couldn't understand what kind of problem is?.. please help me
***************************************

my code is...


#include "salvo.h"
#include "salvocfg.h"

#include "pic18.h"
#include "htc.h"

#define PORT PORTE
#define TaskA1_P OSTCBP(1)

__CONFIG(1,HS);

_OSLabel(TaskA1)
_OSLabel(TaskA2)


void TaskA (void);

void main (void){

TRISE = 0X00;
PORTE = 0x00;
ADCON0 = 0b00001001;

OSInit();

OSCreate(TaskA, TaskA1_P,1);

while(1){
OSSChed();
}
}
void TaskA (void){
while(1){
PORTE = 0;
OS_Delay(50,TaskA1);
PORTE = 1;
OS_Dealy(50,TaskA2);
}
}
******************************************
My Salvocfg.h file is...

#define SYSF TRUE
#define MAKE_WITH_STD_LIB TRUE
#define OSBYTES_OF_DELAYS 1
#define OSCLEAR_UNUSED_POINTERS TRUE
#define OSCOMPILER OSHT_PICC
#define OSSET_LIMITS TRUE
#define OSTARGET OSPIC18
#define OSTASKS 2
#define OSLOC_ALL near
********************************
The Error is...

Advisory[1207] : some of the command line options you are using are now obsolete
Advisory[1208] : use --help option or refer to the user manual for option details
Error[500] : undefined symbols:
_OStcbArea (C:prog_filesalvo.obj)_TaskA2 (C:prog_filesalvo.obj)_OS_Dealy (C:prog_filesalvo.obj)_OSSChed (C:prog_filesalvo.obj)_OSCreate (C:prog_filesalvo.obj)?_OS_Dealy (C:prog_filesalvo.obj)_OSInit (C:prog_filesalvo.obj)?_OSSaveRtnAddr (C:prog_filesalvo.obj)_OSSaveRtnAddr (C:prog_filesalvo.obj)_OSDelay (C:prog_filesalvo.obj)
BUILD FAILED: Wed Nov 19 15:31:00 2008

#define OSENABLE_TASKS TRUE
#define OSENABLE_DELAYS TRUE
#define OSENABLE_TICKS TRUE

Sathishkumar
 
Posts: 6
Joined: Tue Oct 28, 2008 11:00 pm
Location: Couimbatore,Tamil Nadu,INDIA

Re: Help me Regarding OSCreate()

Postby aek » Wed Nov 19, 2008 9:28 am

Which compiler / tools?

Salvo Library build or Salvo (Pro) source-code build?

OS_Dealy() --> OS_Delay()
OSCreate() --> OSCreateTask()

Please post the _entire_ build results window.

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

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

Re: Help me Regarding OSCreate()

Postby Sathishkumar » Fri Nov 21, 2008 10:50 am

Dear aek,
I have used the HI-TECH PICC-18 COMPILER (Microchip PIC micro) V9.50PL3 , MPLAB v8.0 and Salvo v 2.2.1.

I don't know how to choose the library file. in this project I'm using pic18f4550.

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

#define SYSF TRUE
#define MAKE_WITH_STD_LIB TRUE
//#define TEST_SYSTEM_F TRUE

//#define OSBYTES_OF_EVENT_FLAGS 1 //c
//#define OSBYTES_OF_COUNTS 1 //c
#define OSBYTES_OF_DELAYS 1 //c
//#define OSBYTES_OF_TICKS 1 //c
//#define OSCLEAR_WATCHDOG_TIMER() asm("clrwdt") /* in case of wrong __CONFIG */
#define OSCLEAR_UNUSED_POINTERS TRUE
#define OSCOMPILER OSHT_PICC
//#define OSEVENTS 1 //c
//#define OSEVENT_FLAGS 1
//#define OSENABLE_BINARY_SEMAPHORES FALSE //c /* squeeze OSRpt() */
//#define OSENABLE_EVENT_FLAGS FALSE //c /* squeeze OSRpt() */
//#define OSENABLE_EVENT_READING FALSE //c
//#define OSENABLE_EVENT_TRYING FALSE
//#define OSENABLE_IDLE_COUNTER FALSE
//#define OSENABLE_IDLE_TASK FALSE
//#define OSENABLE_IDLE_TASK_HOOK FALSE
//#define OSENABLE_MESSAGES FALSE /* squeeze OSRpt() */
//#define OSENABLE_MESSAGE_QUEUES FALSE /* squeeze OSRpt() */
//#define OSENABLE_SCHEDULER_HOOK FALSE
//#define OSENABLE_TIMEOUTS FALSE
//#define OSENABLE_SEMAPHORES FALSE
//#define OSENABLE_STACK_CHECKING FALSE
//#define OSFLATTEN_EVENT_SERVICES FALSE
//#define OSGATHER_STATISTICS FALSE
//#define OSLOGGING FALSE
//#define OSRPT_HIDE_INVALID_POINTERS FALSE
//#define OSRPT_SHOW_ONLY_ACTIVE FALSE
//#define OSRPT_SHOW_TOTAL_DELAY FALSE
#define OSSET_LIMITS FALSE
#define OSTARGET OSPIC18
#define OSTASKS 2
//#define OSTIMER_PRESCALAR 5

#define OSUSE_EVENT_TYPES TRUE
#define OSUSE_INLINE_OSSCHED TRUE
#define OSUSE_INLINE_OSTIMER TRUE
#define OSUSE_INSELIG_MACRO TRUE
#define OSUSE_ARRAYS FALSE
#define OSOPTIMIZE_FOR_SPEED FALSE

#define OSLOC_ALL near
#define OSENABLE_TASKS TRUE
#define OSENABLE_DELAYS TRUE
#define OSENABLE_TICKS TRUE
#define OSLIBRARY_TYPE OSF

#define OSLIBRARY_CONFIG OSD
#define OSLIBRARY_VARIANT OSNONE
//#define USING_MPLAB_ICE2000 TRUE


********************************
Main File
********************************

#include "salvo.h"
#include "salvocfg.h"
#include "pic18.h"
#include "htc.h"

#define PORT PORTE
#define TaskA1_P OSTCBP(1)

__CONFIG(1,HS);

_OSLabel(TaskA1)
_OSLabel(TaskA2)


void TaskA (void);

void main (void){

TRISE = 0X00;
PORTE = 0x00;
ADCON0 = 0b00001001;

OSInit();

OSCreateTask(TaskA, TaskA1_P,1);

while(1){
OSSChed();
}
}
void TaskA (void){
while(1){
PORTE = 0;
OS_Delay(50,TaskA1);
PORTE = 1;
OS_Delay(50,TaskA2);
}
}


The Compiler shows the following Errors.

************************************
Output Window
************************************

Clean: Deleting intermediary and output files.
Clean: Deleted file "C:prog_filemem.obj".
Clean: Deleted file "C:prog_filemem.sdb".
Clean: Deleted file "C:prog_filemem.rlf".
Clean: Deleted file "C:prog_filemem.lst".
Clean: Deleted file "C:prog_filesalvo.obj".
Clean: Deleted file "C:prog_filesalvo.sdb".
Clean: Deleted file "C:prog_filesalvo.rlf".
Clean: Deleted file "C:prog_filesalvo.lst".
Clean Warning: File "C:prog_filesalvo.cof" doesn't exist.
Clean Warning: File "C:prog_filesalvo.hex" doesn't exist.
Clean: Deleted file "C:prog_filesalvo.sym".
Clean: Deleted file "C:prog_filesalvo.map".
Clean Warning: File "C:prog_filesalvo.hxl" doesn't exist.
Clean Warning: File "C:prog_filestartup.lst" doesn't exist.
Clean Warning: File "C:prog_filestartup.rlf" doesn't exist.
Clean: Done.
Build C:prog_filesalvo for device 18F4550
Using driver C:Program FilesHI-TECH SoftwarePICC-189.50inpicc18.exe

Executing: "C:Program FilesHI-TECH SoftwarePICC-189.50inpicc18.exe" -C C:Salvosourcemem.c -q --chip=18F4550 -P --runtime=default --opt=none -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Executing: "C:Program FilesHI-TECH SoftwarePICC-189.50inpicc18.exe" -C C:prog_filesalvo.c -q --chip=18F4550 -P --runtime=default --opt=none -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Warning [176] C:prog_filesalvo.c; 74.0 missing newline
Warning [361] C:prog_filesalvo.c; 63.1 function declared implicit int
Warning [337] C:prog_filesalvo.c; 73.1 line does not have a newline on the end
Executing: "C:Program FilesHI-TECH SoftwarePICC-189.50inpicc18.exe" -osalvo.cof -msalvo.map --summary=default --output=default mem.obj salvo.obj C:Salvolibraryslp801m-.lib "C:Program FilesHI-TECH SoftwarePICC-189.50libpic86sfw.lib" --chip=18F4550 -P --runtime=default --opt=none -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
HI-TECH PICC-18 COMPILER (Microchip PIC micro) V9.50PL3
Copyright (C) 1984-2006 HI-TECH SOFTWARE
Serial number: HCPIC18-66666
Employing 18F4550 errata work-arounds:
* Corrupted fast interrupt shadow registers
Error [484] ; . psect "nvram" can't be in classes "RAM" and "NVRAM"
Error [500] ; . undefined symbols:
_OSSChed (salvo.obj)_OSDelay (salvo.obj)


please help me....

[This message has been edited by Sathishkumar (edited November 23, 2008).]

[This message has been edited by Sathishkumar (edited November 24, 2008).]

Sathishkumar
 
Posts: 6
Joined: Tue Oct 28, 2008 11:00 pm
Location: Couimbatore,Tamil Nadu,INDIA

Re: Help me Regarding OSCreate()

Postby aek » Mon Nov 24, 2008 8:22 am

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

Re: Help me Regarding OSCreate()

Postby aek » Fri Nov 28, 2008 8:31 am

1) Your salvocfg.h is illegal -- see RM-PICC18.PDF for examples of legal salvocfg.h.

2) Your OSLIBRRAY_CONFIG (OSD) does not match the library you're using (a Salvo -a lib, sfp82lab.lib). Make these match (see RM-PICC18.PDF).

3) The Salvo distribution contains projects that are properly configured -- reference them.

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

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

Re: Help me Regarding OSCreate()

Postby Sathishkumar » Fri Nov 28, 2008 12:03 pm

Dear aek,
Thank you for your guidance, I linked the library but still the problems exists..

I using

Salvo 2.2.1
Hi-Tech 9.50 L3
Mplab IDE.
and PIC 18f258.

In this project i'm linked the sfp82lab.lib

but the compiler shows as....

////////////////////////////////////////////

Clean: Deleting intermediary and output files.
Clean: Deleted file "C:mysalvoc18f16f.obj".
Clean: Deleted file "C:mysalvoc18f16f.cce".
Clean: Deleted file "C:mysalvoc18fmem.obj".
Clean: Deleted file "C:mysalvoc18fmem.cce".
Clean: Done.
Executing: "C:Program FilesHI-TECH SoftwarePICC-189.50inpicc18.exe" -C -E"16f.cce" "16f.c" -O"16f.obj" -Zg9 -O -ASMLIST -Q -MPLAB -18F258
Advisory[1207] : some of the command line options you are using are now obsolete
Advisory[1208] : use --help option or refer to the user manual for option details
Warning[176] C:mysalvoc18f16f.c 75 : missing newline
Warning[361] C:mysalvoc18f16f.c 64 : function declared implicit int
Warning[337] C:mysalvoc18f16f.c 74 : line does not have a newline on the end
Executing: "C:Program FilesHI-TECH SoftwarePICC-189.50inpicc18.exe" -C -E"mem.cce" "mem.c" -O"mem.obj" -Zg9 -O -ASMLIST -Q -MPLAB -18F258
Advisory[1207] : some of the command line options you are using are now obsolete
Advisory[1208] : use --help option or refer to the user manual for option details
Executing: "C:Program FilesHI-TECH SoftwarePICC-189.50BINPICC18.EXE" -E"18f258.lde" "C:mysalvoc18f16f.obj" "C:mysalvoc18fmem.obj" "C:salvo-1libhtpicc18sfp82lab.lib" -M"18f258.map" -O"18f258.cof" -O"18f258.hex" -Q -MPLAB -18F258
Advisory[1207] : some of the command line options you are using are now obsolete
Advisory[1208] : use --help option or refer to the user manual for option details
Error[500] : undefined symbols:
_OSsigQinP (C:salvo-1libhtpicc18sfp82lab.lib: init.obj)_OStcbArea (C:mysalvoc18f16f.obj)_OScTcbP (C:mysalvoc18f16f.obj)_OSsigQoutP (C:salvo-1libhtpicc18sfp82lab.lib: init.obj)_OSSChed (C:mysalvoc18f16f.obj)_OSlostTicks (C:salvo-1libhtpicc18sfp82lab.lib: init.obj)_OStimerTicks (C:salvo-1libhtpicc18sfp82lab.lib: init.obj)_OSdelayQP (C:mysalvoc18f16f.obj)_OSeligQP (C:salvo-1libhtpicc18sfp82lab.lib: init.obj)
BUILD FAILED: Fri Nov 28 13:18:49 2008

///////////////////////////////////////////
or
some times it shows as

///////////////////////////////////////////

Error[484] : psect "nvram" can't be in classes "RAM" and "NVRAM"

///////////////////////////////////////////

I'm just confusing weather we should only salvo library or both salvo and pic libraries.

If you don't mind ,You just give some simple sample code for the 18f pic with the library link .

Thank you..

Sathishkumar
 
Posts: 6
Joined: Tue Oct 28, 2008 11:00 pm
Location: Couimbatore,Tamil Nadu,INDIA

Re: Help me Regarding OSCreate()

Postby Sathishkumar » Tue Dec 02, 2008 9:06 am

Dear Andrew,
Thank you very much for your guidance. I got the result and now I try to develop some concepts , If I have any doubts I'll contact you.

Thanks & Regards.
Sathish.

Sathishkumar
 
Posts: 6
Joined: Tue Oct 28, 2008 11:00 pm
Location: Couimbatore,Tamil Nadu,INDIA


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron