Hi all, I am trying to learn more about the linker file used in a ROMRAM configuration. I have looked at several other ROMRAM ldi files for the ARM, but I can't seem to find much agreement as to the proper way to set up the SECTIONS section.
Our board has 2MB ROM and 32MB RAM and uses an iMX27 (ARM9) processor. The current ldi file is adapted from a Freescale Redboot port to the iMX27 LiteKit and looks like this: MEMORY { ram : ORIGIN = 0, LENGTH = 0x02000000 rom : ORIGIN = 0xA1E00000, LENGTH = 0x00200000 } SECTIONS { SECTIONS_BEGIN SECTION_rom_vectors (rom, 0xA1E00000, LMA_EQ_VMA) SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA) SECTION_sram (ram, 0x8000, FOLLOWING (.gcc_except_table)) SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); SECTIONS_END } If I understand correctly, the lengths provided from rom and ram in the MEMORY section should be the actual size without concession for a copy of ROM that would consume a portion of the RAM. The rom ORIGIN is an offset into the RAM (which is mapped to both 0x00000000 and 0xA0000000). We want our app to be loaded to the end of the RAM. In some of the other ROMRAM ldi files I looked at, the SECTION declarations use only 'ram' and not 'rom'. I'm thinking this may not matter depending on the order and SECTION declaration options (assuming you are only working with a single chunk off RAM). Is this thinking correct? I have also seen some discussion in the archives suggesting that using LMA_EQ_VMA is not the right thing to use. Is there a final word on this? Should I use only FOLLOWING, as I have seen elsewhere? Is there some general rules of thumb on setting up the SECTION declarations to avoid common mistakes/problems? Any advice is welcome. Thank you, -- Michael Bergandi -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss