- To: Jesper Skov <jskov at redhat dot com>
- Subject: RE: [ECOS] running code from RAM / Memory Regions
- From: "Simpkins, Andy" <Andy dot Simpkins at Transcomm dot uk dot com>
- Date: Fri, 17 Aug 2001 14:36:52 +0100
Hi there,
Thanks for the pointers, I am afraid that I still need a little more help
though
Thanks
Andy
> -----Original Message-----
> From: Jesper Skov [mailto:jskov@redhat.com]
> Sent: 17 August 2001 10:58
> To: Simpkins, Andy
> Cc: ecos-discuss@sources.redhat.com
> Subject: Re: [ECOS] running code from RAM / Memory Regions
>
>
> >>>>> "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")));
>
this always gives a compiler error :
parse error before `{'
when I have the following function
void flash_query(void* data) __attribute__ ((section (".2ram.flash_query")))
{
// do something
}
>
> 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:
No I am not using a CVS snapshot so shall need the following...
>
> #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));
I couldn't use your example directly because I also needed the section for
__DEVTAB__ but have been able to get this part working...
>
> Cheers,
> Jesper
>