This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
请问下TI的专家,我现在使用TM4C129ENCPDT 自带的RTC时钟, 初始化的时候,这个函数HibernateEnableExpClk(ui32SysClock);一执行就死在里面了。
源码如下,请问什么问题?
void init_RTC(void)
{
uint32_t g_ui32SysClock, ui32Len;
//
// Enable the hibernate module.
//
g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
HibernateEnableExpClk(g_ui32SysClock);
//
// If the wake was not due to the above sources, then it was a system
// reset.
//
HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);
//
// Enable RTC mode.
//
HibernateRTCEnable();
//
// Configure the hibernate module counter to 24-hour calendar mode.
//
HibernateCounterMode(HIBERNATE_COUNTER_24HR);
IntMasterEnable();
init_setTime();
}
这个函数展开
void
HibernateEnableExpClk(uint32_t ui32HibClk)
{
//
// Turn on the clock enable bit.
//
HWREG(HIB_CTL) |= HIB_CTL_CLK32EN;
//
// Wait for write complete following register load (above).
//
_HibernateWriteComplete();
}
死在这个函数里面,是有地方不对吗?
static void _HibernateWriteComplete(void)
{
//
// Spin until the write complete bit is set.
//
while(!(HWREG(HIB_CTL) & HIB_CTL_WRC))
{
}
}
Ding
函数使用没有问题。
能否确认一下,你说的程序死在某处是指在一直执行while循环还是跑飞进入fault error?