[avr-libc-dev] Hint For Watchdog Disable on Newer AVRs in the Manual

2007-07-18 Thread Harald Kipp
The manual offers a solution for early watchdog disabling in .init3. However, the code uses a global variable to store the current value of MCUSR. Isn't this variable cleared again in .init4? Did I miss something? Anyway, it should be noted, that using .init3 may not work under certain

Re: [avr-libc-dev] Hint For Watchdog Disable on Newer AVRs in the Manual

2007-07-18 Thread Harald Kipp
Answering my own questions: No idea what __init() is intended to do, but it won't help: No initialized stack pointer, no return. Using any earlier section than .init3 provides another problem: No initialized __zero_reg__, no MCUSR or watchdog clear. To avoid overriding the mirror variable,

Re: [avr-libc-dev] Hint For Watchdog Disable on Newer AVRs in the Manual

2007-07-18 Thread Joerg Wunsch
As Harald Kipp wrote: No idea what __init() is intended to do, but it won't help: No initialized stack pointer, no return. __init() is the name of the routine jumped to from the reset vector. crtXXX.o provides a default implementation which is marked weak, so you could overlay it by your own.