Question
Software reset (cold reboot)
Posted on November 15, 2013 at 18:36
Hi,
I'm looking for the proper (standard?) way for cold rebooting an STM8. I see that the first interrupt handler in the interrupt vector is what is called on startup. With my COSMIC compiler, the name of that function is_stext
. My thought was that the _stext function would initialize the stack pointer and various other registers, so calling it as a function from inside the program would result in a cold reboot, but testing it, apparently this is not true. In the very least, it seems like it doesn't reset the peripherals. I saw another post that suggested a hack where the watchdog was enabled and then the program waited until it expired and reset the microcontroller. I'm looking for a more appropriate solution though. Does the micro support any way for being reset by software? Shahbaz #reset