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.
已解决! 转到解答。
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.
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!
-----------------------------------------------------------------------------------------------------------------------
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.