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: EB40a: Linking application for flash


I have done everything as you suggest, but get the same result.
However, I realize that the linking is not the problem since objdump
(disassable) is saying that the code starts at address 0x1040000 as
expected.

The problem arises when I try to load the file to the external memory before
flashing. I do the following (RedbootROM is running):

RedBoot> load -r -m ymodem -b 0x2000000
(use minicom/ymodem to load the ecosROM file a.out)
RedBoot> dump -b 0x2000000 -l 0x200 -4

The expected file content is not showing up, but if I change the dump
address to 0x2008000 I find what I expect.
(If I try to write the external ram contents from 0x2000000 onwards into the
flash, the program will not start.)

If I do the same (loading to external ram) for an ecos application linked
for the external RAM, the dump command is giving we what I expect (program
located at address 0x2000000)

Any suggestions for the difference?

Ketil

-----Original Message-----
From: Øyvind Harboe
To: 'Ketil Harald Ruud'; ecos-discuss@sources.redhat.com
Sent: 7/10/03 9:00 AM
Subject: RE: EB40a: Linking application for flash  

>I'm making a hello world application to be flashed at address 0x1040000

>(above my redbootROM which is running).  For an unknown reason I get 
>an unexpected offset of 0x8000 in the .text section. According to the 
>header section (arm-elf-objdump -h), the .text should start at 
>address 0x1040000, but when displaying the code using the redboot 
>dump command, the code is located at address 0x1048040.
>
>I also see in the header section that there is a "file offset" 
>field that is saying 0x8000, but where does this offset come from?
>
>Can anybody give an explanation for the strange offset? 

I've done this(albeit running my app from 0x102000, and it ran
fine.

I see a file offset of 0x8040 for the .text session, but I'm
not familiar with what it means.

Does your app run?

Here's what I did(AFAICR):

- ecosconfig new eb40a default
- modify ecos.ecc to a romapp (either via the GUI or modifying ecos.ecc
directly)
- ecosconfig tree
- copy the two attached files to install/include/pkgconf/
- compile my app


$ arm-elf-objdump -h rimi.elf

rimi.elf:     file format elf32-littlearm

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .debug_aranges 000021c8  00000000  00000000  0005cf20  2**0
                  CONTENTS, READONLY, DEBUGGING
  1 .debug_pubnames 00005789  00000000  00000000  0005f0e8  2**0
                  CONTENTS, READONLY, DEBUGGING
  2 .debug_info   000b81d1  00000000  00000000  00064871  2**0
                  CONTENTS, READONLY, DEBUGGING
  3 .debug_abbrev 000117fb  00000000  00000000  0011ca42  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_line   00021249  00000000  00000000  0012e23d  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_frame  00005b00  00000000  00000000  0014f488  2**2
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_str    0000bdf8  00000000  00000000  00154f88  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .rom_vectors  00000040  01020000  01020000  00008000  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  8 .text         0004d9ec  01020040  01020040  00008040  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  9 .fini         00000000  0106da2c  0106da2c  00160d80  2**0
                  CONTENTS
 10 .rodata       000008cc  0106da2c  0106da2c  00055a2c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 11 .rodata1      00000000  0106e2f8  0106e2f8  00160d80  2**0
                  CONTENTS
 12 .fixup        00000000  0106e2f8  0106e2f8  00160d80  2**0
                  CONTENTS
 13 .gcc_except_table 000004e8  0106e2f8  0106e2f8  000562f8  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 14 .fixed_vectors 00000140  00000020  00000020  00160d80  2**5
                  CONTENTS, READONLY
 15 .data         00000f20  00004000  0106e7e0  0005c000  2**2
                  CONTENTS, ALLOC, LOAD, CODE
 16 .bss          00004cc4  00004f20  00004f20  00004f20  2**5
                  ALLOC
 17 .debug_ranges 00000448  00000000  00000000  00160ec0  2**0
                  CONTENTS, READONLY, DEBUGGING

 <<mlt_arm_at91_eb40a_rom.ldi>>  <<mlt_arm_at91_eb40a_rom.h>> 

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