AnsweredAssumed Answered

Processor Expert FreeScaleCAN - Any ISR problems?

Question asked by Anders Johansson on Dec 10, 2010
Latest reply on Dec 13, 2010 by Anders Johansson

CW 4,7 PE 2.99 and FreeScaleCAN bean, for HCS12XEP100.

 

I have problems with the bean and the SendFrame procedure.

 

If SendFrame is called while interrupts are disabled,

and immediately reenabled then it seems something goes wrong,

as interrupts remain disabled.

 

Example:

EnterCriticalSection(); // Borrowed literally from PE

SendFrame(....);

ExitCriticalSection(); // Borrowed literally from PE

 

Without the CriticlSection code all works.

 

Perhaps my explanation is vague or not correct,

but this is more or less how I interpret the situation.

 

Background: The Tx procedure must be called from ISR and non ISR code.

To prevent reentrancy problems I need to disable interrupts while the it runs and then

restore the interrupt mask to whatever it was before it was disabled on entry.

This is where it all crashes, and I have isolated the problem to SendFrame.

 

Are there any related interrupt issues with SendFrame?

Alla ideas welcome.

 

Thanks,

Anders J

Outcomes