Watchdog OpenCPU

Hello,
Is there any way to implement an internal watchdog, only in sotfware? Without using any external

Hi there,

Please check the firmware version by using command “at+qgmr?” and then send it to us.

Br,
Zach

Hello,You can implement software watchdog with code

Hi Zach, on my MC60 the AT+QGMR command returns “+CME ERROR: 100”.

And for the ATI command
Quectel_Ltd
Quectel_MC60
Revision: MC60CAR01A13

Hi Vic, and can you please help me understand how to do it, do you have an example?

I need 3 different tasks and each one with its watchdog

Quectel_Ltd
Quectel_MC60
Revision: MC60CAR01A13

Dear luisfelipe

The OPEN_DOG routine is included in the MC60 SDK package.The name is: “example_watchdog”, which you can refer to.Additional watchdog chips can also be used to control the module’s “SET” pins for the watchdog function.

Hi Grey,
The example you are referring to uses an external watchdog and I don’t know how to adapt it to a software watchdog

Dear luisfelipe

Are you in OPEN mode or standard mode?

Open mode using the module’s own software watchdog directly refer to the “example_watchdog. C” file to write it.

External watchdog needs to see the specific model you use, refer to the chip specification book to control.

@Zach.zhang-Q @vic.xie Can you please help me?

@Grey.Tu-Q This example uses an external watchdog. I only want one for sotfware

     // Initialize external watchdog:
    // specify the GPIO pin (PINNAME_NETLIGHT) and the overflow time is 600ms.
    ret = Ql_WTD_Init(0, PINNAME_NETLIGHT, 600);
    if (0 == ret) {
        APP_DEBUG("\r\n<--OpenCPU: watchdog init OK!-->\r\n");         
    }

I understand, well I think I understand, the functioning of the
Ql_Reset
Ql_WTD_Start
Ql_WTD_Feed

What I don’t know, is how to implement the watchdog by software.

When Ql_WTD_Feed does not feed the watchdog, Ql_Reset is called to restart the module.

Dear luisfelipe

Not sure what you mean by external monitors?The code you see here is the watchdog in the module. If you don’t feed the watchdog, the watchdog will restart the module.

I will try to explain myself better

I need to implement an internal watchdog, no external component.

If some part of my code gets frozen or doesn’t work as expected and doesn’t feed the watchdog, the function is called to reset the MC60 module. Maybe Ql_Reset.

The example shows how to use an external watchdog, and I would like to know how to make Ql_WTD_Start and Ql_WTD_Feed work in this software watchdog implementation.

Do I make myself clear?

Dear luisfelipe

I don’t know if I misunderstood you.

After “wtdid = Ql_WTD_Start(3000)”, if “Ql_WTD_Feed(*wtdid)” is not called for 3000ms, the module will be restarted. This is the work done by the bottom layer.It is not a call to “Ql_Reset” to reset the module.If the dog is not fed within the specified period of time, it will restart, which is the function of the guard dog.

Dear Grey,

I have no external watchdog connected to my MC60, no hardware connected to the GPIO. So the Ql_WTD functions don’t work and it doesn’t restart my module when it times out.

My question is if it is possible to implement a watchdog only by software.

Dear luisfelipe

I think you are mistaken. What I introduced to you is the internal watchdog function of the module. No additional hardware is required.Please read the documentation in the SDK package carefully.

Dear Grey,
I finally got my watchdog working. It was just a wrong parameter in the Ql_WTD_Init call. The resetMode parameter. The MC60 documentation is not clear enough, with the help of the BC66 documentation I discovered the error.

MC60

Function
	Ql_WTD_Init
Description:
	This function starts a base H/W timer, which is responsible for feed the external watchdog. And specify the I/O pin and feeding interval. Besides, this function may specify the reset mode (H/W reset or S/W reset) when the watchdog overflows. H/W reset means the external watchdog chip resets the module.
Parameters:
	resetMode:
		[in] Must be zero, H/W reset.
	wtdPin:
		[in]I/O pin that connects to the WDI pin of external watchdog chip.
	interval: 
		[in]the interval for feeding external watchdog.the min value of interval is 200. Unit in ms.

BC66

Function
	Ql_WTD_Init
Description:
	This function starts a base H/W timer, which is responsible for feed the external watchdog. And specify the I/O pin and feeding interval.  Besides, this function may specify the reset mode (H/W reset or S/W reset) when the watchdog overflows. H/W reset means the external watchdog chip resets the module.
Parameters:
	resetMode:
		[in]0,H/W reset  reset,the customer need add a external watchdog chip. 1,S/W reset.
	wtdPin: 
		[in]I/O pin that connects to the WDI pin of external watchdog chip. software reset ignores.
	interval: 
		[in]the interval for feeding external watchdog.the min value of interval is 200. Unit in ms.

Thanks for your support

Dear luisfelipe

Thank you for your feedback. Thank you.

Dear luisfelipe

When you use MC60, do you pass 1 in the resetMode argument?

Hi Grey,
Sorry, I didn’t realize you asked me a question.

I use Ql_Reset(1)