Page 1 of 1

INTCON manipulation

PostPosted: Wed Jul 26, 2006 2:22 am
by marco
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



Re: INTCON manipulation

PostPosted: Wed Jul 26, 2006 11:24 am
by aek
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.

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


Re: INTCON manipulation

PostPosted: Fri Jul 28, 2006 11:28 am
by marco
Ok! I forgot to use statics !
Thank you

Marco