Linker warning after RAM section creation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linker warning after RAM section creation

Jump to solution
827 Views
frgop
Contributor II

Requirement: to create a RAM section and place it a specific memory location, for MPC5606B (very simple!)

 

Tools used: CW, LCF file, TRK-MPC5606B evaluation board

 

Sample code:

#pragma push

#pragma section sdata_type ".myRamData" ".myRamData"

extern unsigned char myU8Data; /*prototype */

unsigned char myU8Data; /*definition*/

#pragma pop

LCF:

MEMORY

{

    boot_flash:           org = 0x00000000,   len = 0x00010000

    interrupts_flash:     org = 0x00010000,   len = 0x00010000

    internal_flash:       org = 0x00020000,   len = 0x00060000

    add_data_flash:       org = 0x00080000,   len = 0x00000100

    add_code_flash:       org = 0x00080100,   len = 0x00000100

    internal_ram:         org = 0x40000000,   len = 0x00007B00

    add_data_ram:         org = 0x40007B00,   len = 0x00000100

    stack_ram:            org = 0x40007C00,   len = 0x0400

}

 

SECTIONS

{

   ...

  .myRamData (DATA) : {} > add_data_ram

  ...

}

 

Result: The result is good as I am able to see the section created in MAP file (see below)

.myRamData section layout

  Starting        Virtual  File

  address  Size   address  offset

  ---------------------------------

  00000000 000001 40007b00 00000358  1 .myRamData     main.o

  00000000 000001 40007b00 00000358  1 myU8Data     main.o

 

Problem faced:

However a Linker warning is issued as follows:

Overlap of the ROM image address of .myRamData section with executable address of .text_vle section.

Project: LINFlex_LIN_Example.mcp, Target: LINFlex_LIN-flash

How to remove this warning.

 

P.S: If you already guessed it, then yes you are correct, I am using the example workspace for LIN that comes along with the EVB.

 

Thanks in advance.

 

Regards,

Gopal.





Labels (1)
1 Solution
532 Views
frgop
Contributor II

Hello All,

The warning was removed by using LOAD directive in the LCF as follows:

.myRamData (DATA) LOAD(0x40007B00) : {} > add_data_ram

Reason:

LOAD (...) prevents relocation by ROM copy during startup; I observed that if the LOAD is not present then in the "Memory map:", under column "ROM Address" for section ".myRamData" is set to some ROM address which is used for some other code area.

!!

Gopal.

View solution in original post

1 Reply
533 Views
frgop
Contributor II

Hello All,

The warning was removed by using LOAD directive in the LCF as follows:

.myRamData (DATA) LOAD(0x40007B00) : {} > add_data_ram

Reason:

LOAD (...) prevents relocation by ROM copy during startup; I observed that if the LOAD is not present then in the "Memory map:", under column "ROM Address" for section ".myRamData" is set to some ROM address which is used for some other code area.

!!

Gopal.