Other Parts Discussed in Thread: C2000WARE
Customer reported an issue after they enabled the watchdog after the system initialization, and I duplicated the issue with the C2000WARE example.
The example is "epwm_ex13_up_aq" in C2000WARE F28002x Driverlib example folder. The only change was to add the watchdog enable code "SysCtl_enableWatchdog()" after all the initialization settings.
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"); }
Then, I ran with the emulation mode but it stopped and an error showed up with "No source available for "_system_post_cinit() at C:/Users\a0224194\workspace_v102\f28003x\epwm_ex13_up_aq\CPU1_RAM\epwm_ex13_up_aq.out:{3} 0x3f4751{4}" .
Since Device_init() disables the watchdog at the beginning, we need to understand how to enable the watchdog here. Could you please help check the solution for this? Thank you.