主题中讨论的其他器件:C2000WARE、 CODECOMPOSER
我编写了一个自定义引导加载程序、在闪存中存储应用程序。
当我运行引导加载程序时、它的初始化成功完成、然后它会检测驻留在闪存中 的应用程序并在特定地址启动应用程序。
通过使用调试器和"Assembly Step Into"/"Assembly Step Over"(因为我没有加载应用程序的符号、只有引导加载器被加载到调试器中)、我发现应用程序在 InitSysPll ()内挂起、 特别是在等待 SYSPLL 锁定计数器(SYSCTL.c:363)时):
//
// Lock the PLL five times. This helps ensure a successful start.
// Five is the minimum recommended number. The user can increase
// this number according to allotted system initialization time.
//
for(i = 0U; i < 5U; i++)
{
//
// Turn off PLL
//
HWREGH(CLKCFG_BASE + SYSCTL_O_SYSPLLCTL1) &=
~SYSCTL_SYSPLLCTL1_PLLEN;
asm(" RPT #60 || NOP");
//
// Write multiplier, which automatically turns on the PLL
//
HWREGH(CLKCFG_BASE + SYSCTL_O_SYSPLLMULT) = pllMult;
//
// Wait for the SYSPLL lock counter
//
while((HWREGH(CLKCFG_BASE + SYSCTL_O_SYSPLLSTS) &
SYSCTL_SYSPLLSTS_LOCKS) == 0U)
{
//
// Consider to servicing the watchdog using
// SysCtl_serviceWatchdog()
//
}
}
引导加载程序和应用程序都调用 F2837xD_SYSCTRL.c 的 InitSysCtrl ()。
如果我调试应用程序(没有引导加载程序),它的初始化工作正常,它不会在 InitSysCtrl()中挂起。
在启动应用程序之前、我是否必须在引导加载程序中执行一些操作来解锁 SYSPLL?
谢谢!
Diane

