Page 1 of 1

error OSCreateMsgQ()

PostPosted: Wed Mar 29, 2006 1:57 am
by mfan
Hi, I tried to use message queue to modify the tutorial tut6. But get stuck in the first place while trying to create the queue.
Code segment is below followed by the compile error result. Any help is appreciated!


#define MSGQ_P OSECBP(1)
#define MQCB_P OSMQCBP(1)

#define SIZEOF_MSGQ 8

//allocate memory for buffer
OSgltypeMsgQP MsgQBuff[SIZEOF_MSGQ];

void main( void )
{
Init();
OSInit();

//OSCreateTask(TaskCount, TASK_COUNT_P, PRIO_COUNT);

OSCreateMsgQ(MSGQ_P, MQCB_P, MsgQBuff, SIZEOF_MSGQ);

OSEi();

for (;
{
OSSched();
}
}


Compile error:

Error[000] H:HTSOFTSalvoLite ut u6main.c 131 : undefined identifier: OSmqcbArea
Error[000] H:HTSOFTSalvoLite ut u6main.c 131 : pointer required
Error[000] H:HTSOFTSalvoLite ut u6main.c 131 : pointer required
Warning[000] H:HTSOFTSalvoLite ut u6main.c 131 : illegal conversion between pointer types


Re: error OSCreateMsgQ()

PostPosted: Wed Mar 29, 2006 5:00 am
by aek
Please cut and paste the entire Build Results from the MPLAB Output window after a Build All, and also your entire salvocfg.h. Without that info it's not easy to debug your problem.

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


Re: error OSCreateMsgQ()

PostPosted: Wed Mar 29, 2006 8:03 am
by aek
OSMESSAGE_QUEUES needs to be set to 1 or greater in salvocfg.h -- see User Manual.

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


Re: error OSCreateMsgQ()

PostPosted: Wed Mar 29, 2006 8:06 am
by mfan
Yes here was the definition I used while compiling that code...but didn't work

#define OSEVENTS 5
#define OSEVENT_FLAGS 5
#define OSMESSAGE_QUEUES 5
#define OSTASKS 3


Re: error OSCreateMsgQ()

PostPosted: Wed Mar 29, 2006 8:27 am
by aek
Salvo Lite supports only a single message queue and a single event flag -- please change your salvocfg.h.

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


Re: error OSCreateMsgQ()

PostPosted: Wed Mar 29, 2006 8:30 am
by mfan
Thanks but I just changed to 1 the compile error still remains.

#define OSEVENTS 1
#define OSEVENT_FLAGS 1
#define OSMESSAGE_QUEUES 1
#define OSTASKS 3


Re: error OSCreateMsgQ()

PostPosted: Thu Mar 30, 2006 2:04 am
by mfan
sorry...my mistake. I did not specify correct MPLAB include path. Compile is now passed.

Re: error OSCreateMsgQ()

PostPosted: Thu Mar 30, 2006 12:47 pm
by mfan
Sure...here is the salvocfg.h, followed by the build all result.


/************************************************************
Copyright (C) 1995-2002 Pumpkin, Inc. and its
Licensor(s). Freely distributable.

$Source: C:\RCS\d\salvo\tut\tu6\sysf\salvocfg.h,v $
$Author: aek $
$Revision: 3.2 $
$Date: 2002-10-06 15:31:29-07 $

Header file for tutorial programs.

************************************************************/

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

/* */
/* configuration options for project that's made using the */
/* source files. */
/* */
#define OSBYTES_OF_DELAYS 1
#define OSCLEAR_WATCHDOG_TIMER() asm(" clrwdt")
#define OSENABLE_IDLING_HOOK TRUE
#define OSENABLE_MESSAGES TRUE
#define OSEVENTS 1
#define OSTASKS 3
#define OSLOC_ALL near
#else

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


/* these were added for v2.3.0 to minimize RAM requirements */
/* so that the application could fit on the 16F84. They */
/* aren't needed (and mem.c need not be a node in the */
/* project) for PICmicros with more RAM. */
#define OSEVENTS 1
#define OSEVENT_FLAGS 1
#define OSMESSAGE_QUEUES 1
#define OSTASKS 3

#endif


Clean: Deleting intermediary and output files.
Clean: Deleted file "H:HTSOFTSalvoLitesrcmem.obj".
Clean: Deleted file "H:HTSOFTSalvoLitesrcmem.cce".
Clean: Deleted file "H:HTSOFTSalvoLite ut u1isr.obj".
Clean: Deleted file "H:HTSOFTSalvoLite ut u1isr.cce".
Clean: Deleted file "H:HTSOFTSalvoLite ut u6main.cce".
Clean: Deleted file "H:HTSOFTSalvoLite ut u6sysfmytu6.mcs".
Clean: Done.
Executing: "H:HTSOFTPIC18_V8.35PL3inpicc18.exe" -C -E"mem.cce" "mem.c" -O"mem.obj" -I"H:HTSOFTSalvoLiteinc" -I"H:HTSOFTSalvoLite ut u1" -I"H:HTSOFTSalvoLite ut u5sysf" -Zg9 -O -DMAKE_WITH_FREE_LIB -DSYSF -ASMLIST -Q -MPLAB -18F8722
Executing: "H:HTSOFTPIC18_V8.35PL3inpicc18.exe" -C -E"isr.cce" "isr.c" -O"isr.obj" -I"H:HTSOFTSalvoLiteinc" -I"H:HTSOFTSalvoLite ut u1" -I"H:HTSOFTSalvoLite ut u5sysf" -Zg9 -O -DMAKE_WITH_FREE_LIB -DSYSF -DUSE_INTERRUPTS -ASMLIST -Q -MPLAB -18F8722
Executing: "H:HTSOFTPIC18_V8.35PL3inpicc18.exe" -C -E"main.cce" "main.c" -O"main.obj" -I"H:HTSOFTSalvoLiteinc" -I"H:HTSOFTSalvoLite ut u1" -I"H:HTSOFTSalvoLite ut u5sysf" -Zg9 -O -DMAKE_WITH_FREE_LIB -DSYSF -DUSE_INTERRUPTS -ASMLIST -Q -MPLAB -18F8722
Warning[000] H:HTSOFTSalvoLite ut u6main.c 112 : unused variable definition: err (from line 95)
Error[000] H:HTSOFTSalvoLite ut u6main.c 131 : undefined identifier: OSmqcbArea
Error[000] H:HTSOFTSalvoLite ut u6main.c 131 : pointer required
Error[000] H:HTSOFTSalvoLite ut u6main.c 131 : pointer required
Warning[000] H:HTSOFTSalvoLite ut u6main.c 131 : illegal conversion between pointer types
Halting build on first failure as requested.
BUILD FAILED: Thu Mar 30 09:45:45 2006