from faq:
5. Putting code at specific address.
Q. My problem is that I don't know how to tell GCC where to place my code.
My code space must start at 0xd400...How do I tell it where to place the
code segment?
A. There are two ways to do this:
1. Rework linker script and define that section ".text" starts from 0xd400.
2. Create an attribute defenition:
#define MY_SECTION __attribute__((section(".newsection")))
(This attribute can be combined with any attribute described above)
In every function defenition (and forward declaration) add this
attribute as:
type MY_SECTION function(params...);
Do the same with constants declaration if necessary:
const MY_SECTION type my_const = MY_VALUE;
In command line define the section along with other compile options:
msp430-gcc -Wl,--section-start -Wl,.newsection=0xd400 [other necessary options
and files]
Also, you can put constants to the '.infomem' part of flash.
Then :
#define infomem_sect __attribute__((section(".infomem")))
const infomem_sect type my_const = MY_VALUE;
no special command line options required then.
~d
On Wednesday 14 May 2003 17:45, Saso Zbontar wrote:
> Hi,
> I am using msp430f413 (8k bytes of flash from 0xe000-0xffff , 256 user
> flash at 0x1000) Here comes the problem: my program size is over 8k so the
> idea is to use user flash at 0x1000 to place some constants instead in
> normally defined .text area. Is it possible to do that ? Every my attempt
> to tell the linker to place specially defined section for some constants at
> 0x1000 was very frustrating
>
> Regards Saso
--
/********************************************************************
("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ
`6_ 6 ) `-. ( ).`-.__.`) Enterprise Information Sys
(_Y_.)' ._ ) `._ `. ``-..-' Nevsky prospekt, 20 / 44
_..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia
(il),-'' (li),' ((!.-' +7 (812) 3468202, 5585314
********************************************************************/