public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Memory layout recommendation
@ 2007-09-02 21:55 Meiring, H, Mnr <meiring@sun.ac.za>
  2007-09-03 19:30 ` Sergei Gavrikov
  0 siblings, 1 reply; 2+ messages in thread
From: Meiring, H, Mnr <meiring@sun.ac.za> @ 2007-09-02 21:55 UTC (permalink / raw)
  To: ecos-discuss


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Memory layout recommendation
  2007-09-02 21:55 [ECOS] Memory layout recommendation Meiring, H, Mnr <meiring@sun.ac.za>
@ 2007-09-03 19:30 ` Sergei Gavrikov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Gavrikov @ 2007-09-03 19:30 UTC (permalink / raw)
  To: Meiring, H, Mnr <meiring@sun.ac.za>; +Cc: ecos-discuss

Meiring, H, Mnr <meiring@sun.ac.za> writes:

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

It's hardy to suggest how to organize plf. memory layout files outside
the eCos road, because that closely depends on .S sources :-) But, I
think that you will get the message observing the results:

find ${ECOS_REPOSITORY}/hal/arm/at91 -name \*ldi | xargs grep -A1 sram

I did find: there are a few templates what you wanted there.

If CPU supports the vectors remapping (from internal Flash to internal
RAM), you would place the '.fixed_vectors' section there. Certainly, you
have to support this feature in a platform setup (hal_platform_setup.h).

Also, you can use that region as some fast storage, for example, if you
describe some additional section(s) in the memory layout files. You can
even run code there, but that isn't a standard usage.

16K is small slice, but that is the gold slice if you need to test any
parts on an amateur board. For example, I use a special memory layout
(external memory less) to run 'GNU memtester' using same 16K region to
hold even .data and .bss sections (NXP LPC2294 has 16K of IRAM too). I
use eCos 'minimal' template (kernel less) to build such H/W tests.

Note: It's needed to know how CPU use that 16K region in all modes. For
example, some CPUs use (LPCs do) a part of internal RAM for firmware IAP
(IAP calls use part of IRAM for own buffers). So, you haven't to
overwrite such regions in your .ldi file.


	Sergei


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-03 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-02 21:55 [ECOS] Memory layout recommendation Meiring, H, Mnr <meiring@sun.ac.za>
2007-09-03 19:30 ` Sergei Gavrikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).