Pumpkin, Inc.

Pumpkin User Forums

messages from ISR

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

messages from ISR

Postby aek » Mon Dec 10, 2007 1:03 am

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 .

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

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

Re: messages from ISR

Postby aek » Mon Dec 10, 2007 1:05 am

And if it's a source-code build you'll need to look at the OSCALL_OSXYZ config options.

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

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

Re: messages from ISR

Postby PresbyopticProgrammer » Mon Dec 10, 2007 1:07 am

library build

sxaa library with salvocfg
OSX globals
OSA config
OSA variants

PresbyopticProgrammer
 
Posts: 14
Joined: Wed Nov 21, 2007 12:00 am
Location: Fort Valley, VA, USA

Re: messages from ISR

Postby aek » Mon Dec 10, 2007 1:30 am

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

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

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

Re: messages from ISR

Postby PresbyopticProgrammer » Mon Dec 10, 2007 12:09 pm

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?

PresbyopticProgrammer
 
Posts: 14
Joined: Wed Nov 21, 2007 12:00 am
Location: Fort Valley, VA, USA

Re: messages from ISR

Postby PresbyopticProgrammer » Mon Dec 10, 2007 12:12 pm

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.

PresbyopticProgrammer
 
Posts: 14
Joined: Wed Nov 21, 2007 12:00 am
Location: Fort Valley, VA, USA

Re: messages from ISR

Postby aek » Mon Dec 10, 2007 12:17 pm

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?

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

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

Re: messages from ISR

Postby aek » Mon Dec 10, 2007 12:19 pm

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.

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

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

Re: messages from ISR

Postby aek » Mon Dec 10, 2007 12:20 pm

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.

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

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

Re: messages from ISR

Postby PresbyopticProgrammer » Mon Dec 10, 2007 12:50 pm

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

PresbyopticProgrammer
 
Posts: 14
Joined: Wed Nov 21, 2007 12:00 am
Location: Fort Valley, VA, USA

Next

Return to Coding

Who is online

Users browsing this forum: No registered users and 1 guest

cron