Pumpkin, Inc.

Pumpkin User Forums

OSReturnSem()

If you can't make Salvo do what you want it to do, post it here.

OSReturnSem()

Postby Antonio » Wed Jan 01, 2003 5:13 am

Hello
The compiler gives me the following error:
function _OSReturnSem is not called from specified interrupt level, I tried to solving it inluding a call to this service in my ISR but there is no references about this funtion in the user manual.What I should do?
Antonio
 
Posts: 3
Joined: Sat Aug 24, 2002 11:00 pm

Re: OSReturnSem()

Postby aek » Wed Jan 01, 2003 9:52 am

Hi Antonio.

In the future, please provide more information for tech support, like which compiler (PICC?), which library (sfp42Cab.lib?), your salvocfg.h, etc.

My guess is that you are trying to call OSReadSem() or OSTrySem() from an ISR and maybe also from mainline code (they both call OSReturnSem()) ... to do this, you need to use an a-variant library (like sfp42Caa.lib) instead of a b-variant library (like sfp42Cab.lib). The a-variant libraries allow (and indeed, require, in the case of PICC and PICC-18) certain Salvo API services to be called from both mainline and ISR code.

You will have to change OSLIBRARY_VARIANT in your salvocfg.h to OSA from OSB.

See "Calling Event Services from Within Interrupts" in our App Note AN-1 for more information on how to solve this error.

If you are doing a source-code build, you'll need to include salvosrcsem2.c in your build, and set OSCALL_OSXYZ to the appropriate value -- see the User Manual. But I suspect you're doing a library build.

Regards,

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

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

Re: OSReturnSem()

Postby Antonio » Thu Jan 02, 2003 2:07 am

Hi
My compiler is HI_TECH PICC V8.00PL2,
I´m using sfp42caa.lib and OSA library config and variant.I´m calling OS_WaitSem,OSSignalSem semaphore services only.
Antonio
 
Posts: 3
Joined: Sat Aug 24, 2002 11:00 pm

Re: OSReturnSem()

Postby aek » Thu Jan 02, 2003 9:48 am

Hi Antonio.

OK, so have you followed the advice in AN-1?

For every API service like OSSignalSem(), with a -aa library, it needs to be called from both mainline (background / task) and foreground (ISR) levels. And your ISR needs to be at interrupt_level 0.

Especially look at the

code:
if (0) OSSignalSem();

construct outlined in AN-1 that is needed to satisfy the compiler's call tree analysis.

If possible, please cut and past the text in MPLAB's Build Results window to this Forum Thread.

If you cannot get it to work, please email your entire MPLAB project to support@pumpkininc.com and we'll figure out what's wrong.

Regards,

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

[This message has been edited by aek (edited January 02, 2003).]

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

Re: OSReturnSem()

Postby Antonio » Fri Jan 03, 2003 6:19 am

Hi
I´v solved the problem difining OSENABLE_EVENT_TRYING TRUE and calling OSTrySem() from my ISR.
Thank you for your interest.

Regards.

Antonio
 
Posts: 3
Joined: Sat Aug 24, 2002 11:00 pm

Re: OSReturnSem()

Postby aek » Fri Jan 03, 2003 7:11 am

Hi Antonio.

Hmmm ... OSENABLE_EVENT_TRYING has no effect in library builds -- see User Manual.

Please ensure that your salvocfg.h looks like this:

code:
#define OSUSE_LIBRARY      TRUE
#define OSLIBRARY_CONFIG OSA
#define OSLIBRARY_VARIANT OSA
#define OSTASKS 3 // or < 3
#define OSEVENTS 5 // or < 5
#define OSEVENT_FLAGS 1 // or 0
#define OSMESSAGE QUEUES 1 // or 0

and does not have any other entries.

Regards,

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

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


Return to Coding

Who is online

Users browsing this forum: No registered users and 1 guest

cron