avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Harald Kipp
Subject: Re: [avr-libc-dev] Hint For Watchdog Disable on Newer AVRs in the Manual
Date: Thu, 19 Jul 2007 11:35:29 +0200
User-agent: Thunderbird 1.5.0.12 (Windows/20070509)

Joerg Wunsch wrote:

u_char mcusr_mirror __attribute__ ((section (".noinit")));
Yes, that has been left out by accident.  Could you please fill in a
bug report for this, so it won't be forgotten about?
Done.

What I don't quite understand, why does it not work for you to have
that code in .init3?  After all, .init2 only contains clearing
__zero_reg__, and the initialization of the stack pointer, so I don't
really see why that should get you at risk with the default ~ 15 ms
watchdog timer.  (Unless you've got loads of code in .init1, of
course.)

.init2 initializes the stack pointer, which may point into external memory. Some memory mapped chips (in our case the RTL8019AS Ethernet Controller) may interfere with the memory bus if not properly initialized. Resetting and initializing an Ethernet Controller can take much more time than 15 ms. Note, that this is an Open Source project and the sequence of .init3 code is beyond our control. So we have to use an earlier init segment.

Anyway, even our second mega2561 board, which got a different controller and doesn't require early initialization, failed with disabling the wdt in .init3 but runs fine when disabling it in .init0. Could that be a result of the fuses settings? CKSEL and SUT are all unprogrammed, which results in a clock start-up time of 16K cycles plus 65 ms. I assumed, that the watchdog won't start earlier than the CPU - but who knows?

Harald





reply via email to

[Prev in Thread] Current Thread [Next in Thread]