Re: Can the RESET_VECTOR be redefined at compile time to a specific value?

Tomek Lorek <[email protected]>
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.user
Message-ID <CAP62dvACo3J2q6wzdb08QNLcsQkGkneDdQucLhSt1iskpL-+hw@mail.gmail.com>
2014-04-18 19:40 GMT+02:00 Peter Bigot <[email protected]>:
Thanks Peter!

> Yes, if you define a naked function named _reset_vector__ that's in
> section .init0 the mspgcc linker scripts will use it instead of the
> default one.
>
> You'd want to do something like:
>
> __attribute__((__naked__,__section__(".init0")))
> void _reset_vector (void)
> {
>    /* stuff goes here */
> }

I;m not sure If I understand your hint correctly - the method above
gives me the possibility of redefining the _reset_vector function
body, but not the address.

I will try to rework the linker script or my application to something like this:

MEMORY
{
...
init0: ORIGIN = 0x4400, LENGTH = 0x2
...

}

SECTIONS
{
  .init0
  {
    *(.init0)
  } > init0
}

and see if that works.

Best Regards,
Tomek

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.