主题中讨论的其他器件:C2000WARE
客户在系统初始化后启用看门狗后报告了一个问题、我在 C2000WARE 示例中重复了该问题。
示例是 C2000WARE F28002x Driverlib 示例文件夹中的"ePWM_ex13_up_AQ"。 唯一的更改是在 所有初始化设置之后添加看门狗启用代码"sysctl_enableWatchdog()。
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();
//
// Disable pin locks and enable internal pull-ups.
//
Device_initGPIO();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// For this case just init GPIO pins for ePWM1, ePWM2, ePWM3
//
Board_init();
//
// Interrupts that are used in this example are re-mapped to
// ISR functions found within this file.
//
Interrupt_register(INT_EPWM1, &epwm1ISR);
Interrupt_register(INT_EPWM2, &epwm2ISR);
Interrupt_register(INT_EPWM3, &epwm3ISR);
//
// Disable sync(Freeze clock to PWM as well)
//
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
initEPWM1();
initEPWM2();
initEPWM3();
//
// Enable sync and clock to PWM
//
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
//
// Enable interrupts required for this example
//
Interrupt_enable(INT_EPWM1);
Interrupt_enable(INT_EPWM2);
Interrupt_enable(INT_EPWM3);
//
// Enable global Interrupts and higher priority real-time debug events:
//
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
SysCtl_enableWatchdog();
//
// IDLE loop. Just sit and loop forever (optional):
//
for(;;)
{
asm (" NOP");
}
然后、我以仿真模式运行、但它停止了、并且出现错误、显示"No source available for "_system_post_cinit () at C:/users\a0224194\workspace_v102\f28003x\ePWM_ex13_up_AQ\CPU1_RAM\ePWM_ex13_up_AG.out:{3}0x34"。
由于 Device_init()在开始时禁用看门狗,我们需要了解如何在此处启用看门狗。 您能帮您检查解决方案吗? 谢谢你。