Watchdog interrupt to prevent blocks in PITimer interruption

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Watchdog interrupt to prevent blocks in PITimer interruption

ソリューションへジャンプ
1,407件の閲覧回数
inakialonsoerre
Contributor II

Hello,

I am trying to configure the watchdog of MPC5643L in order to prevent any block in my application, but I want to execute a part of code before doing a reset of the microcontroller.

For that, I enable the interruption of the watchdog:

      SWT.CR.R = 0x80000149;
         /* Master Access Control for Master 0: Enabled */
         /* Service Sequence : Fixed Service Sequence */
         /* SWT Reset on Invalid Access: Enabled */
         /* SWT Window Mode: Disabled */
         /* SWT Interrupt then Reset: Enabled */
         /* SWT Hard Lock: Disabled */
         /* SWT Soft Lock: Disabled */
         /* SWT Clock Source Selected: 16MHz IRC */
         /* SWT Stop Mode Control: Disabled */
         /* SWT Debug Mode Control: Disabled */
         /* Software Watchdog Timer: Enabled */

and I install the interruption of watchdog:
   INTC_InstallINTCInterruptHandler(&Watchdog_reset, 28, 15);

I have also installed the interruption of the PITimer:
   INTC_InstallINTCInterruptHandler(&PITimer_tick, 59, 5);

Watchdog's interruption has a higher priority than PITimer's priority.

To check this solution I write intentionally a "while(1);" in different parts of my code. It works properly in all of them, but no in the PITimer_tick function (the PITimer's interruption).

How can I assure that Watchdog interruption will be executed in case of any lock?


Thanks in advance,

Iñaki

1 解決策
1,297件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

most probably you do not allow interrupt nesting, in such case interrrupts are disabled during ISR execution and ISR cannot be affected by interrupt with higher priority. With interrupt nesting allowed the interrupt handler contains necessary prolog and epilog and interrupts are enabled during prolog allowing interrupt with higher priority to be called immediately.

So check your IVOR4 handler.

BR, Petr

元の投稿で解決策を見る

2 返答(返信)
1,298件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

most probably you do not allow interrupt nesting, in such case interrrupts are disabled during ISR execution and ISR cannot be affected by interrupt with higher priority. With interrupt nesting allowed the interrupt handler contains necessary prolog and epilog and interrupts are enabled during prolog allowing interrupt with higher priority to be called immediately.

So check your IVOR4 handler.

BR, Petr

1,297件の閲覧回数
inakialonsoerre
Contributor II

Thank you so much Petr.

I supposed that the problem was related with the disabling of ISR, but I didn't know how to enable them. Thanks to your help I was be able to solve my problem and now everything works properly.

Regards,

Iñaki

0 件の賞賛
返信