Processor Expert FreeScaleCAN - Any ISR problems?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Processor Expert FreeScaleCAN - Any ISR problems?

Jump to solution
1,041 Views
AndersJ
Contributor IV

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

Labels (1)
Tags (1)
0 Kudos
1 Solution
428 Views
AndersJ
Contributor IV

Resolved.

PE Critical section macros cannot be nested.

View solution in original post

0 Kudos
1 Reply
429 Views
AndersJ
Contributor IV

Resolved.

PE Critical section macros cannot be nested.

0 Kudos