This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ROMRAM stand-alone application


On Thu, Apr 08, 2004 at 08:35:24AM +0100, Alan Bowman wrote:
> I found a discrepancy in the EB55 ROMRAM code, between the section that masks addresses before copying ROM to RAM, and the memory map that the linker uses to determine where to put code.  I used the following patch to adjust the memory map:
> 
> Index: mlt_arm_at91_eb55_romram.ldi
> ===================================================================
> RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb55/current/include/pkgconf/mlt_arm_at91_eb55_romram.ldi,v
> retrieving revision 1.1
> diff -u -r1.1 mlt_arm_at91_eb55_romram.ldi
> --- mlt_arm_at91_eb55_romram.ldi	13 May 2003 18:27:59 -0000	1.1
> +++ mlt_arm_at91_eb55_romram.ldi	17 Dec 2003 14:43:48 -0000
> @@ -14,7 +14,7 @@
>  {
>      SECTIONS_BEGIN
>      SECTION_fixed_vectors (sram, 0x20, LMA_EQ_VMA)
> -    SECTION_rom_vectors (ram, 0x02008000, LMA_EQ_VMA)
> +    SECTION_rom_vectors (ram, 0x02000000, LMA_EQ_VMA)
>      SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
>      SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
>      SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA)


There does seem to be an inconsistency. The code that actually does
the relocation is

#if defined(CYG_HAL_STARTUP_ROMRAM)
        ldr     r0,=0x01000000          // Relocate FLASH/ROM to on-chip RAM
        ldr     r1,=0x02000000          // RAM base & length
        ldr     r2,=0x02010000
20:     ldr     r3,[r0],#4
        str     r3,[r1],#4
        cmp     r1,r2
        bne     20b
        ldr     r0,=30f
        mov     pc,r0
30:
#endif

it is copying from 0x1000000 to 0x2000000. Also note that it only
copies 0x10000 bytes. If you application is bigger then this you will
need to modify this like.

> This alters the location that ROMRAM code is linked at (I think) and
> matches the startup code for the ROMRAM version of the EB55.  Only
> problem - if you try to use a ROMRAM version of Redboot to load a
> RAM version of your application, the same bit of memory is used for
> both and they clash.  However, this change worked perfectly well for
> us to develop ROMRAM applications for our EB55.

Thats normal. There are two uses of ROMRAM. One is for the application
and the other is for RedBoot. Normally the _romram.* file are setup
for one or the other. They cannot do both. It appears these files are
somewhere in the middle and don't work for either.

Please submit a patch with a ChangeLog entry and i will commit it.

       Thanks
        Andrew

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]