KV3x - watchdog issue

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

KV3x - watchdog issue

468 Views
chris_brown
NXP Employee
NXP Employee

Hi Chris,

Sorry to bother you, but I would like to ask you for help with watchdog behavior on KV3x devices.

Customer would like to use watchdog on KV3x and observed issue with integrating it into his application.

Conditions/Settings:

-          Watchdog clock source: LPO at 1 kHz. It is necessary to have independent clock for watchdog which must be different from core clock

-          Timeout value: 10 s (register value - 10000 at 1 kHz)

-          Window value: 0

-          Prescaler value: 0

-          Watchdog is refreshed periodically in the interrupt triggered by SysTick (IsrSysTick interrupt handler) every 1 ms

Problem:

a)       The watchdog is not refreshed with the period of 1 ms

b)      How to refresh watchdog during the startup code when it is difficult to keep period larger than 1 ms? Will the watchdog be updated correctly even if the update will happen several times in 1 ms period?

Notes/Questions:

1)      The issue is probably caused by watchdog input clock which is 1 kHz (1 ms)

2)      Is it possible to update watchdog anytime regardless of watchdog source clock which means more often than just once in 1 ms period? If so, how does this work?

3)      Since it is synchronous design the watchdog peripheral module is probably triggered with 1 kHz clock.

4)      How can we manage watchdog update in startup code? It is difficult to keep 1 ms time frame. It is changing with startup code complexity and it is application dependent

Thanks for your help

--

Best regards

Jaroslav

The information contained in this communication has been classified as:
[ ] General Business Information
[x] NXP Internal Use Only
[ ] NXP Confidential Proprietary

Jaroslav Lepka

Principal Engineer, Motor Control & Safety Team Leader

Security & Connectivity, Microcontrollers

NXP Semiconductors

1. maje 1009

75661 Rožnov pod Radhoštěm

Czech Republic

Phone: +420 571 665 132

Cell:     +420 604 291 188

Email: jaroslav.lepka@nxp.com

0 Kudos
1 Reply

336 Views
chris_brown
NXP Employee
NXP Employee

Hi Jaroslav,

Please find my comments inline below. 

[Begin Original Thread]

Conditions/Settings:

  • - Watchdog clock source: LPO at 1 kHz. It is necessary to have independent clock for watchdog which must be different from core clock
  • - Timeout value: 10 s (register value - 10000 at 1 kHz)
  • - Window value: 0
  • - Prescaler value: 0
  • - Watchdog is refreshed periodically in the interrupt triggered by SysTick (IsrSysTick interrupt handler) every 1 ms

Problem:

  1. a) The watchdog is not refreshed with the period of 1 ms
  2. b) How to refresh watchdog during the startup code when it is difficult to keep period larger than 1 ms? Will the watchdog be updated correctly even if the update will happen several times in 1 ms period?[CB] You can simply add the refresh sequence in the startup code since this is provided with the SDK.  Then I would enable the Systick and turn on the Systick interrupt.  In addition, make the Systick interrupt the highest priority interrupt.  No other interrupt should have a priority greater than or equal to the Systick interrupt to ensure that the watchdog is serviced correctly. 

Notes/Questions:

  1. 1) The issue is probably caused by watchdog input clock which is 1 kHz (1 ms)[CB] I would think the issue is most likely an improper refresh sequence.  Also remember that the two writes to the refresh register must be within 20 bus clock cycles so you probably want to disable interrupts globally while this update is occurring or simply make sure that no interrupt has a priority equal to or greater than the interrupt servicing the watchdog refresh register. 
  2. 2) Is it possible to update watchdog anytime regardless of watchdog source clock which means more often than just once in 1 ms period? If so, how does this work?[CB] It is not possible to update the watchdog at any time, there are some restrictions. But you shouldn’t be updating the watchdog, you should be refreshing it.  It IS possible to refresh the watchdog any time but you must write the correct sequences to the WDOG_REFRESH register. 
  3. 3) Since it is synchronous design the watchdog peripheral module is probably triggered with 1 kHz clock.
  4. 4) How can we manage watchdog update in startup code? It is difficult to keep 1 ms time frame. It is changing with startup code complexity and it is application dependent[CB] The watchdog can be serviced anytime.  I would modify the SystemInit function to start the Systick timer and turn on its interrupt. 
0 Kudos