----- Ursprüngliche Nachricht -----
Von: Peter Bigot
Gesendet am: 13 Mrz 2011 12:49:47


> As a minor irritant, mspgcc is the only msp430 toolchain I know that
> immediately disables the watchdog, pretending it doesn't exist.  After
> nearly a decade of this the default behavior can't change, but it can at
> least be controlled.

Yes, this was the reason why I reqrote the startup code in my projects (to 
ensure
proper operation in an ESD-prone environment, the WDT needs to be
active ALL the time, even during startup)
It took me some time to figure out why the WDT was not triggering even if I 
didn't
disable it and it should be on after a reset.
It is as annoying as the 'feature' in CCS (TIs own compiler suite) which does 
not
initialize uninitialized variable space to 0 (which will speedup the startup and
therefore usually prevent the WDT from triggering)


> main() will no longer jump to some arbitrary location instead of returning.
> It will return, and having done so will fall-through to the .fini9 section.
> Consequently, the -mendup-at= option will be removed.  Override
> __stop_progExec__ if you want it to do something else.

Well, especially on the new G devices with only 128 bytes Ram, this
"new way" will waste ~2% of the ram since there needs to be one additional
return address on the stack. On these devices, every byte counts.
On 430X-devices, this will be 4 bytes (but then there is much more ram).

> A new option -menable-watchdog will be added which change which libcrt0.a
> file gets linked in.  The default will be the existing approach that
> disables the watchdog on reset; an alternative will leave it enabled (and
> ensure it gets kicked at appropriate stages during the initialization).

Great.

Well, since the loop counters in the init code are word registers, there
is only one 3-instruction-loop for each init stage (copy/clear).
And running a complete loop may easily exceed default WDT timeout
on 1x/2x/4x devices (only on 5x/6x the default WDT interval is long enough)
So in my startup code, I ended up with simply triggering the WDT on each
iteration.
With the value preloaded in a register, it only takes 3 cycles/4 bytes
and is not slower than any fancy code with additional checks/counts/whatever.

> Comments?

given :)

JMGross

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to