如何查看cc2640 复位原因,有没有寄存器可以查看
如何查看cc2640 复位原因,有没有寄存器可以查看
ju wang,
IAR或者CCS都可以看寄存器的。
至于看什么寄存器,得看你是从哪里的代码复位的。
数据手册上:
AON_SYSCTL:RESETCTL.RESET_SRC
driverlib里的也有
//*****************************************************************************
//
//! \brief OBSOLETE: Get the last known reset source of the system.
//!
//! Recommend using function \ref SysCtrlResetSourceGet() instead of this one.
//! This function returns reset source but does not cover if waking up from shutdown.
//! This function can be seen as a subset of function \ref SysCtrlResetSourceGet()
//! and will be removed in a future release.
//!
//! \return Returns one of the known reset values.
//! The possible reset sources are:
//! - \ref PWRCTRL_RST_POWER_ON
//! - \ref PWRCTRL_RST_PIN
//! - \ref PWRCTRL_RST_VDDS_BOD
//! - \ref PWRCTRL_RST_VDD_BOD
//! - \ref PWRCTRL_RST_VDDR_BOD
//! - \ref PWRCTRL_RST_CLK_LOSS
//! - \ref PWRCTRL_RST_SW_PIN
//! - \ref PWRCTRL_RST_WARM
//!
//! \sa \ref SysCtrlResetSourceGet()
//
//*****************************************************************************
__STATIC_INLINE uint32_t
PowerCtrlResetSourceGet(void)
{
//
// Get the reset source.
//
return (( HWREG( AON_SYSCTL_BASE + AON_SYSCTL_O_RESETCTL ) &
AON_SYSCTL_RESETCTL_RESET_SRC_M ) >>
AON_SYSCTL_RESETCTL_RESET_SRC_S ) ;
}