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.

TMS320F280025: error "No source available for "_system_post_cinit()" after enabling watchdog

Part Number: TMS320F280025
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.

  • Aki,

    Please see the watchdog service example to understand the correct steps to enable the watchdog. I'll have this post rerouted to the C2000Ware folks to provide more support  regarding the error message.

    Regards,

    Ozino

  • Hi Ozino,

    I found the same error reported if I set the watchdog to generate a reset signal in the "watchdog_ex1_service" example, and also commented SysCtl_serviceWatchdog in the for loop.

    void main(void)
    {
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
        //
        // 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();
    
        //
        // Re-map watchdog wake interrupt signal to call the ISR function in this
        // example
        //
        Interrupt_register(INT_WAKE, &wakeupISR);
    
        //
        // Clear the counters
        //
        wakeCount = 0;
        loopCount = 0;
    
        //
        // Set the watchdog to generate an interrupt signal or a reset signal
        //
      //  SysCtl_setWatchdogMode(SYSCTL_WD_MODE_INTERRUPT);
        SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET);
    
        //
        // Enable the watchdog wake interrupt signal
        //
        Interrupt_enable(INT_WAKE);
    
        //
        // Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        //
        // Reset the watchdog counter
        //
        SysCtl_serviceWatchdog();
    
        //
        // Enable the watchdog
        //
        SysCtl_enableWatchdog();
    
        //
        // Loop Forever
        //
        for(;;)
        {
            loopCount++;
    
            //
            // Uncomment SysCtl_serviceWatchdog to just loop here.
            // Comment SysCtl_serviceWatchdog to have watchdog timeout and trigger
            // an interrupt signal to execute the wakeupISR
            //
          //   SysCtl_serviceWatchdog();
        }
    }

  • Aki,

    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}" .

    Look like reset is happening and after reset, CPU is halting inside BOOTROM because emulation boot is not set correctly. If you set the emulation boot properly, then  it should boot to application properly after reset.

    Regards,

    Vivek Singh

  • Vivek,

    Thank you for the great insight. I found it worked now if changed the emulation boot setting. It seems we can only change it in the Memory debugger, and no peripheral registers could be configured for the emulation boot setting, right?

  • Aki,

    It seems we can only change it in the Memory debugger, and no peripheral registers could be configured for the emulation boot setting, right?

    That is correct. 

    Regards,

    Vivek Singh