This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
RE: Re: Placing data at an absolute address
- From: "Laurie Gellatly" <laurie dot gellatly at netic dot com>
- To: "Grant Edwards" <grante at visi dot com>, <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 2 Apr 2007 09:04:32 +1000
- Subject: RE: [ECOS] Re: Placing data at an absolute address
Hi Grant,
objcopy - looked at that and yep, that will do just fine.
The MAC address is not in the code but does live in the same Flash page as
the code so it will be
convenient to be programmed at the same time.
objcopy will allow me to place the MAC into the included file after its been
update.
Excellent thanks. ...Laurie:{)
-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org]On Behalf Of Grant
Edwards
Sent: Monday, 2 April 2007 4:52 AM
To: ecos-discuss@sources.redhat.com
Subject: [ECOS] Re: Placing data at an absolute address
On 2007-04-01, Gary Thomas <gary@mlbassoc.com> wrote:
> Laurie Gellatly wrote:
>> For our eCos application, I'd like to place the MAC address at
>> a particular address in flash and have it loaded as part of
>> storing Redboot into the flash. At production time, a script
>> would be run that finds that address section in redboot.elf
>> and updates it before it is stored into the next unit. Finding
>> the section in the elf is not the hard bit. I've tried adding
>> a new section on the gcc command line and adding a variable
>> into the C source which almost works except the section size
>> is of length 0. How can I make the section 6 bytes long or is
>> there a better way to do this whole thing?
>
> The best way would be to assign this data to a particular
> section of its own, using "attribute". Then in the linker
> file, put that section at the desired physical address.
The question is then how to alter the contents of that section
during production in order to uniquely set the MAC address of
each unit. AFAICT, you'd have to use objcopy to alter the .elf
file each time before you convert to hex/binary and download.
Personally, I think putting the MAC addres into the program
itself before download is way the wrong way to go. It makes
updating firmware way too difficult.
Just reserve an "external" spot in flash memory that's not
written to when the program is downloaded. Then download the
MAC address in a separate operation.
--
Grant Edwards grante Yow! PEGGY FLEMMING is
at stealing BASKET BALLS to
visi.com feed the babies in
VERMONT.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss