Pumpkin, Inc.

Pumpkin User Forums

SALVO and bank problems

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

Re: SALVO and bank problems

Postby aek » Mon Nov 24, 2003 12:04 pm

Hi Luben.
quote:
Does that mean that if I have 3 different BinSem and one of them is signaled from ISR I should protect/unprotect all of other signalXYZ services?
Yes.
quote:
I mean - if I use once OSSignal XYZ in the ISR I should protect/unproitect all other OSSignal events from the same type in the main level?
Yes.
quote:
In my case I Signaled one BINSEM only from ISR and other only in the main line. So, I should protect the second BinSem, despite that it's not called in ISR, right?
Yes.
quote:
Which version of SALVO introduced at first protect/unprotect?
Somewhere in v2.x -- wherever a-, b- and f-variant libraries were introduced.

The issue at hand occurs because PICC is not a reentrant compiler -- therefore functions that appear in multiple callgraphs must be protected from being interrupted from the "same function" called at the ISR level. The PICC manual explains this. With Salvo applications, it's important to use OSProtect() and OSUnprotect() in order to ensure that the interrupt control is consistent across the application.

If you have any OSSignalXyz()'s in multiple callgraphs, you need to protect all of the mainline ones ... because they all use OSSignalEvent() (by default).

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

[This message has been edited by aek (edited November 24, 2003).]

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

Re: SALVO and bank problems

Postby luben » Tue Nov 25, 2003 1:31 am

Hello,

I think you should add in the manual more attention messages about this issue - wherever you mention about OSSignalXYZ OSFROM_ANYWHERE, you should add the note to protect/unprotect the main code.

And something other - if I use OSCOMBINE_EVENT_SERVICES TRUE, does that means that I have protect ALL main OSSignalXYZ, even fi I signal only one of the all services (if they are combined, maybe all services uses one common part) - for example, signalling in ISR Message will need to protect BinSem as well in main code?

And which services use common sections - OSSignalBinSem and OSSIgnalSem - do they use common code (I mean, if I signalled in ISR BinSem, shell I protect in main level except the BinSem , all SEM as well?)

In all cases the manual should be more detailed about this issue - I made many projects, without to be aware for the multientrance problem and many times I suffered from unreliable operations (actually this was multientrance problem).

But for sure the new 3.2 is working really, really great!

Best regards
Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: SALVO and bank problems

Postby aek » Thu Nov 27, 2003 1:04 am

Hi Luben.
quote:
And something other - if I use OSCOMBINE_EVENT_SERVICES TRUE, does that means that I have protect ALL main OSSignalXYZ, even fi I signal only one of the all services (if they are combined, maybe all services uses one common part) - for example, signalling in ISR Message will need to protect BinSem as well in main code?
Yes.
quote:
And which services use common sections - OSSignalBinSem and OSSIgnalSem - do they use common code (I mean, if I signalled in ISR BinSem, shell I protect in main level except the BinSem , all SEM as well?)
When OSCOMBINE_EVENT_SERVICES is TRUE (the default), all of the OSCreateXyz() use OSCreateEvent(), and all of the OSSignalXyz() use OSSignalEvent(), and so you need to protect all such services in a "group".
quote:
In all cases the manual should be more detailed about this issue - I made many projects, without to be aware for the multientrance problem and many times I suffered from unreliable operations (actually this was multientrance problem).
This was one of the reasons why we created the Salvo Compiler Reference Manuals for v3.2. I'm updating the callgraph sections of RM-PICC and RM-PICC18, and I'll review them (and V8C) and the User Manual so that this issue is clarified.

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

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

Previous

Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 1 guest

cron