Go Down

Topic: Watchdog in Arduino Library - or at least support by bootloader (Read 32 times) previous topic - next topic

Nick Gammon


I don't support your words.
If the delay() is used, the watchdog will reset all time.
Reset button don't work. I have to  power off.


It's a bug in the bootloader, not the sketch. If you change the fuse to load the sketch (and bypass the bootloader) it will work correctly. Or, better, get a bootloader that handles the WDT correctly.

Embed

Regarding "
Tested on the Mega2560 board once I replaced the bootloader with this working one:

https://raw.github.com/arduino/Arduino-stk500v2-bootloader/master/goodHexFiles/stk500boot_v2_mega2560.hex
"

I found another bootloader (which seems to be the one installed with the Arduino IDE) under
https://github.com/arduino/Arduino/tree/master/hardware/arduino/
bootloaders/stk500v2/stk500boot_v2_mega2560.hex   

It has the same file name as "this working one", but its size is 103kB versus 21kB for the other.
Obviously, these are different bootloaders, and should have a different version, means e.g. stk500boot_v3_mega2560.hex for the working one. Besides of this, what are the differences between the two, other than watchdog support?

Embed

Thanks Nick to have solved the problem for the Mega2560 (now only the correctly working bootloader should be delivered with new Mega 2560 and new versions of the IDE).

Meanwhile, I have ordered the new Arduino Due. Has anyone yet successfully used watchdog with this one? Means, does the standard Due bootloader support watchdog, and what are the equivalent lines of code for the SAM3XE8 in the Arduino IDE?

Nick Gammon

I don't know, I suggest you post this question in the Due part of the forum.

westfw

Quote
Obviously, these are different bootloaders, and should have a different version, means e.g. stk500boot_v3_mega2560.hex for the working one.

"Stk500v2" is the name of the protocol supported by this bootloader, the v2 is NOT the version of bootloader itself.
I don't think that there is a separate version number for the bootloader.  Although that WOULD be a good idea.
(Hmm.  It does have the date that the code was compiled:
Bootloader>? CPU stats
Arduino explorer stk500V2 by MLS
Compiled on = Jan 28 2013

)
Quote
but its size is 103kB versus 21kB for the other.

Um?  Not that I could see.
https://github.com/arduino/Arduino/blob/master/hardware/arduino/bootloaders/stk500v2/stk500boot_v2_mega2560.hex shows as "514 lines (513 sloc) 22.989 kb"
While the newer code at https://github.com/arduino/Arduino-stk500v2-bootloader/blob/master/goodHexFiles/stk500boot_v2_mega2560.hex shows as "file 469 lines (468 sloc) 20.964 kb "
Perhaps you were comparing HTML pretty-printed web page against 'raw' file size?

Go Up