[U-Boot-Users] U-Boot 1.2 - Cannot run hello_world

Jude Miller judemiller at alum.mit.edu
Tue Jun 19 16:24:55 CEST 2007


> Message: 2
> Date: Mon, 18 Jun 2007 10:20:15 -0700
> From: Arun Biyani <"abiyani at unix dot telasic dot
> 	com"@unix.telasic.com>
> Subject: Re: [U-Boot-Users] U-Boot 1.2 - Cannot run hello_world -
> 	Coldfire
> To: ganesh.patro at softdel.com
> Cc: U-Boot-Users <u-boot-users at lists.sourceforge.net>
> Message-ID: <200706181720.KAA21445 at unix.telasic.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Ganesh Chandra Patro wrote:
> 
>>-----Original Message-----
>>From: u-boot-users-bounces at lists.sourceforge.net
>>[mailto:u-boot-users-bounces at lists.sourceforge.net]On Behalf Of Arun
>>Hi Arun,
>>There is a specific way to run a bin file. First you have to load to a
>>specific memory location let's say 0x2000. You have find the entry point
>>address of the bin from it's symbol table and assuming the flash start
>>address of the bin file 0, add 0x2000 to know the entry point address of the
>>bin in the memory just loaded. Now say go "address" on the CLI. The program
>>will run. Every time you load to a different address you need to find the
>>actual physical address. That's why loading an ELF is easier than a bin from
>>CLI. The same bin or srec can be burnt and run from the flash, but running a
>>bin would involve this much to do be done.
>>
>>Thanks and Regards
>>
>>Ganesh Chandra Patro
> 
> Ganesh, Thx for your response.
> 
> The program "hello_world" is part of the release package. I've verified that
> the entry point is indeed "0x20000". So, the problem is something else. 
> Can anyone think of what else
> might be the cause? I have 2-3 previous posts on the same subject.
> 
> The documentation does not talk about running "elf" files. Could someone 
> give me a basic intro?
> Arun

First check that your U-Boot implements the bootelf command, e.g. by typing
it on the command line. If it is not found, add CFG_CMD_ELF to your U-Boot
commands and rebuild U-Boot, e.g.

    #define CONFIG_COMMANDS (CONFIG_CMD_DFL | CONFIG_CMD_ELF)
    make
    <re-install U-Boot>

Now, get the ELF file into memory somewhere NOT where it is linked. I use
tftpboot, but you could also burn it somewhere in your Flash. Use the bootelf
command to run it. For example,

    tftpboot <somewhere> hello_world
    bootelf <somewhere>

Maybe 30000 is a good value for <somewhere> for your board. The address is
the place in memory where the bootelf command reads the ELF file in order
to load it to the address it is linked with. This is why it must be somewhere
that won't be overwritten when it is loaded by bootelf.

Good luck,

Jude Miller





More information about the U-Boot mailing list