Processor Expert FreeScaleCAN - Any ISR problems?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Processor Expert FreeScaleCAN - Any ISR problems?

跳至解决方案
1,565 次查看
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

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
952 次查看
AndersJ
Contributor IV

Resolved.

PE Critical section macros cannot be nested.

在原帖中查看解决方案

0 项奖励
回复
1 回复
953 次查看
AndersJ
Contributor IV

Resolved.

PE Critical section macros cannot be nested.

0 项奖励
回复