Init data

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


Hello

I work on MPC565 with CodeWarrior development studio version 8.1. 

My programme does not work in FALSH memory.
I have a problem with the initialisation of the initialisation of  
global data. 
In fact the data are not initialised in RAM. The copy from ROM to 
Ram does not work.

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 ?


Thanks in advance ?


Here is my link file


_flash_source	= 0x00810000;		// **NOTE: MUST match RAM 
buffer address
								
	// setting in linker preference panel

_stack_addr = 0x003FFFF0;
_stack_end  = 0x003F0000; // cas prog seul en ram externe

/* Default linker command file for 555 ETAS board */

MEMORY {
  //ram : org = 0x003F7010, len = 0x000089F0  // cas data en ram 
interne
  ram : org = 0x10050000, len = 0x00020000  // cas data en ram 
externe
  rom : org = 0x00000000, len = 0x000FDFFE  // cas prog + data en 
ram externe
}
 
/* We use FORCEFILES so that the linker will not deadstrip the file 
reset.s. The function
	reset would be deadstripped since it is not ever called by 
anything */

//FORCEACTIVE { gInterruptVectorTable, __reset }

SECTIONS {

	.reset : {} > rom
    
	.init  : {} > rom
	
	GROUP : {
		.text (TEXT) ALIGN(0x1000) : {}
		.rodata (CONST) : {
			*(.rdata)
			*(.rodata)
		}
		.ctors : {}
		.dtors : {}
		extab : {}
		extabindex : {}
	} > rom 	// for ROM images, this can be 'rom' if you 
want to execute in ROM
				// or 'code' if you want to execute 
in RAM
	GROUP : {
		.data : {}
		.sdata : {}
		.sbss : {}
		.sdata2 : {}
		.sbss2 : {}
		.bss : {}
		.PPC.EMB.sdata0 : {} 
		.PPC.EMB.sbss0 : {}		
	} > ram

}











-----------------------------------------------------------
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.