打印
[其他ST产品]

关于STR715的软件复位

[复制链接]
2383|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
greatbin|  楼主 | 2007-7-9 15:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
看手册发现软件复位涉及3个比特位,他们的顺序是这样吗?
      RCCU->CCR |= 0x08;//SRESEN=1
      RCCU->CCR |= 0x0800;//EN_HALT=1
      RCCU->SMR |= 2;
沙发
grant_jx| | 2007-7-9 17:53 | 只看该作者

STR71x Reference Manual Page27

"A Software reset, forced by setting the HALT bit in the RCCU_SMR register (when enabled with SRESEN bit and the ENHALT bit in the RCCU_CCR register)"

可以通过RCCU.h文件定义的:
/*******************************************************************************
* Function Name  : RCCU_ResetSources
* Description    : Return the source of the system reset
* Input          : None
* Return         : The reset source
*******************************************************************************/
inline RCCU_ResetSources RCCU_ResetSource ()
{

  switch(RCCU->CFR & RCCU_ResetSources_Mask)
  {
    case 0x00000020: return RCCU_SoftwareReset;
    case 0x00000040: return RCCU_WDGReset;
    case 0x00000080: return RCCU_RTCAlarmReset;
    case 0x00000200: return RCCU_LVDReset;
    case 0x00000400: return RCCU_WKPReset;
    default : return RCCU_ExternalReset;
  }
}


检查产生的复位源

使用特权

评论回复
板凳
greatbin|  楼主 | 2007-7-11 21:05 | 只看该作者

谢谢楼上,不过我的问题是如何实现软复位,而不是定位复

使用特权

评论回复
地板
starm| | 2007-7-11 21:53 | 只看该作者

void Reset_Device(void)

void Reset_Device(void)
{
  RCCU->CCR |= 0x00000808;
  RCCU->SMR |= 0x00000002;
  while (1);
}

使用特权

评论回复
5
greatbin|  楼主 | 2007-7-14 08:15 | 只看该作者

谢谢starm

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

38

主题

196

帖子

0

粉丝