COP in KL16

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

COP in KL16

690 Views
amitmehta
Contributor III

I tried configuring COP for KL16 using SDK example but COP was not able to reset system.

One thing that i noticed is SDK drivers files are for MKL26Z4 not MKL16Z4. So does this make any difference.

i also tried setting Clock source to bus clock from Low Power Clock Source.

Labels (1)
4 Replies

481 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Mehta,

   Please check your COPC register, do you disable the watchdog in your code?

pastedImage_1.png

All of the bits in COPC register can be written only once after a reset.

So, if you disable the watchdog after reset, then it won't work.

Please check your COPC register at first, if you disable the watchdog, please comment:

  SIM->COPC = (uint32_t)0x00u;

The watchdog in KL16 and KL26 is the same.

I think it still the code's problem.


Have a great day,
Kerry

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

481 Views
amitmehta
Contributor III

Hi Kerry,

Regarding last update it was issue due to debugger, which was disabling watchdog while programming, so to test i have to program and then reset controller.

Thanks for help.

0 Kudos

481 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Amit,

   Thanks for your updated information.

   As I know, the JLINK won't disable the watchdog, if you want to debug the watchdog, you also can use JLINK.

Wish it helps you!


Have a great day,
Kerry

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

481 Views
amitmehta
Contributor III

Hi Kerry,

Yeah i have set preprocessor  DISABLE_WDOG=0, and have check in debugging mode code is not going inside that condition.

I'll once more time try, earlier i have tried using demo code and even tried setting SIM->COPC = (uint32_t)0x06u;//COPCLKS 

in SystemInit before

#if (DISABLE_WDOG)
/* SIM_COPC: COPT=0,COPCLKS=0,COPW=0 */
SIM->COPC = (uint32_t)0x00u;
#endif /* (DISABLE_WDOG) */

condition and even in main.c

But if put resisters in to watch, not values were writen in to SIM's COPC resister.

I'll once more time try and check if any other place i can set these bits

0 Kudos