From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Robert Cragie" To: Subject: [ECOS] Declaring new section Date: Fri, 10 Aug 2001 03:40:00 -0000 Message-id: X-SW-Source: 2001-08/msg00305.html I needed to declare a new section for a specific SRAM device on my board. I did this by the adding the following lines in the .ldi file: // eCos memory layout - Tue Feb 29 14:25:49 2000 // This is a generated file - do not edit #include MEMORY { ram : ORIGIN = 0, LENGTH = 0x4000000 rom : ORIGIN = 0x24000000, LENGTH = 0x80000 Added this line ---> sram : ORIGIN = 0x28001000, LENGTH = 0x0003F000 } SECTIONS { SECTIONS_BEGIN SECTION_rom_vectors (rom, 0x24000000, 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_data (ram, 0x800, FOLLOWING (.gcc_except_table)) SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); Added this line ---> SECTION_sram (sram, 0x28001000, LMA_EQ_VMA) SECTIONS_END } This worked fine, but when I came to generate an S-record file (using "arm-elf-objcopy -S -O srec myfile myfile.srec") for downloading, it added in loads of S-records at 0x28000000, all 0. This screws up the ARM Boot Monitor flash downloader, as it somehow assumes these should go where the flash is at 0x24000000. I noticed that the .sram section (according to "arm-elf-objdump -h myfile") is of type CONTENTS, ALLOC, LOAD, DATA. There is obviously a bit of magick going on between the .ldi file and target.ld - is there any way I can make the .sram section like the .bss section, i.e. so it is cleared to zero and doesn't appear as downloadable? Also, whilst we're on the subject, is there anyway to link in .a files without having to physically include them in target.ld? TIA Robert Cragie Design Engineer Jennic Ltd. Furnival Street Sheffield S1 4QT United Kingdom Tel: +44 (0) 114 281 4512 Fax: +44 (0) 114 281 2951 Mob: +44 (0) 7940 558520 mailto:rcc@jennic.com http://www.jennic.com