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: building for flash


My best guess to answer my original question is that I
need arm-elf-objcopy -O binary. True?

Now I'm stuck trying to determine what settings go
into mlt_arm_at91_eb40_rom.ldi and/or objcopy.
Currently, I have:

MEMORY
{
    sram : ORIGIN = 0x00000000, LENGTH = 0x1000
    ram  : ORIGIN = 0x00001000, LENGTH = 0x3f000
    rom  : ORIGIN = 0x01000000, LENGTH = 0x200000
}

SECTIONS
{
    SECTIONS_BEGIN
    CYG_LABEL_DEFN(__reserved_bootmon) = 0x01000000; .
= CYG_LABEL_DEFN(__reserved_bootmon) + 0x10;
    SECTION_rom_vectors (rom, ALIGN (0x8), 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 (sram, 0x20, LMA_EQ_VMA)
    SECTION_data (ram, 0x00001000, LMA_EQ_VMA)
    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
    CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
    SECTIONS_END
}

The problem with this setting is that objcopy is
creating a (huge) binary image that has code beginning
way up at my rom origin (0x01000000). Recall that the
AT91 resets with ROM located at 0 until remap. After
remap, I am locating it at 0x01000000.

If I change my rom origin to 0, i.e.:

    rom  : ORIGIN = 0x00000000, LENGTH = 0x200000

then I have a conflict with ram/sram which are also at
0. Catch-22.

What I need to do is burn my code (.text and .data)
into flash at pre-remap address 0 (post-remap
0x01000000), and allow the code to access my .bss at
post-remap 0, but I don't know how.

--- sensitron medical <sensitronnet@yahoo.com> wrote:
> Program is configured for ROM startup.
> 
> What GNU tools do I use to build an image suitable
> to
> directly download to flash? Can I just take my
> arm-elf-gcc generated image? I.e.:
> 
> arm-elf-gcc -o file.out ./Main/main.o -nostartfiles
> -L./eCos/Debug/lib -Ttarget.ld -mcpu=arm7tdmi
> -mno-short-load-words -Wl,--gc-sections -Wl,-static
> -g
> -nostdlib
> 
> Also, I am using ATMEL AT91 (EB40A for now, but
> proprietary board soon). On-board RAM of 256K is not
> big enough to hold my app, so I need to run from
> flash. Can you explain in a little more detail what
> Redboot buys me in this case?
> 
> 
> --- Gary Thomas <gary@mlbassoc.com> wrote:
> > On Fri, 2003-08-15 at 14:22, sensitron medical
> > wrote:
> > > I would like to build my application for flash,
> > but I
> > > use a JTAG ICE instead of Redboot. I have the
> > recipe
> > > for downloading to flash with my ICE. I need
> help
> > with
> > > the tools for building my application+ecos so
> that
> > the
> > > image can be programmed directly into flash with
> > my
> > > ICE. I am pretty sure that I can't just take my
> > > arm-elf-gcc generated image and burn it.
> > 
> > You'll need to configure your program for ROM
> > startup.
> > If this is not a standard platform, you'll also
> have
> > to port
> > eCos to the platform, taking special care in the
> MLT
> > setups
> > and hardware initialization code.
> > 
> > ICE is nice, but why not just put RedBoot into
> FLASH
> > once
> > and then develop your code?  Even if you want to
> > deploy
> > your application in FLASH only, this mode can be a
> > real
> > time saver.  Also, given RedBoot's flexibility,
> > writing
> > your application as a RAM program, loaded from
> FLASH
> > at
> > boot time could be another answer.
> > 
> > -- 
> > Gary Thomas <gary@mlbassoc.com>
> > MLB Associates
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> http://sitebuilder.yahoo.com
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


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