This is a linker var called '_end'.

So, 

extern int _end;
int m;
(int *) m = &_end;

Now 'm' will contain flash last address.

~d


On Sunday 05 September 2004 05:45, Chris Liechti wrote:
> Berndt Josef Wulf wrote:
> > How do I find the top most address of flash used by applications at
> > runtime? I
>
> top most address: 0xfff0
> the interrupt vectors are always there ;-)
>
> > want to load and execute applications under the control of a monitor
> > program.
>
> that probably means you want to use entire flash segments anyway.
>
> > Is there a symbol that can be queried for this purpose?
> >
> > At this point of time, I only managed to do this by creating a section
> > that is placed at the top flash memory address that can be queried by the
> > application, see below:
>
> ...
>
> > Is this the way to do it or is there an easier way?
>
> yes, i would place the mointor at the upper end of the memory (as you
> probably want to use the interrupt table anyway, at least for the reset).
> then when you only use entire flash segments, which makes sense if you
> want to erase some of them at runtime, you'll have to choose a size
> multiple of 512 bytes.
>
> i used something like this in the serial<->jtag adapter, see mspgcc
> CVS/serJTAGfirmware. there i use -Ttext=0xe000 as linker option, which
> limits the text section to the upper 8kB of the flash.
> the rest of the flash is used to download user code.
>
> you probably need a similar trick for the RAM usage too.
>
> chris
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to