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]

Re: some beginners questions



"Afzal, Naeem M" <naeem.m.afzal@intel.com> writes:
> I just received a xscale iq80310 board and have few trivial questions
> regarding this board. I am booting the board up with the default redboot
> image in the flash:
> 
> 1. Seems to be able to load only redboot.srec type image. for ELF image with
> load command fails??? say, ELF images not supported??? Does that mean I have
> to have ELF image burned in flash to load an ELF image?
> 
> 2. If I compile a hello world program and with xscale-elf-gcc -g hello.c, it
> would produce elf file. Does that mean I have to create srec file with
> xscale-elf-objcopy command to run it? but when I run it with xscale-elf-gdb
> -nw hello_srec.exe, it does not recognize the srec format. What I am missing
> here.

The answer to these two is the same: GDB uses elf images; "load" via TFTP
or ymodem uses srec (or binary, I think) images.  You can and should indeed
convert between the formats using xscale-elf-objcopy, if you want to.

You can run a program in two ways
a) using GDB (using an ELF image)
b) by loading it into RAM and jumping to it (using an SREC file)

But the program must be configured differently for these two cases - the
default is to use GDB protocol for output, so printf("Hello World\n"); will
come out as a GDB packet even if you loaded the app wioth Srecord load, and
the app will then wait for GDB to acknowledge the packet.

Use GDB to run your test program for easiest results.

Load of an SREC image is normally used to get an image into RAM prior to
writing it from RAM into flash somehow - it's not normally used for
executing an application.

> 3. Why is that on redboot command prompt, when I type `$` it hangs the
> board?

It doesn't hang the board.  It switches it to GDB stubs mode.  The board is
waiting for GDB packets to arrive.  All GDB packets start with a $.  For
example, if you type
	$c#63
that's the same as a GDB "continue" command.  This is useless unless you
have loaded a program of course, but you'll be able to see that the board
isn't hung, something else will happen - it'll be a load of hex digits and
so on on a terminal, that's the GDB protocol reporting what happened.

HTH,
	- Huge


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