Forums

Initialising _startupData with serial bootloader.

Started by johnpititto1976 January 5, 2004
Hi All,

Best wishes for 2004.

I have been developing a serial bootloader into my application using
Mot AN2153. I am having trouble with the structure _startupData
(below is an snipit). The structure is initialised by the linker and
located at C000. When I perform a flash erase the contents of the
structure are erased. I need to either relocate this structure so it
is not affected or somehow re-initialise the contents after a re-
program has been performed. I would prefer to re-initialise the
structure. Does any one know how I would do this?

struct _tagStartup _startupData;//read-only:
//_startupData is allocated in ROM and
//initialized by the linker

Kind Regards,

John Pititto



Since I've just finished basically the same sort of project, I'm a
bit confused as to what problem you're having.

The CW the default position for the start of your code would be
C000, so why don't you want it getting erased? All the CW projects
I've started have had this in (that were written in C). When I
reload the processor with my application code from the bootloader,
the _StartupData section gets added in just like the rest of my
program.

I haven't done a lot with the linker.prm file, so I'm sure someone
will correct me if I'm wrong, but you should be able to change a
line in the file for the project you wish to load with the
bootloader.
ROM_C000 = READ_ONLY 0xC000 TO 0xFEFF;
change to
ROM_C000 = READ_ONLY NewStartAddress(0xD000 will give more than
enough room) TO 0xFEFF;

This will relocate the _StartupData tag, but it's not going to help
when you try to erase the flash useing the bootloader. It will keep
you from programing over your bootloader if you changed it from f000
to c000. I'm fairly certain you'll need to change the erasing
commands in the AN2153 software if you want to erase specific
locations, but I'm not quite comfortable enough with all that(yet)
to give you good advice on how to go about changing it.
--- In , "johnpititto1976"
<johnpititto1976@y...> wrote:
> Hi All,
>
> Best wishes for 2004.
>
> I have been developing a serial bootloader into my application
using
> Mot AN2153. I am having trouble with the structure _startupData
> (below is an snipit). The structure is initialised by the linker
and
> located at C000. When I perform a flash erase the contents of the
> structure are erased. I need to either relocate this structure so
it
> is not affected or somehow re-initialise the contents after a re-
> program has been performed. I would prefer to re-initialise the
> structure. Does any one know how I would do this?
>
> struct _tagStartup _startupData;//read-only:
> //_startupData is allocated in ROM
and
> //initialized by the linker
>
> Kind Regards,
>
> John Pititto