ST意法半导体
直播中

吴民峰

7年用户 179经验值
私信 关注
[问答]

微软是否支持通过软件重置的任何方式?

嗨,


我正在寻找适合(标准?)冷启动STM8的方法。我看到中断向量中的第一个中断处理程序是在启动时调用的。使用我的COSMIC编译器,该函数的名称是_stext


我的想法是_stext函数会初始化堆栈指针和各种其他寄存器,所以从程序内部调用它作为函数会导致冷启动,但测试它,显然这不是真的。至少,它似乎没有重置外围设备。

我看到另一个帖子暗示了看门狗启用的黑客,然后程序等到它过期并重置微控制器。我正在寻找一个更合适的解决方案。微软是否支持通过软件重置的任何方式?

沙赫巴兹
#重启

以上来自于谷歌翻译


以下为原文




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

回帖(2)

王明

2018-12-12 16:41:47
沙赫巴兹,
 
 这条指令:
 
 WWDG_CR = 0x80;
 
 重置STM8微控制器。
 它激活Window Watchdog,它会重置所有因为它的第七位为空。
 有关详细信息,请参见RM0016的第127页(STM8S和STM8AF单片机系列)。
 
 问候,
 
 EtaPhi

以上来自于谷歌翻译


以下为原文





Shahbaz,

this instruction:

WWDG_CR = 0x80;

resets a STM8 microcontroller.
It activates the Window Watchdog, which resets all because its seventh bit is null.
See page 127 of  RM0016 (STM8S and STM8AF microcontroller family) for more details.

Regards,

EtaPhi
举报

吴民峰

2018-12-12 17:01:07
谢谢EtaPhi,这就是诀窍!

以上来自于谷歌翻译


以下为原文





Thanks EtaPhi, that did the trick!
举报

更多回帖

发帖
×
20
完善资料,
赚取积分