TI中文支持网
TI专业的中文技术问题搜集分享网站

CC2640R2F 可能判断启动方式吗

CC2640R2F是否可以判断是上电启动或是硬件复位启动或软件复位启动?

Viki Shi:

判断复位原因可用如下方式:

1、数据手册:

AON_SYSCTL:RESETCTL.RESET_SRC

2、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 ) ;
}

WK C:

回复 Viki Shi:

HAL_SYSTEM_RESET();属于什么复位方式

YiKai Chen:

回复 WK C:

我記得是PWRCTRL_RST_WARM,你試試就可以確認

WK C:

回复 YiKai Chen:

PowerCtrlResetSourceGet()这个函数返回的是PWRCTRL_RST_POWER_ON, SysCtrlResetSourceGet()这个才是返回PWRCTRL_RST_WARM

YiKai Chen:

回复 WK C:

感謝反饋

赞(0)
未经允许不得转载:TI中文支持网 » CC2640R2F 可能判断启动方式吗
分享到: 更多 (0)