嗨,
我正在寻找适合(标准?)冷启动STM8的方法。我看到中断向量中的第一个中断处理程序是在启动时调用的。使用我的COSMIC编译器,该函数的名称是_stext
。
我的想法是_stext函数会初始化堆栈指针和各种其他寄存器,所以从程序内部调用它作为函数会导致冷启动,但测试它,显然这不是真的。至少,它似乎没有重置外围设备。
我看到另一个帖子暗示了看门狗启用的黑客,然后程序等到它过期并重置微控制器。我正在寻找一个更合适的解决方案。微软是否支持通过软件重置的任何方式?
沙赫巴兹
#重启
以上来自于谷歌翻译
以下为原文
Hi,
I'm looking for the proper (standard?) way for cold reboo
ting 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