public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] running code from RAM / Memory Regions
@ 2001-08-17  2:50 Simpkins, Andy
  0 siblings, 0 replies; 3+ messages in thread
From: Simpkins, Andy @ 2001-08-17  2:50 UTC (permalink / raw)
  To: ecos-discuss

Oh one more question...

How do I tell the system what section code should reside in?

Sorry I forgot to include that in the original post

Andy

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

* Re: [ECOS] running code from RAM / Memory Regions
  2001-08-17  2:29 Simpkins, Andy
@ 2001-08-17  2:57 ` Jesper Skov
  0 siblings, 0 replies; 3+ messages in thread
From: Jesper Skov @ 2001-08-17  2:57 UTC (permalink / raw)
  To: Simpkins, Andy; +Cc: ecos-discuss

>>>>> "Simpkins," == Simpkins, Andy <Andy.Simpkins@Transcomm.uk.com> writes:

Simpkins,> Am I approaching this the write way?  Are there any
Simpkins,> pitfalls I should watch out for?  Has this already been
Simpkins,> done (obviously it has) but is the code available?

Simply mark the function to be located in .2ram and it will
automagically do the right thing:

void flash_query(void* data) __attribute__ ((section (".2ram.flash_query")));


That is, assuming you are using eCos from CVS. Otherwise you'll need
to hack the arm.ld file so it contains a .data rule like this:

#define SECTION_data(_region_,  _vma_, _lma_) \
    .data _vma_ : _lma_ \
    { __ram_data_start = ABSOLUTE (.); *(.data*) *(.data1) MERGE_IN_RODATA \
    _GOT1_START_ = ABSOLUTE (.); *(.got1) _GOT1_END_ = ABSOLUTE (.); \
    _GOT2_START_ = ABSOLUTE (.); *(.got2) _GOT2_END_ = ABSOLUTE (.); \
    . = ALIGN (4); \
    KEEP(*( SORT (.ecos.table.*))) ;            \
    . = ALIGN (4); \
    __CTOR_LIST__ = ABSOLUTE (.); KEEP (*(SORT (.ctors*))) __CTOR_END__ = ABSOLUTE (.); \
    __DTOR_LIST__ = ABSOLUTE (.); KEEP (*(SORT (.dtors*))) __DTOR_END__ = ABSOLUTE (.); \
    *(.dynamic) *(.sdata*) *(.sbss*) \
    . = ALIGN (4); *(.2ram.*) } \
    > _region_ \
    __rom_data_start = LOADADDR (.data); \
    __ram_data_end = .; PROVIDE (__ram_data_end = .); _edata = .; PROVIDE (edata = .); \
    PROVIDE (__rom_data_end = LOADADDR (.data) + SIZEOF(.data));

Cheers,
Jesper

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

* [ECOS] running code from RAM / Memory Regions
@ 2001-08-17  2:29 Simpkins, Andy
  2001-08-17  2:57 ` Jesper Skov
  0 siblings, 1 reply; 3+ messages in thread
From: Simpkins, Andy @ 2001-08-17  2:29 UTC (permalink / raw)
  To: ecos-discuss

Hi there,

I am trying to write to FLASH as part of eCos application.  I have just the
one FLASH chip on my custom board (ARM7TDMI core), from here all of my code
runs.

Because I can not read from FLASH whilst performing erase/program operations
on the chip I must run my FLASH programming code from RAM. 

I have never attempted to do anything like this before and would appreciate
some help.

I believe that it would be simpler if my FLASH control code resides at a
permanent / fixed location in RAM rather than allocating space for it each
time that it needs to run.  

I assume that, within the eCos config tool, I should therefore create a
memory region in my ROM memory area that is relocated into an area in RAM,
and that this will tell the compiler to compile the code as if it were
resident at the RAM address but place it in the final output file in the
address in ROM.

Does eCos copy the code from FLASH to this area of RAM on system start up
for me or do I need to copy it myself?  I would assume that I need to copy
it myself.

Am I approaching this the write way?  Are there any pitfalls I should watch
out for?  Has this already been done (obviously it has) but is the code
available?

Many thanks for taking the time to read this, any advice would be gratefully
received.

Kind regards,

Andy

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

end of thread, other threads:[~2001-08-17  2:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-17  2:50 [ECOS] running code from RAM / Memory Regions Simpkins, Andy
  -- strict thread matches above, loose matches on Subject: below --
2001-08-17  2:29 Simpkins, Andy
2001-08-17  2:57 ` Jesper Skov

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