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's msp430-gcc with lagre array to init will lead watch dog to fire. how to solve? there are ways for IAR and TI's compiler but not for MSPGCC

many people have met this problem and for IAR, we can delcare __low_level_init() and for TI's compiler we can delcare _system_pre_init() and stop watch dog in the function above.

but mspgcc seems doesn't support any of the methord......

  • Add the following code to the system ...

    #include <msp430.h>
     
    static void __attribute__((naked, section(".crt_0042"), used))
    disable_watchdog (void)
    {
      WDTCTL = WDTPW | WDTHOLD;
    }

    That arranges for the function disable_watchdog to be called during system startup.  Please note it remains the user's responsibility to enable the watchdog timer at the appropriate time, which is probably at the beginning of main.

    Thanks and regards,

    -George