Does Peter Fleury boot loader STK500v2 support watchdog reset ?

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I am trying to boot load my atmega2560 to flash hex files even for a watchdog interrupts. I have made slight modification in the source code as followed.

 

#ifdef _FIX_ISSUE_181_
  //************************************************************************
  //* Dec 29, 2011  <MLS> Issue #181, added watch dog timmer support
  //* handle the watch dog timer
  uint8_t mcuStatusReg;
  mcuStatusReg  = MCUSR;

  __asm__ __volatile__ ("cli");
  __asm__ __volatile__ ("wdr");
  MCUSR = 0;
  WDTCSR  |=  _BV(WDCE) | _BV(WDE);
  WDTCSR  = 0;
  __asm__ __volatile__ ("sei");
  // check if WDT generated the reset, if so, go straight to boot
  if (mcuStatusReg & _BV(WDRF))
  {
    RX_LED_DDR   |=  (1<<RX_LED_PIN);
    boot_start();
  }
  //************************************************************************
#endif

And the boot_start definition is 

//* for watch dog timer startup
 typedef void (*fptr_t) (void);
#if defined ( __AVR_ATmega1284P__ )
fptr_t boot_start = (fptr_t)0xF000;
#elif defined ( __AVR_ATmega2560__ )
 fptr_t boot_start = (fptr_t)0x1F000;
#endif

But I am unable to perform a watch dog reset in my application program.

 

Am I missing something ?

I read few comments in the forum that STK500v2 does not supports watchdog.

It would be helpful if someone posts a light on it.

Thanks,

Srinivasa Varadhan

Last Edited: Sat. Feb 27, 2016 - 12:31 PM