LMA in the wrong place?

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

LMA in the wrong place?

898 Views
ianbenton
Senior Contributor I

I'm writing a bit of assembler, which has to initialise the RAM so I put the data in the .data section.

The assembler should have made a table of the data to be initialised at the end of the program in flash

and label the start as LMA

Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00001c3c 00000000 00000000 00010000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000070 02000000 02000000 00020000 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .data_RAM2 00000000 02001000 02001000 00020070 2**2
CONTENTS
3 .data_RAM3 00000000 02002000 02002000 00020070 2**2

The amount of data is correct (112 bytes (0x70)), but the LMA appears as the same as the VMA. I would have expected the .data LMA to be after .text hence 0x1c3c.

In some software I wrote four years ago, it seems to get it right (.data LMA is at the end of .text = 0x1EA4)

Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00001ea4 00000000 00000000 00010000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 0000016c 02000000 00001ea4 00020000 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .data_RAM2 00000000 02001000 02001000 0002016c 2**2
CONTENTS
3 .data_RAM3 00000000 02002000 02002000 0002016c 2**2

Something must not be set up correctly - any clues?

Labels (2)
Tags (2)
0 Kudos
Reply
2 Replies

830 Views
converse
Senior Contributor V

I can't quite see your code and linker script from here... Perhaps you could post your code so we can see?

0 Kudos
Reply

830 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Ian,

I think this could be due to you allocate in the data section and this usually starts where the RAM is allocated. You can check this in the linker file and corroborate where the sections are being placed in the map file.

Let me know if this helps you.

Best Regards,

Alexis Andalon

0 Kudos
Reply