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

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@softdel.com Cc: U-Boot-Users u-boot-users@lists.sourceforge.net Message-ID: 200706181720.KAA21445@unix.telasic.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Ganesh Chandra Patro wrote:
-----Original Message----- From: u-boot-users-bounces@lists.sourceforge.net [mailto:u-boot-users-bounces@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

Jude Miller wrote:
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
When I add CFG_CMD_ELF to the configuration, I get the error below. Maybe the CFG_CMD_ELF needs to be coupled with some other configuration option. Please help.
My current definition is -
#define CONFIG_COMMANDS ( \ CONFIG_CMD_DFL | \ CFG_CMD_ELF | \ CFG_CMD_MII | \ CFG_CMD_JFFS2 | \ CFG_CMD_NET | \ CFG_CMD_DHCP | \ CFG_CMD_PING \ )
The error I get is - (dcache_status & dcache_disable missing):
cd /home/abiyani/wrk/u-boot-1.2.0 && m68k-elf-ld -Bstatic -T /home/abiyani/wrk/u-boot-1.2.0/board/m5272c3/u-boot.lds -Ttext 0xfe000000 -n $UNDEF_SYM cpu/mcf52x2/start.o \ --start-group lib_generic/libgeneric.a board/m5272c3/libm5272c3.a cpu/mcf52x2/libmcf52x2.a lib_m68k/libm68k.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a rtc/librtc.a dtt/libdtt.a drivers/libdrivers.a drivers/nand/libnand.a drivers/nand_legacy/libnand_legacy.a drivers/sk98lin/libsk98lin.a post/libpost.a post/cpu/libcpu.a common/libcommon.a --end-group -L /home/local/bin/../lib/gcc/m68k-uclinux/4.1.1/m5307/msep-data -lgcc \ -Map u-boot.map -o u-boot common/libcommon.a(cmd_elf.o): In function `do_bootelf': /home/abiyani/wrk/u-boot-1.2.0/common/cmd_elf.c:62: undefined reference to `dcache_status' /home/abiyani/wrk/u-boot-1.2.0/common/cmd_elf.c:63: undefined reference to `dcache_disable' make: *** [u-boot] Error 1 [u-boot-1.2.0$:1046]

Arun Biyani wrote:
When I add CFG_CMD_ELF to the configuration, I get the error below. Maybe the CFG_CMD_ELF needs to be coupled with some other configuration option. Please help.
My current definition is -
#define CONFIG_COMMANDS ( \ CONFIG_CMD_DFL | \ CFG_CMD_ELF | \ CFG_CMD_MII | \ CFG_CMD_JFFS2 | \ CFG_CMD_NET | \ CFG_CMD_DHCP | \ CFG_CMD_PING \ )
The error I get is - (dcache_status & dcache_disable missing):
/home/local/bin/../lib/gcc/m68k-uclinux/4.1.1/m5307/msep-data -lgcc \ -Map u-boot.map -o u-boot common/libcommon.a(cmd_elf.o): In function `do_bootelf': /home/abiyani/wrk/u-boot-1.2.0/common/cmd_elf.c:62: undefined reference to `dcache_status' /home/abiyani/wrk/u-boot-1.2.0/common/cmd_elf.c:63: undefined reference to `dcache_disable' make: *** [u-boot] Error 1 [u-boot-1.2.0$:1046]
I get this error above if I add elf file support to u-boot for Coldfire processor. Looks like cmd_elf.c expects dcache_disable and dcache_status functions. Which library provides these symbol values?

try to add CFG_CMD_CACHE to the CONFIG_COMMANDS, although this options is packed with warnings in the README file
2007/6/26, at unix dot telasic dot com"@unix.telasic.com Arun Biyani <"abiyani>:
Arun Biyani wrote:
When I add CFG_CMD_ELF to the configuration, I get the error below. Maybe the CFG_CMD_ELF needs to be coupled with some other configuration option. Please help.
My current definition is -
#define CONFIG_COMMANDS ( \ CONFIG_CMD_DFL | \ CFG_CMD_ELF | \ CFG_CMD_MII | \ CFG_CMD_JFFS2 | \ CFG_CMD_NET | \ CFG_CMD_DHCP | \ CFG_CMD_PING \ )
The error I get is - (dcache_status & dcache_disable missing):
/home/local/bin/../lib/gcc/m68k-uclinux/4.1.1/m5307/msep-data -lgcc \ -Map u-boot.map -o u-boot common/libcommon.a(cmd_elf.o): In function `do_bootelf': /home/abiyani/wrk/u-boot-1.2.0/common/cmd_elf.c:62: undefined reference to `dcache_status' /home/abiyani/wrk/u-boot-1.2.0/common/cmd_elf.c:63: undefined reference to `dcache_disable' make: *** [u-boot] Error 1 [u-boot-1.2.0$:1046]
I get this error above if I add elf file support to u-boot for Coldfire processor. Looks like cmd_elf.c expects dcache_disable and dcache_status functions. Which library provides these symbol values?
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

nicky geerts wrote:
try to add CFG_CMD_CACHE to the CONFIG_COMMANDS, although this options is packed with warnings in the README file
2007/6/26, at unix dot telasic dot com"@unix.telasic.com Arun Biyani <"abiyani>:
Arun Biyani wrote:
When I add CFG_CMD_ELF to the configuration, I get the error below. Maybe the CFG_CMD_ELF needs to be coupled with some other configuration option. Please help.
My current definition is -
#define CONFIG_COMMANDS ( \ CONFIG_CMD_DFL | \ CFG_CMD_ELF | \ CFG_CMD_MII | \ CFG_CMD_JFFS2 | \ CFG_CMD_NET | \ CFG_CMD_DHCP | \ CFG_CMD_PING \ )
The error I get is - (dcache_status & dcache_disable missing):
/home/local/bin/../lib/gcc/m68k-uclinux/4.1.1/m5307/msep-data -lgcc \ -Map u-boot.map -o u-boot common/libcommon.a(cmd_elf.o): In function `do_bootelf': /home/abiyani/wrk/u-boot-1.2.0/common/cmd_elf.c:62: undefined
reference
to `dcache_status' /home/abiyani/wrk/u-boot-1.2.0/common/cmd_elf.c:63: undefined
reference
to `dcache_disable' make: *** [u-boot] Error 1 [u-boot-1.2.0$:1046]
I get this error above if I add elf file support to u-boot for Coldfire processor. Looks like cmd_elf.c expects dcache_disable and dcache_status functions. Which library provides these symbol values?
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users
Thx. That worked. Arun
participants (3)
-
Arun Biyani
-
Jude Miller
-
nicky geerts