[ECOS] building for flash

Laurent GONZALEZ laurent.gonzalez@silicomp.fr
Wed Aug 20 06:46:00 GMT 2003


Hello,

On Tue, 19 Aug 2003 13:54:09 -0700 (PDT)
sensitron medical <sensitronnet@yahoo.com> wrote:

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

Your binary is huge because it embeeds data and text that have very different LMA (your huge file is around 16Mo, isn't it ).

When building for ROM, the data section has two adresses. LMA (into flash) should be different from LMA (into ram).
     SECTION_data (ram, 0x00001000, FOLLOWING (.gcc_except_table))

It strange that the size of the __reserved_bootmon is 0x10, IMHO it should be zero.


> 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.
No needs to do anything, the early startup of the HAL should take care of the remap command (see include/hal_platform_setup.h).

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


-- 
GONZALEZ Laurent
Silicomp Research Institute
Tel: 04 76 41 66 98

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



More information about the Ecos-discuss mailing list