[ECOS] Memory layout recommendation

Meiring, H, Mnr <meiring@sun.ac.za> meiring@sun.ac.za
Sun Sep 2 21:55:00 GMT 2007


Hi All,

I have succesfully got ecos(or the hello world app using eCos) running on the Atmel at91sam7a2 ev kit(out of RAM). 

At the moment the port is integrated into the at91sam7 family, but it is a bit messy. I think I will later change the at91sam7a2 to a separate platform port due to the lack of similarity between the sam7s and x platforms. 

What to do for a board with 16k internal RAM and 1 external SRAM chips of 512 KB each. Do I ignore the internal RAM? And if not what sections would you recommend be put there?

I have set the .ldi and .h memory configuration files to successfully work in RAM, but would welcome some motivated comment/advice on the ROM setup thereof.

.ldi file

MEMORY
{
    sram : ORIGIN = 0x00000000, LENGTH = 0x4000        //internal ram
    ram  : ORIGIN = 0x48000000, LENGTH = 0x80000       //external ram
    rom  : ORIGIN = 0x40000000, LENGTH = 0x100000     //external flash
}

SECTIONS
{
    SECTIONS_BEGIN
    CYG_LABEL_DEFN(__reserved_bootmon) = 0x00000000; . = CYG_LABEL_DEFN(__reserved_bootmon) + 0x01000;
    SECTION_rom_vectors (rom, 0x40000000, LMA_EQ_VMA)
    SECTION_text (rom, ALIGN (0x1), 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, 0x48000040, LMA_EQ_VMA)
    SECTION_data (ram, ALIGN (0x4), FOLLOWING (.gcc_except_table))
    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
    CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
    SECTIONS_END
}

.h file

#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>

#endif
#define CYGMEM_REGION_ram (0x48000000)
#define CYGMEM_REGION_ram_SIZE (0x80000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#define CYGMEM_REGION_rom (0x40000000)
#define CYGMEM_REGION_rom_SIZE (0x100000)
#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__reserved_bootmon) [];
#endif
#define CYGMEM_SECTION_reserved_bootmon (CYG_LABEL_NAME (__reserved_bootmon))
#define CYGMEM_SECTION_reserved_bootmon_SIZE (0x01000)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x48080000 - (size_t) CYG_LABEL_NAME (__heap1))
                        
Thanks in advance

Regards,
Hendrik Meiring
                        

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list