Skip to contentSkip to conversation

Problem executing hello world as specified on wiki

U-Boot Vipul Jain 2 participants 7 messages Feb 21, 2010 – Feb 23, 2010 1 message not in the archive

lore
Share & tools
lore

Vipul Jain

author
#0 lore raw

Hello U-Boot alias,

I am trying to execute the standlone examples of hello world by following
the steps
specified at the U-Boot wiki but have no success. This is what I am getting.

Method 1:
---------------
EDB9302> tftp 40000 /tftpboot/hello_world.srec
Using ep93xx_eth-0 device
TFTP from server 192.168.15.6; our IP address is 192.168.15.15 Filename '/tftpboot/hello_world.srec'.
Load address: 0x40000
Loading: #
done
Bytes transferred = 1916 (77c hex)
EDB9302> go 40004
## Starting application at 0x00040004 ...

<nothing just hung>

Method 2:
----------------
EDB9302> tftp 40000 /tftpboot/hello_world.bin
Using ep93xx_eth-0 device
TFTP from server 192.168.15.6; our IP address is 192.168.15.15 Filename '/tftpboot/hello_world.bin'.
Load address: 0x40000
Loading: #
done
Bytes transferred = 616 (268 hex)
EDB9302> go 40004
## Starting application at 0x00040004 ... ?????????????????????????????????????
<some garbage>

Method 3:
EDB9302> loadb 0x100000
## Ready for binary (kermit) download to 0x00100000 at 115200 bps...

(Back at Gladiator)
----------------------------------------------------
(./) C-Kermit>send /tftpboot/hello_world (./) C-Kermit>connect
Connecting to /dev/ttyUSB0, speed 115200
Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back, or followed by ? to see other options.
----------------------------------------------------
Total Size = 0x0000937c = 37756 Bytes
## Start Addr = 0x00100000
EDB9302> go 0x00100000
## Starting application at 0x00100000 ... undefined instruction

pc : [<0010001c>]       lr : [<05706e50>]

sp : 0567fe4c ip : fffffffe fp : 00000001
r10: 056a01d8 r9 : 00000000 r8 : 0567ffe0
r7 : 00000000 r6 : 00000002 r5 : 056a028c r4 : 00100000
r3 : 00100000 r2 : 056a028c r1 : 056a028c r0 : 0008000c
Flags: nZCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...

resetting ...

Please help me, how can I test simple hello world program like this on U-Boot.

Regards,
Vipul.

#1 lore raw

Dear Vipul Jain,

Quoted 4 lines · In message <[email protected]> you…

I am trying to execute the standlone examples of hello world by following
the steps
specified at the U-Boot wiki but have no success. This is what I am getting.

You must not just follow the steps without thinking.

Quoted 3 lines

Method 1:
---------------
EDB9302> tftp 40000 /tftpboot/hello_world.srec

What makes you think this is the correct download address?

Quoted 1 line

Using ep93xx_eth-0 device

ep93xx? Sounds line an ARM system to me. Are you sure you have RAM at this address, and that this is the correct address for this standalone app?

Quoted 2 lines

EDB9302> loadb 0x100000
## Ready for binary (kermit) download to 0x00100000 at 115200 bps...

What makes you think this is the correct download address?

Quoted 2 lines

Please help me, how can I test simple hello world program like this on U-Boot.

Well, if you continue trying random addresses you will probably continue getting random results.

Please read the FAQ:
http://www.denx.de/wiki/view/DULG/MyStandaloneProgramDoesNotWork

Then think about your sytem, nd check the load and entry point addresses.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Inside every old person is a young person wondering what happened.
                              - Terry Pratchett, _Moving Pictures_
author
#2 lore raw

Hi Wolfgang,

I am totally newbie in u-boot who is trying to learn how to write/execute
standlone application
and as to start with learning I just blankly followed the steps I found on U-Boot twiki and on google. I
personally don't know what those address mean. But would be very kind of you if you could please
kindly help me understand what's the right way to learn which address to use and or how can I
find this out?

You are correct I am using EDB9302 motherboard which is based on ARM920T processsor.
Please kindly help me.

Regards,
Vipul.

Quoted 48 lines · Wolfgang Denk

Dear Vipul Jain,

In message <[email protected]> you

Quoted 2 lines · wrote:

I am trying to execute the standlone examples of hello world by

following

Quoted 2 lines

the steps
specified at the U-Boot wiki but have no success. This is what I am

getting.

You must not just follow the steps without thinking.

Quoted 3 lines

Method 1:
---------------
EDB9302> tftp 40000 /tftpboot/hello_world.srec

What makes you think this is the correct download address?

Quoted 1 line

Using ep93xx_eth-0 device

ep93xx? Sounds line an ARM system to me. Are you sure you have RAM at this address, and that this is the correct address for this standalone app?

Quoted 2 lines

EDB9302> loadb 0x100000
## Ready for binary (kermit) download to 0x00100000 at 115200 bps...

What makes you think this is the correct download address?

Quoted 2 lines

Please help me, how can I test simple hello world program like this on U-Boot.

Well, if you continue trying random addresses you will probably continue getting random results.

Please read the FAQ:
http://www.denx.de/wiki/view/DULG/MyStandaloneProgramDoesNotWork

Then think about your sytem, nd check the load and entry point addresses.

Best regards,

Wolfgang Denk

author
#3 lore raw

Hi Wolfgang,

Some of the things that I have tried and would like to share with you.

1. I read doc/README.standalone and it does mention default load addr and start addr
of standalone application for various architecture.
[Snippet]
4. The default load and start addresses of the applications are as

      follows:

                      Load address    Start address
    x86              0x00040000  0x00040000
    PowerPC     0x00040000  0x00040004
    ARM            0x0c100000  0x0c100000
    MIPS           0x80200000  0x80200000
    Blackfin       0x00001000  0x00001000

[end of snippet]

2. as mine is ARM, I know that only file I am interested in is examples/standalone/hello_world
why? because its in ARM ELF format.
vipul at Gladiator:~/World/u-boot$ file examples/standalone/hello_world
examples/standalone/hello_world: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped

3. Now that I know the load addr, start addr and right hello_world file to use, I did the following

EDB9302> tftp 0x0c100000 /tftpboot/hello_world
Using ep93xx_eth-0 device
TFTP from server 192.168.15.6; our IP address is 192.168.15.15 Filename '/tftpboot/hello_world'.
Load address: 0xc100000
Loading: ########
done
Bytes transferred = 37756 (937c hex)
EDB9302> go 0x0c100000

4. Result. I still see a panic. I am not sure what part I am missing. I was wondering if you could provide
your kind guidance.

Regards,
Vipul.

Quoted 72 lines · Vipul Jain

Hi Wolfgang,

I am totally newbie in u-boot who is trying to learn how to
write/execute standlone application
and as to start with learning I just blankly followed the steps I found on U-Boot twiki and on google. I
personally don't know what those address mean. But would be very kind of you if you could please
kindly help me understand what's the right way to learn which address to use and or how can I
find this out?

You are correct I am using EDB9302 motherboard which is based on ARM920T processsor.
Please kindly help me.

Regards,
Vipul.

Quoted 48 lines · Wolfgang Denk

Dear Vipul Jain,

In message <[email protected]>

Quoted 2 lines · you

I am trying to execute the standlone examples of hello world by

following

Quoted 2 lines

the steps
specified at the U-Boot wiki but have no success. This is what I am

getting.

You must not just follow the steps without thinking.

Quoted 3 lines

Method 1:
---------------
EDB9302> tftp 40000 /tftpboot/hello_world.srec

What makes you think this is the correct download address?

Quoted 1 line

Using ep93xx_eth-0 device

ep93xx? Sounds line an ARM system to me. Are you sure you have RAM at this address, and that this is the correct address for this standalone app?

Quoted 2 lines

EDB9302> loadb 0x100000
## Ready for binary (kermit) download to 0x00100000 at 115200 bps...

What makes you think this is the correct download address?

Quoted 2 lines

Please help me, how can I test simple hello world program like this on U-Boot.

Well, if you continue trying random addresses you will probably continue getting random results.

Please read the FAQ:
http://www.denx.de/wiki/view/DULG/MyStandaloneProgramDoesNotWork

Then think about your sytem, nd check the load and entry point addresses.

Best regards,

Wolfgang Denk

#4 lore raw

Dear Vipul Jain,

Quoted 2 lines · In message <[email protected]> you…

Some of the things that I have tried and would like to share with you.

Please re-read the documentation, carefully.

Quoted 3 lines

2. as mine is ARM, I know that only file I am interested in is examples/standalone/hello_world
why? because its in ARM ELF format.

Wrong. The "go" command expects a raw binary image, it cannot handle ELF files.

Quoted 2 lines

3. Now that I know the load addr, start addr and right hello_world file to use, I did the following

Wrong. You do not know, you assume. And probably your assumpions are wrong. You must CHECK if your assumptions are correct. Check the linker command that was used to link your program. Follow the advice in the FAQ to determine the entry point address.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In general, they do what you want, unless you want consistency.
                                    - Larry Wall in the perl man page
author
#5 lore raw

Hi Wolfgang,

Thanks for your kind guidance, I just want to rephrase my understanding as your guidance.

1. The file that I want to build should be raw binary file like we have u-boot.bin
2. Find out right address to load the binary file as per board.

Is this correct? If yes, I have a very limited knowledge of u-boot and hence was wondering
if you could please help provide the right steps to follow.

I read the following document but it does not talk about compilation of the program or looking
at any specific linker file for the right address, but infact, about how functions are exported to
standalone program.
1. doc/README.standalone

2. About building the raw binary file.
To my understanding when you build the U-Boot the standalone apps gets
build as part of it. Hence
I am not sure, how can I build the raw file for my ARM board. I could
only see 3 hello world related
binaries that are getting build and I choose hello_world just because
after doing file hello_world* I
could see hello_world file outputs some thing like
file ../examples/standalone/hello_world*
../examples/standalone/hello_world: ELF 32-bit LSB executable, ARM,
version 1 (SYSV), statically linked, not stripped

../examples/standalone/hello_world.bin:   SysEx File - Kawai
../examples/standalone/hello_world.c:     ASCII C program text
../examples/standalone/hello_world.o:     ELF 32-bit LSB relocatable, ARM,

version 1 (SYSV), not stripped ../examples/standalone/hello_world.srec: Motorola S-Record; binary data in text format

and hence I believed its my target. I will be really very thankful if you can help me in this learning of mine.

Please, suggest me documentation/files to look/ anything else that can help me in getting hello world on
my ARM EDB9302 mother board.

Regards,
Vipul.

Quoted 36 lines · Wolfgang Denk

Dear Vipul Jain,

In message <[email protected]>

Quoted 2 lines · you

Some of the things that I have tried and would like to share with you.

Please re-read the documentation, carefully.

Quoted 3 lines

2. as mine is ARM, I know that only file I am interested in is examples/standalone/hello_world
why? because its in ARM ELF format.

Wrong. The "go" command expects a raw binary image, it cannot handle ELF files.

Quoted 1 line

3. Now that I know the load addr, start addr and right hello_world file

to

Quoted 1 line

use, I did the following

Wrong. You do not know, you assume. And probably your assumpions are wrong. You must CHECK if your assumptions are correct. Check the linker command that was used to link your program. Follow the advice in the FAQ to determine the entry point address.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de In general, they do what you want, unless you want consistency.
- Larry Wall in the perl man page

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

Dear Vipul Jain,

please do not top post / full quote. Please read
http://www.netmeister.org/news/learn2quote.html

Please always post plain text only, no HTML ever.

And please keep the mailing list on Cc:

Quoted 6 lines · In message <[email protected]> you…

when I captured the make output for u-boot which as part of buildiing u=boot.bin also builds standalone examples, this is what I noticed.

arm-linux-ld -g -Ttext 0xc100000 \
            -o hello_world -e hello_world hello_world.o libstubs.a \

OK, so you know your text address is 0xc100000.

Quoted 1 line

In lib_arm/config.mk I could see code that says

...

Quoted 9 lines

ifeq ($(BOARD),omap2420h4)
STANDALONE_LOAD_ADDR = 0x80300000
else
ifeq ($(SOC),omap3)
STANDALONE_LOAD_ADDR = 0x80300000
else
STANDALONE_LOAD_ADDR = 0xc100000
endif
endif

Here you can see where the number above is actually coming from.

Quoted 2 lines

Do I need to add one more case here specifically for EDB9203 board. if yes, can you please suggest

Why would you want to do that? What makes you think 0xc100000 would not be a suitable address for your system?

In previous postings you showed that you were able to TFTP your image to this address just fine.

In those examples you downloaded the ELF image, but we explained you that this does not work with the "go" ommand, and that you have to use the binary image (.bin) instead - as documented.

You also tried to start it right at the download address, but I also pointed you to the entry in the FAQ which explains that the actual entry point address might be elsewhere, and how you can find it.

Did you read this documentation? Did you attempt to try following the many hints you received?

If you got stuck on that way then please feel free to ask again (on the list), but please show that you at least attempted to do what you have been told.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q:  Do you know what the death rate around here is?
A:  One per person.