Bill Shaw

Initted data linker problem

Discussion created by Bill Shaw on Aug 30, 2011
Latest reply on Sep 2, 2011 by CrasyCat

Hi all,

 

Using CW for MPC5554 V2.8 - I'm having trouble with linking.  I've read through the PA_Build_RM but am still not 'getting it'. Could someone take a look and help point me in the right direction?

 

I've got a fairly standard app,  runs from Flash and has an initialized data section that needs to be copied to RAM at run time.  If I turn off 'Generate Rom Image" it'll link but will have problems with the initialized data.  If I turn on "Generate Rom Image"  I get 3 overlap errors...

 

Overlap of the ROM image address of .text section with executable address of .entry_point section.
Overlap of the ROM image address of .text section with executable address of .text section.
Overlap of the ROM image address of .rodata section with executable address of .rodata section.

My LCF looks like this...


MEMORY
{
  /*****************************************************************************
    ROM sections
  *****************************************************************************/
 // bam_bootarea:           org = 0x00000000,   len = 0x00000008   // bam_bootarea is set up in boot, not app
  init_mwerks:            org = 0x00000010,   len = 0x00000FF0
  fault_rom:              org = 0x00020000,   len = 0x00020000 
  execption_handlers:     org = 0x00040000,   len = 0x00002000
  init_data_rom:          org = 0x00042000,   len = 0x00001000
  application_code:       org = 0x00043000,   len = 0x0003CFFC
  application_crc:        org = 0x0007FFFC,   len = 0x00000004 
  calibration_rom_0:      org = 0x00100000,   len = 0x00020000 
  calibration_rom_1:      org = 0x00120000,   len = 0x00020000
  parameter_rom_0:        org = 0x00140000,   len = 0x00020000
  parameter_rom_1:        org = 0x00160000,   len = 0x00020000
 
  /*****************************************************************************
    RAM sections
  *****************************************************************************/
  init_data_ram:          org = 0x20000000,   len = 0x00001000
  zero_init_data:         org = 0x20001000,   len = 0x000FF000
  persistent_ram:         org = 0x40000000,   len = 0x00001000
  interrupt_stack:        org = 0x40008000,   len = 0x00001000
  shutdown_task_stack:    org = 0x40009000,   len = 0x00001000
  analog_task_stack:      org = 0x4000A000,   len = 0x00001000
  control_task_stack:     org = 0x4000B000,   len = 0x00001000
  j1939_task_stack:       org = 0x4000C000,   len = 0x00001000
  background_task_stack:  org = 0x4000D000,   len = 0x00001000
  heap:                   org = 0x4000E000,   len = 0x00001000 
  stack:                  org = 0x4000F000,   len = 0x00001000  
 
  /*****************************************************************************
    Error Detection
  *****************************************************************************/
  unused_sections:        org = 0xFFFFFFFF,   len = 0x00000000
}

//FORCEACTIVE { "bam_rchw" "bam_resetvector" }

SECTIONS
{
  .init                   LOAD (0x00000010) : {} > init_mwerks
  .execption_handlers    LOAD (0x00040000) : { vector_table.o handlers.o } > execption_handlers  /* order of files important */
 
GROUP  :
  {
    .entry_point (TEXT)   : { __start.o }  /* entry point for application code must be at fixed location */
    .text        (TEXT)   : {}          
    .rodata      (CONST)  : { *(.rdata) *(.rodata) }
    .ctors                : {}
    .dtors                : {}
    extab                 : {}
    extabindex            : {}
  } > application_code


GROUP :
  {
   .data : {}               
  } > init_data_ram                   
 
  GROUP :
  {
    .bss    : { calibrations.o(.bss) *(.bss) }
  } > zero_init_data
 
  GROUP :
  {
    .sdata  : {}
    .sbss   : {}
    .sdata2 : {}
    .sbss2  : {}
  } > unused_sections
}

 

Thansk,

 

Bill

Outcomes