How to use watchdog COP

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

How to use watchdog COP

1,803 Views
albert_zhou
Contributor III

I tried to use COP watchdog but it does not work. somebody can tell me why? I used UART command to get it in a while loop, the system get into a hanging state -no pulse output.

Here is my code:

void ResetWatchDog(void)
{
SIM->SRVCOP =0x00000055U;
SIM->SRVCOP =0x000000AAU;
}

int main(void)
{

SIM->COPC =0x0000003CU;  //enable COP watchdog set to 1.024 second, 1KHz as clock source

...

...

....

while(1)

{

   pulse(toggle);

   ResetWatchDog();

 .....

}

}

I not know where to get the COP setup correctly. 

Albert

0 Kudos
4 Replies

1,615 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Albert,

Could you please tell me which MCU are you using?

Regards,

Victor.

0 Kudos

1,615 Views
albert_zhou
Contributor III

Hi Victor,

I am using MKL27Z64VFM4 mcu. I find problem for the watchdog enable problem. I put a line above DISABLE_WDOG in file system_MKL27Z64xxx4.h as below. Thanks.

#define DISABLE_WDOG 0 //added by Albert Zhou 11-19-2018 for use watchdog timer

#ifndef DISABLE_WDOG

#define DISABLE_WDOG 1

#endif

Albert Zhou

Sr. Electronics Engineer

Sensorex

p:

+1 714-230-2768

a:

11751 Markon Drive, Garden Grove, CA 92841

w:

www.sensorex.com<http://www.sensorex.com/>; e: albert.zhou@sensorex.com<mailto:albert.zhou@sensorex.com>

<https://www.facebook.com/Sensorex> <https://twitter.com/SensorexInc> <https://www.linkedin.com/company-beta/1768298/>

0 Kudos

1,615 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Albert,

I recommend you to download the SDK for the FRDM-KL27Z. In this example you will find a example project for the COP watchdog. You can use this example as a guide to see what you are missing in your project.  

Link to download the SDK.

Hope it helps!

Victor.

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,615 Views
albert_zhou
Contributor III

Hi Victor,

Yes, I will do. I started with SDK FRDM-KL27Z.

I am going to utilize the ROM bootloader. I need to setup the bootloader preset for LPUART0. So I just need to interface with LPUART0 (pin11, pin 12 of MKL27Z64VFM4 ). Is that right?

The load file must be binary (.bin) only?

I have done something like loader before. The file is .hex, I can load it one line by online because there is line check for hex file and end file indication.

How to use the .bin file for bootloader handling since I could not read the file?

What is the size of one pack? I have a firmware file of 50K bytes.

Best regards,

Albert Zhou

Sr. Electronics Engineer

Sensorex

p:

+1 714-230-2768

a:

11751 Markon Drive, Garden Grove, CA 92841

w:

www.sensorex.com<http://www.sensorex.com/>; e: albert.zhou@sensorex.com<mailto:albert.zhou@sensorex.com>

<https://www.facebook.com/Sensorex> <https://twitter.com/SensorexInc> <https://www.linkedin.com/company-beta/1768298/>

0 Kudos