cancel
Showing results for 
Search instead for 
Did you mean: 

Watchdog timer problem

adithya2
Associate II
Posted on March 22, 2013 at 11:27

Hi, I am using the STM32L151VB in a custom board. The problem I have is with the watchdog timer. The maximum time out is too less for me to do anything that I intend to. Right now I am using the TIM4 timer for a longer timeout duration. When I encounter the TIM4 interrupt I reset my program. Is this safe? What are the possible ways of this workaround failing? 

#stm32-stm32l151 #stm32
5 REPLIES 5
Posted on March 22, 2013 at 11:40

According to Tab.61 in RM0038, the max. watchdog timeout is 28 seconds.

Is this less than you need?

JW
frankmeyer9
Associate II
Posted on March 22, 2013 at 12:00

Is this safe?

 

No.

Watchdog timers usually have the particular feature of being non-stoppable once started.

This is a feature, not a bug.

A normal timer unit is not save. A code running astray could disable the interrupt or flood the stack, and render your effort worthless.

adithya2
Associate II
Posted on March 23, 2013 at 03:59

Yes its much lesser than what I need. I need something like 2 minutes, since I am performing an FTP upload using a GSM modem on the USART

Posted on March 23, 2013 at 12:02

Seems like you should be using a different timeout methodology, resetting a modem/system would be a last resort if no AT commands, or progress in the upload/download were occurring.

There are other areas where the network/carrier side commands might take 150 seconds (2:30) to get a responses from the modem, but this isn't an issue with the CPU crashing.

The watchdog is more about your code on the CPU dying and not completing tasks, this can be done by kicking the time if all tasks flag themselves as active/functioning.

Doing standard timeout behaviour for peripherals can be achieved with software timers/counters running off SysTick or TIMx units, and should be part of any coding excercise, not just having end less while() loops, and resetting the system if the world isn't perfect.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
adithya2
Associate II
Posted on April 01, 2013 at 12:53

I am using a timer to timeout if the modem becomes unresponsive. But how do I reload the watchdog in order to avoid a reset of the system. Isnt it unsafe to do so inside systick or some other interrupt?