Pumpkin, Inc.

Pumpkin User Forums

INTCON manipulation

If you think you've found a bug or other mistake in your Salvo distribution, post it here.

INTCON manipulation

Postby marco » Wed Jul 26, 2006 2:22 am

Hi Salvo team,
I am a MCC18 v3.02 user and I use Salvo Library version.
The project use slc18sft.lib.
Everything goes well but today after adding some function the program crashes for WDT.
After debug I can tell that during a call to
OS_WaitMsg some bits of the INTCON register are setted (but isr do not manage it!) so program loop forever in isr.
Stepping in code after OS_WaitMsg I see that INTCON is saved and restored several times using FSR1 but the last time restore before return from OSSched the FSR1 point do a different position (-1). I can tell that RAM used is where the stack is placed by the linker in my prj (0x400). It is possible this is a linker/complier problem but having access only to assembly it is difficult to say. Actually I made a workaround clearing bits in INTCON during ISR but I cannot release this fw if the problem is really solved.
Thank you

Marco


marco
 
Posts: 9
Joined: Mon Mar 27, 2006 12:00 am
Location: Italia

Re: INTCON manipulation

Postby aek » Wed Jul 26, 2006 11:24 am

Hi Marco.

I would guess that this is either:

1) Using an auto variable in a task (with MPLAB-C18, you must not use any auto variables with the current Salvo context switcher for MPLAB-C18 -- use only static local variables).

2) (Less likely) An incompatible optimization. Procedural Abstraction (PA) is the only optimization we know if that is incompatible with Salvo. But perhaps there is a new one we don;t know about.

Note that the restriction on optimization applies only to code modules (*.c -> *.obj) that contain Salvo tasks. Any other code (e.g. user functions) can have all the optimizations applied to them and still work correctly in a Salvo application.

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

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

Re: INTCON manipulation

Postby marco » Fri Jul 28, 2006 11:28 am

Ok! I forgot to use statics !
Thank you

Marco

marco
 
Posts: 9
Joined: Mon Mar 27, 2006 12:00 am
Location: Italia


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests

cron