cancel
Showing results for 
Search instead for 
Did you mean: 

How to internally Restart a STM8 if we lost Program control ?

sanket47
Associate II

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.

9 REPLIES 9
Piranha
Chief II

Look for watchdog functionality - AN3265.

sanket47
Associate II

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.

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.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

> after 20-25 days STM8 is in hang state

Maybe 24,855 days? Probably a typical 2^31 ms type bug.

Can you pin point what is issue we are missing on ??

Yes we are working on it, but I thought I should also ask the community about this issue.

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.

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Cristian Gyorgy
Senior III

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.