Page 1 of 1

Source Build Error - Cyclic Timers

PostPosted: Tue Apr 19, 2005 5:41 am
by MASTCoder
Hi, I'm writing a program that requires cyclic timers. I found that I could not use cyclic timers with the STD_LIB option, so I decided to create a source build. These are the flags in my source build:

#elif defined(MAKE_WITH_SOURCE)
/* */
/* Salvo Pro source-code build */
/* */
#define OSDISABLE_TASK_PRIORITIES FALSE
#define OSENABLE_EVENT_FLAGS TRUE
#define OSENABLE_IDLING_HOOK TRUE
#define OSENABLE_MESSAGES TRUE
#define OSENABLE_MESSAGE_QUEUES TRUE
#define OSENABLE_SEMAPHORES TRUE
#define OSENABLE_TIMEOUTS TRUE
#define OSENABLE_BINARY_SEMAPHORES TRUE
#define OSTASKS 2
#define OSEVENTS 4
#define OSEVENT_FLAGS 1
#define OSMESSAGE_QUEUES 0
#define OSBYTES_OF_DELAYS 2
#define OSBYTES_OF_TICKS 4
#define OSBYTES_OF_EVENT_FLAG 2
#define OSENABLE_CYCLIC_TIMERS TRUE

I have the line #define MAKE_WITH_SOURCE at the top of my salvocfg.h file.


I'm making a call to OSCreateCycTmr in my main() function. I'm using the MPLAB C18 compiler. This is the error I get:

MPLINK 3.70.02, Linker
Copyright (c) 2004 Microchip Technology Inc.
Error - could not find definition of symbol 'OSCreateCycTmr' in file 'C:CodeSalvo estmmc.o'.
Errors : 1

The cyclic.c file is part of my project as required. After looking around for a while, I found that the condition #if OSENABLE_CYCLIC_TIMERS in the cyclic.c file was not being asserted. I tested this by inserting some junk characters after the #if and found that the program compiled without complaining about the junk characters. When I changed the #if to a #ifdef however, I started getting a new list of errors:

C:salvosrccyclic.c:109:Error [1205] unknown member 'dly' in 'tcb'
C:salvosrccyclic.c:109:Error [1205] unknown member 'delay' in 'tcb'
C:salvosrccyclic.c:109:Error [1131] type mismatch in assignment
C:salvosrccyclic.c:110:Error [1205] unknown member 'u' in 'tcb'
C:salvosrccyclic.c:110:Error [1205] unknown member 'period' in 'tcb'
C:salvosrccyclic.c:110:Error [1131] type mismatch in assignment

I'm really not sure what's going on here. I was hoping someone could point me in the right direction.

Thanks.


Re: Source Build Error - Cyclic Timers

PostPosted: Tue Apr 19, 2005 5:52 am
by MASTCoder
I would just like to add that I am coding on the PIC18F8720 microcontroller.

Re: Source Build Error - Cyclic Timers

PostPosted: Tue Apr 19, 2005 7:26 am
by aek
Hi.

1) Cyclic timers are available in the t-config libraries. And not in any other libraries, because cyclic timers and timeouts are "related." So I suggest going back to a library build, changing OSLIBRARY_CONFIG to OST, and changing the library you link to to the appropriate one.

2) Not sure why your source-code build isn't working -- you can look in salvoincsalvolib.h to ascertain the complete set of configuration options that are used to generate t-config libraries.

[This message has been edited by aek (edited April 19, 2005).]


Re: Source Build Error - Cyclic Timers

PostPosted: Thu Apr 21, 2005 4:08 am
by MASTCoder
Thanks for the reply. I tried doing as you suggested. I reverted to a library build (#define MAKE_WITH_STD_LIB) and set the OSLIBRARY_CONFIG to OST as follows:

#define OSLIBRARY_CONFIG OST

I tried recompiling the code but I still code the same errors (OSCreateCycTmr definition not found in testmmc.o)

A little testing shows that it is the same problem with the cyclic.c file. The #if OSENABLE_CYCLIC_TIMERS condition is NOT being evaluated. Changing this to #ifdef OSENABLE_CYCLIC_TIMERS or #if defined(OSENABLE_CYCLIC_TIMERS) does cause the following OSCreateCycTimer function to be compiled but causes the second set of errors (unknown member dly etc). I believe this might have to do with other #if conditionals that are not being evaluated elsewhere. I'm going to try changing all the appropriate #if's to #if defined() to see if that works.

I also checked the OST flags in salvolib.h but they appear to be the same ones I used in my earlier source build.


I was wondering if there was something I am fundamentally doing wrong? My standard library build works correctly when I am not using cyclic timers. It's only after I tried tinkering with timers that this problem started. Any help would be much appreciated.

Thanks.

[This message has been edited by MASTCoder (edited April 21, 2005).]


Re: Source Build Error - Cyclic Timers

PostPosted: Fri Apr 22, 2005 11:13 am
by aek
quote:
Thanks for the reply. I tried doing as you suggested. I reverted to a library build (#define MAKE_WITH_STD_LIB) and set the OSLIBRARY_CONFIG to OST as follows:

#define OSLIBRARY_CONFIG OST

I tried recompiling the code but I still code the same errors (OSCreateCycTmr definition not found in testmmc.o)


Did you also change the library you link to to a t-config library?

I did two things from a re-installation of Salvo Pro for PICmicros v3.2.3 to check this -- both worked fine.

1) Take the tu5lite project, add a call to OSCreateCycTmr() in main.c, change OSLIBRARY_CONFIG to OST in salvocfg.h, change the linked-to library to sfp80ltb.lib, and rebuild -- no problems.

2) Take tu5pro project, add a call to OSCreateCycTmr() in main.c, add #define OSENABLE_CYCLIC_TIMERS TRUE in salvocfg.h, add salvosrccyclic.c to the file list, and rebuild -- works fine.

Does this help?

For the library build situation, I suspect you're not changing libraries (setting OSLIBRARY_CONFIG does not change the library -- it just sets Salvo's config options correctly for a particular library).

For the source-code build, my guess is that perhaps your paths are such that a different file or files are being pulled in, and not your salvocfg.h. When this sort of craziness happens I usually pepper my header files, etc. with #error directives, to ensure that it's really picking up those portions that I think it's picking up.

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

[This message has been edited by aek (edited April 22, 2005).]