Page 1 of 3

messages from ISR

PostPosted: Mon Dec 10, 2007 1:03 am
by aek
Is this a Salvo library build?

If so, you have to use an a-variant library ... see http://www.pumpkininc.com/content/doc/manual/rm-kc51.pdf .

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


Re: messages from ISR

PostPosted: Mon Dec 10, 2007 1:05 am
by aek
And if it's a source-code build you'll need to look at the OSCALL_OSXYZ config options.

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


Re: messages from ISR

PostPosted: Mon Dec 10, 2007 1:07 am
by PresbyopticProgrammer
library build

sxaa library with salvocfg
OSX globals
OSA config
OSA variants


Re: messages from ISR

PostPosted: Mon Dec 10, 2007 1:30 am
by aek
Well, that certainly looks right.

Making stuff static inside a task is always the "safest bet" as it removes any call stack / stack frame that the task uses ... but it should not be required.

Does changing optimizations make any difference?

In the meantime, you can use the method outlined in this paper to "pass up" signaling in ISRs and thus avoid calling OSSignalXXyz() at all from within an ISR: http://www.pumpkininc.com/content/doc/press/pumpkin_supsi2005.pdf

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


Re: messages from ISR

PostPosted: Mon Dec 10, 2007 12:09 pm
by PresbyopticProgrammer
I can not seem to signal a message from within an ISR. I can signal messages from task to task and I can signal a binary semaphore from an ISR.

So for instance I can take the same message I was going to signal from an ISR and have a task that sits around and looks for the ISR to signal a binary semaphore instead then the task can signal the message.

Am I doing something wrong or is this something I should expect?


Re: messages from ISR

PostPosted: Mon Dec 10, 2007 12:12 pm
by PresbyopticProgrammer
btw it is not that the message gets corrupted or anything, buffer contents look fine, the signalmsg() in the isr returns no error and continues on, but the task waiting on the message just waits forever.

even I delay and loop and use readmsg() the pointer never shows up.


Re: messages from ISR

PostPosted: Mon Dec 10, 2007 12:17 pm
by aek
There's no difference between signaling from an ISR and signaling from mainline code.

Have you checked the return code from OSSignalMsg()?

And if you're using PICC or PICC-18, are you protecting as per the Salvo Compiler Reference Manual?

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


Re: messages from ISR

PostPosted: Mon Dec 10, 2007 12:19 pm
by aek
Ooops -- sorry didn't see you were checking the return code.

Target? Compiler? Salvo version?

But like I said, there's no diference, so the problem is probably either a typo or that the waiting task is prevented from running due to priority.

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


Re: messages from ISR

PostPosted: Mon Dec 10, 2007 12:20 pm
by aek
I note that in your posts you mention messages and binSems -- make sure you're waiting on the same type of event you're signaling.

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


Re: messages from ISR

PostPosted: Mon Dec 10, 2007 12:50 pm
by PresbyopticProgrammer
the return code inside the ISR for signalmsg() indicated no error.

oddly, I did notice the exact same problem within a _task_ when I used a global buffer vice a local one for the message so I tried to change the isr to a local static buffer but no difference.

maybe issue with local static or global, only works with local non-static message buffers?

haven't played around with this enough yet to know for sure.

certain waiting on same thing I am signalling, been over that, and the ECB names, with a fine tooth comb.

target is SiLabs C8051F340
compiler is Keil C51 7.50