2013-03-22 03:27 AM
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 #stm322013-03-22 03:40 AM
According to Tab.61 in RM0038, the max. watchdog timeout is 28 seconds.
Is this less than you need? JW2013-03-22 04:00 AM
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.
2013-03-22 07:59 PM
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
2013-03-23 04:02 AM
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.2013-04-01 03:53 AM
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?