2020-03-07 09:06 AM
We are using STM8 as to monitor and control STMF07 controller and Quectel M66 module if they are not sending pulses in predetermined time. But no physical control or method to reset STM8, So can we restart the program control of STM8 through software, if STM8 program control is lost or it is stuck somewhere. We want to restart STM8, if STM8 stops working. Can a controller monitor itself for hang state? Any help is appreciated.
2020-03-07 09:16 AM
Look for watchdog functionality - AN3265.
2020-03-07 10:03 AM
Thank you for your response, we are using watchdog in our code but we found in our testing device that STM8 was in hang state as M66 was working, STMF07 was hang sate but STM8 did not able to reset STMF0 after not receiving heartbeat from STMF0. And what we thought during Design, we need not reset STM8 through programming. So STM8 is on once Powered by 12 V and after 20-25 days STM8 is in hang state (Till now Our observation) , So is there any option that to kick alive STM8 on its own?? As we dont have any control on STM8 externally.
2020-03-07 10:13 AM
Going to be hard if you didn't facilitate via the reset pin.
Odd watchdog on either STM8 or STM32 doesn't work.
Perhaps a latch up.
You really need to root cause the failure and fix it if a software issue. Have device output enough internal state info so you're not entirely blind. Find ways to accelerate or cause failure more quickly so you aren't doing it for months.
2020-03-07 10:23 AM
> after 20-25 days STM8 is in hang state
Maybe 24,855 days? Probably a typical 2^31 ms type bug.
2020-03-07 10:28 AM
Can you pin point what is issue we are missing on ??
2020-03-07 10:29 AM
Yes we are working on it, but I thought I should also ask the community about this issue.
2020-03-07 10:45 AM
https://en.wikipedia.org/wiki/Integer_(computer_science)#Common_integral_data_types
If you count milliseconds, 24,855 days are the maximum value of a signed 32-bit integer. The most obvious example would be a wrong system tick counter implementation.
2020-03-07 11:01 AM
Make sure reset pins are not driven high by push-pull drivers.
Random lockups you can't attribute to anything will be pure guesses from the community. You need some actionable data to work from.
In your respin of the board consider external watchdog devices
2020-03-13 09:31 AM
If you don't use the watchdog correctly, it doesn't help much!
How exactly do you use the watchdog? I have a project with STM8 that run continuously for 10 months now, without restart, and no problems whatsoever.
You should also do some debugging, to know what actually happens, what the STM8 is doing in "hang"-mode.