[ECOS] Problem with memory layout (.ldi file)

Himanshu Patel himanshup@aftek.com
Fri Apr 3 06:42:00 GMT 2009


Hi,

We are porting eCos onto board with LPC2458 processor. The board has
segmented RAM memory speared across 32-bit address space. 

Segment 1: start address 0x40000000, Length = 0xFFE0
Segment 2: Start address 0x7FE00000, Length = 0x4000  

We want to have .bss section mapped in section (Segment 1) and data and
heap to be mapped in section(Segment 2). We tried to modify the .ldi and
.h file. However we are getting error (heap.cxx: invalid operands of
type "int" and "char" to binary operator).

.ldi file:

#include <cyg/infra/cyg_type.inc>
#include <pkgconf/hal_arm_lpc24xx_aftek2458.h>

MEMORY
{
    rom    : ORIGIN = 0x00000000, LENGTH = 0x80000
    sram   : ORIGIN = 0x40000000, LENGTH = 0xFFE0
    sram2   : ORIGIN = 0x7FE00000, LENGTH = 0x4000
}

SECTIONS
{
    SECTIONS_BEGIN
    SECTION_rom_vectors (rom, 0x00000000, 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 (sram, 0x40000400, LMA_EQ_VMA)
    SECTION_data (sram2, 0x7FE00000, FOLLOWING (.gcc_except_table))
    SECTION_bss (sram, 0x40000540, FOLLOWING(.fixed_vectors))
    CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
    SECTIONS_END
}

.h file:

// eCos memory layout - Wed Apr 11 13:49:55 2001

// This is a generated file - do not edit

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

#endif
#define CYGMEM_REGION_sram (0x40000000)
#define CYGMEM_REGION_sram_SIZE (0x0000FFE0)
#define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R |
CYGMEM_REGION_ATTR_W)


#define CYGMEM_REGION_rom (0x00000000)
#define CYGMEM_REGION_rom_SIZE (0x00080000)
#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)


#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x40010000 - (size_t) CYG_LABEL_NAME
(__heap1) - 32)

What is going wrong? Is anyone has tried with similar configuration
(segemented RAM or two different RAM memory)? If yes, please send the
same for reference.

Regards,

Himanshu Patel



--
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