Power Modes - reported watchdog reset despite Watchdog not enabled

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

Power Modes - reported watchdog reset despite Watchdog not enabled

Jump to solution
1,048 Views
beng_
Contributor III

How do I debug resets?

 

I'm using a Kinetis KL17 with FreeRTOS.

 

My code keeps resetting itself, according to the registers this is because of a watchdog reset, in the RCM registers SRS0  and SRS1 only the WDOG bit is set. However I've don't have the Watchdog enabled, so it can't be a watchdog that's causing this reset (COPT in SIM_COPC is set to 00). So any suggestions on how I can track down what's actually causing the reset?

My suspicion is that it's something to do with power modes. When I'm in the idle task I go into a low power mode dependant on what perpipharals are acticve. In summary:

  • If either I2C or UART2 are active go into VLPW
  • Otherwise go into VLPS

This code keeps reseting itself.

If I remove the UART2 case statement, this works fine, i.e.

  • If I2C is active go into VLPW
  • Otherwise go into VLPS

However if I always go into VLPW no matter what's enabled - then this causes resets.

Although it's importnat to note that none of these resets occour the moment sleep is exited or entered.

Tags (1)
1 Solution
858 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ben,

   Please check this register description in the KL17 reference manual:

pastedImage_1.png

pastedImage_2.png

You can find, after reset, COPT is not 0, it means, the watchdog is enabled automatically after reset, if you don't want to use it, you need to disable it in your code after power on.

I think in your code, you didn't disable the watchdog, then you also didn't feed the dog, so you will have the watchdog reset.

Wish it helps you!


Have a great day,
Kerry

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

View solution in original post

2 Replies
858 Views
beng_
Contributor III

Got it sorted now.

The solution was:

  • When I said the watchdog wasn't enabled I'd simply commented out the lines in my code that initialised the watchdog (and kicked/refreshed it). I didn't explicitly disable it.
  • However even with my code to refresh it - I was still getting watch dog resets.
  • Moving my watchdog initilisation code to much earlier in my code seems to stop the watchdog resets.

So there must be something that changes with the watchdog clocking when going into VLPW mode.

0 Kudos
859 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ben,

   Please check this register description in the KL17 reference manual:

pastedImage_1.png

pastedImage_2.png

You can find, after reset, COPT is not 0, it means, the watchdog is enabled automatically after reset, if you don't want to use it, you need to disable it in your code after power on.

I think in your code, you didn't disable the watchdog, then you also didn't feed the dog, so you will have the watchdog reset.

Wish it helps you!


Have a great day,
Kerry

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