Strange ROM image addresses for .sdata and .sdata2 sections

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

Strange ROM image addresses for .sdata and .sdata2 sections

Jump to solution
1,449 Views
pierreschmidt
Contributor III

Hello,

 

In my MPC5668  project the .lcf file defines the .sdata and .sdata2 sections as beeing part of the RAM, but I also generate a ROM image, so the sections are generated at ROM addresses.

 

The problem is that for some reason I cannot explain those sections are generated at some invalid addresses. Here is the memory map from the .map file:

 

 

Memory map:

 

Starting Size File ROM RAM Buffer S-Record

 

address Offset Address Address Line

 

APPLVECT_FROMCAN 00010000 00000008 000002e0 00010000 00010000 2

 

.text1 00010010 000000f0 000002f0 00010010 00010010 3

 

FBLHEADER 00010100 00000030 000003e0 00010100 00010100 15

 

.text_e 00010130 00000000 00000410 00010130 00010130 0

 

.text 00010130 00000000 00000410 00010130 00010130 0

 

.ctors 00010130 00000000 00000410 00010130 00010130 0

 

.dtors 00010130 00000000 00000410 00010130 00010130 0

 

.oscode 00010130 00000000 00000410 00010130 00010130 0

 

.osconst 00010130 00000000 00000410 00010130 00010130 0

 

.ossconst 00010130 00000000 00000410 00010130 00010130 0

 

.osstring 00010130 00000000 00000410 00010130 00010130 0

 

APPLVECT 00010130 00000060 00000410 00010130 00010130 18

 

FLASHROM 00010190 000002f0 00000470 00010190 00010190 23

 

EEPDATA 40004000 00000100 00000760 00010480 00010480 0

 

.data 40004100 00000000 00000760 40004100 40004100 0

 

.sdata 40004100 00000000 00000760 bfffbf00 bfffbf00 0

 

.sbss 40004100 000003c0 00000760 00010480 00010480 0

 

.bss 400044c0 00018cc0 00000760 00010480 00010480 0

 

.osdata 4001d180 00000000 00000760 00010480 00010480 0

 

.ossdata 4001d180 00000000 00000760 00010480 00010480 0

 

RAMCODE 4001d180 0000da34 00000760 00010480 00010480 61

 

.sdata2 4002abb8 000003e0 0000e198 ffffd5b8 ffffd5b8 2854

 

When the programmer sees ffffd5b8, it just tells it is an invalid address and doesn't burn the .sdata2 section.

 

So how to change that to have those sections at right addresses just after RAMCODE for example.

 

Thanks a lot.

 

P.SCHMIDT

 

Labels (1)
0 Kudos
1 Solution
749 Views
pierreschmidt
Contributor III

  

Réponse correcteRe: Strange ROM image addresses for .sdata and .sdata2 sections

Pierre SCHMIDT Level 1

<:SECTION> 

En cours de modération

 

I finally found out what was wrong.

In the .lcf file (originally from a windriver project) .sdata2 section was defined as follows:

.sdata2 LOAD(ADDR(.sdata2) - ADDR(RAMCODE) + __TEXT_ROM)

This definition causes bad ROM image address calculation, so I made changes by adding (  ) to the RAMCODE size calculation:

.sdata2 LOAD((ADDR(.sdata2) - ADDR(RAMCODE)) + __TEXT_ROM)

This is OK and it means the compiler gives priority to the + operator over -

Pierre

View solution in original post

0 Kudos
2 Replies
750 Views
pierreschmidt
Contributor III

  

Réponse correcteRe: Strange ROM image addresses for .sdata and .sdata2 sections

Pierre SCHMIDT Level 1

<:SECTION> 

En cours de modération

 

I finally found out what was wrong.

In the .lcf file (originally from a windriver project) .sdata2 section was defined as follows:

.sdata2 LOAD(ADDR(.sdata2) - ADDR(RAMCODE) + __TEXT_ROM)

This definition causes bad ROM image address calculation, so I made changes by adding (  ) to the RAMCODE size calculation:

.sdata2 LOAD((ADDR(.sdata2) - ADDR(RAMCODE)) + __TEXT_ROM)

This is OK and it means the compiler gives priority to the + operator over -

Pierre

0 Kudos
749 Views
Monica
Senior Contributor III

Pierre,

Thank you very much for sharing your resolution!

Best regards.

0 Kudos