Watchdog feed best practices

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

Watchdog feed best practices

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

Hello everybody.

The typical sequence for to feed the watchdog onto one LPC1768 is the follow:

LPC_WDT->WDFEED = 0xAA; LPC_WDT->WDFEED = 0x55;

My question: is It recommended to wrap the upper two lines inside a

taskENTER_CRITICAL() 
taskEXIT_CRITICAL()

section, when you enable the watchdog into a FreeRTOS environment?

I got very rare watchdog events and I start to believe that they could be caused because one task switch happens between the two rows above.

Thanks in advance.

Diego.

ラベル(1)
タグ(1)
0 件の賞賛
1 解決策
849件の閲覧回数
diegobarile
Contributor II

Hello.

After few days of extensive tests I can confirm (on my system) that taskENTER_CRITICAL / taskEXIT_CRITICAL are not enough.
I must wrapping the watchdog trigger code with __disable_irq() /__enable_irq() macros.
Doing so It seems to woks reliable.

My system has several interrupts, mostly comes from timers and UART.


Thank you so much for the suggestions.

Best regards.

Diego.

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
849件の閲覧回数
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Diego Barile,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.

LPC_WDT->WDFEED = 0xAA; LPC_WDT->WDFEED = 0x55;

I agree with you, it'd better wrap the upper two lines inside ataskENTER_CRITICAL()
taskEXIT_CRITICAL()
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

850件の閲覧回数
diegobarile
Contributor II

Hello.

After few days of extensive tests I can confirm (on my system) that taskENTER_CRITICAL / taskEXIT_CRITICAL are not enough.
I must wrapping the watchdog trigger code with __disable_irq() /__enable_irq() macros.
Doing so It seems to woks reliable.

My system has several interrupts, mostly comes from timers and UART.


Thank you so much for the suggestions.

Best regards.

Diego.

0 件の賞賛