RE: Init data

"Randall Young" <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>

> In the initialisation the fonction  __init_data is called in the
> __start.c file.
> This fonction use the __copy_rom_section(dci->addr, dci->rom, dci-
> >size); tp copi e the data from rom to ram.
>
> This copy does not work because dci->addr, and dci->rom are
> identical.
>
> What is wrong ?
> I use libraries Runtime.PPCEABI.H.a and MSL_C.PPCEABI.bare.H.a
>
> Do i need special compilation argument ?
> Is my link file uncompleted ?

I don't use CW, so I can't comment on the right linker commands, but I'm
fairly certain you are missing some.  There has to be some sort of "Load at"
command to store the image of the initialized RAM data into ROM addresses,
but perform the link as though the data was located in RAM.  With the Diab
linker, this would be something like :

	GROUP : {
		__DATA_RAM = .;
		.sdata LOAD(__DATA_ROM) : { *(.sdata) *(.data) }
		__DATA_END = .;
	} > extram

This snippet sets 2 of the 3 linker symbols we use to initialize RAM
(__DATA_RAM, __DATA_END) and performs the necessary address wizardry.
__DATA_ROM was already set to the end of ROM already written.

Randall Young
Senior Software Engineer
NavCom Technology, Inc.
A John Deere Company



-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
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.