This may work great if you need portability between mspgcc3, mspgcc4, and
mspgcc as it is today.
It's not so great if you want to be compatible with future mspgcc release.
For historical reasons, __low_level_init includes things that other parts of
the CRT code depend on. Replacing it may require that you also replace
__do_copy_data and __do_clear_bss and __do_global_ctors and other CRT
components not yet defined.
As an example, without -mdisable-watchdog you'll still get versions of two
of those other routines that will store the contents of r5 into WDTCTL
periodically as they go about their work. If you didn't load r5 with WDTPW
+ WDTHOLD in __low_level_init, lord only knows what's going to happen, but
among other things, the watchdog will probably be re-enabled with some
random timeout.
Perhaps this is the cause of your obscure problems that go away when you use
mspgcc4, which does not have watchdog support in the CRT code.
Do what you need to do to get the job done, but be aware that placing things
in specific init/fini sections is an advanced technique.
If you just want to disable the watchdog, -mdisable-watchdog is the way to
do that without breaking anything else.
Peter
On Mon, Aug 15, 2011 at 3:31 AM, aliko <ali.tli...@gmail.com> wrote:
> 14.08.2011 14:48, Sergey A. Borshch пишет:
> > extern "C" __attribute__((naked, section(".init3"))) void
> __low_level_init()
> > {
> > WDTCTL = WDTPW + WDTHOLD;
> > }
> >
>
> Thank you very much!
> It is good general-purpose approach.
>
>
>
> ------------------------------------------------------------------------------
> uberSVN's rich system and user administration capabilities and model
> configuration take the hassle out of deploying and managing Subversion and
> the tools developers use with it. Learn more about uberSVN and get a free
> download at: http://p.sf.net/sfu/wandisco-dev2dev
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users