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

I have a target board with a Coldfire CPU. I am unable to run the example program hello_world which comes with the distribution. Transcript of session is below. What am I missing? The cross compile tools were run on Linux (FC 7), downloaded from snapgear.org uClinux directory. I tried this with v1.1.6 also. I'll be glad to provide any additional data. I have just started with U-Boot so please be explicit. On the host, I was running Tera Term and used "send file" from the "File" menu to send the srec file. I ran the program with parameters as well with the same result.
U-Boot 1.2.0 (Jun 13 2007 - 07:36:11)
CPU: Freescale MCF5272 (Mask:1) Board: Telasic RLB 2.0 DRAM: 16 MB FLASH: 32 MB In: serial Out: serial Err: serial Hit any key to stop autoboot: 0 -> -> ds Unknown command 'ds' - try 'help' -> loads ## Ready for S-Record download ...
## First Load Addr = 0x00020000 ## Last Load Addr = 0x000222F7 ## Total Size = 0x000022F8 = 8952 Bytes ## Start Addr = 0x00020000 -> go 0x00020004 ## Starting application at 0x00020004 ...
*** Unexpected exception *** Vector Number: 4 Format: 04 Fault Status: 0
PC: 00ff94fc SR: 00002004 SP: 00f6db0c D0: 00000000 D1: 0000048c D2: 00000000 D3: 00ff8fac D4: 000000f3 D5: 00000000 D6: 00000000 D7: 00f7df90 A0: 00fed912 A1: 00ff94fc A2: 00020004 A3: 00f6ded8 A4: 00000002 A5: 00ff7300 A6: 00f6db8c
*** Please Reset Board! ***

In message 200706132101.OAA10296@unix.telasic.com you wrote:
I have a target board with a Coldfire CPU. I am unable to run the example program hello_world which comes with the distribution. Transcript of session is below. What am I missing? The cross compile tools were run on Linux (FC 7),
You missed to read the documentatiomn, especially the FAQ: http://www.denx.de/wiki/view/DULG/MyStandaloneProgramDoesNotWork
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
In message 200706132101.OAA10296@unix.telasic.com you wrote:
I have a target board with a Coldfire CPU. I am unable to run the example program hello_world which comes with the distribution. Transcript of session is below. What am I missing? The cross compile tools were run on Linux (FC 7),
You missed to read the documentatiomn, especially the FAQ: http://www.denx.de/wiki/view/DULG/MyStandaloneProgramDoesNotWork
Best regards,
Wolfgang Denk
On my Linux host, [examples$:1010] m68k-elf-nm hello_world 00020208 T app_startup 000222f8 A __bss_start 000201b4 T do_reset 000200ac T dummy 000222f8 A _edata 000222f8 A _end 00020164 T free 0002013c T free_hdlr 000200c4 T getc 000201c8 T getenv 0002018c T get_timer 000200b0 T get_version 000222b0 D _GLOBAL_OFFSET_TABLE_ 00020000 T hello_world <--------------- 00020128 T install_hdlr 00020150 T malloc 00020114 T printf 000200ec T putc 000200ec T putc 00020100 T puts 000201dc T setenv 000201f0 T simple_strtoul 000200d8 T tstc 00020178 T udelay 000201a0 T vprintf [examples$:1011]
----------------------------------------------------------------------------------------------------------------------------------- On my target Coldfire based board,
U-Boot 1.2.0 (Jun 13 2007 - 07:36:11)
CPU: Freescale MCF5272 (Mask:1) Board: Telasic RLB 2.0 DRAM: 16 MB FLASH: 32 MB In: serial Out: serial Err: serial Hit any key to stop autoboot: 0 -> loads ## Ready for S-Record download ...
## First Load Addr = 0x00020000 ## Last Load Addr = 0x000222F7 ## Total Size = 0x000022F8 = 8952 Bytes ## Start Addr = 0x00020000 -> go 0x00020000 ## Starting application at 0x00020000 ...
*** Unexpected exception *** Vector Number: 4 Format: 04 Fault Status: 0
PC: 00ff94fc SR: 00002000 SP: 00f6daf8 D0: 00000000 D1: 0000048c D2: 00f6ded8 D3: 00000001 D4: 000000f3 D5: 00000000 D6: 00000000 D7: 00f7df90 A0: 00fed912 A1: 00ff94fc A2: 00020000 A3: 00f6ded8 A4: 00000002 A5: 00ff7300 A6: 00f6db54
*** Please Reset Board! ***

On Wed, 2007-06-13 at 16:47, Arun Biyani wrote:
On my Linux host, [examples$:1010] m68k-elf-nm hello_world 00020208 T app_startup
Perhaps 20208 (app_startup) might be worth trying as an entry point...
-> go 0x00020000
As in:
-> go 20208
Maybe app_startup is a wrapper for main. Just a guess.
Often times systems have entry points like _start, etc which set things up and then jump to main.
-Lee

Lee Nipper wrote:
On Wed, 2007-06-13 at 16:47, Arun Biyani wrote:
On my Linux host, [examples$:1010] m68k-elf-nm hello_world 00020208 T app_startup
Perhaps 20208 (app_startup) might be worth trying as an entry point...
-> go 0x00020000
As in:
-> go 20208
Maybe app_startup is a wrapper for main. Just a guess.
Often times systems have entry points like _start, etc which set things up and then jump to main.
-Lee
Thx, Lee. Still didn't work. Transcript below. At least a graceful exit.
How do I ensure there is enough stack space to run applications?
-> loads ## Ready for S-Record download ...
## First Load Addr = 0x00020000 ## Last Load Addr = 0x000222F7 ## Total Size = 0x000022F8 = 8952 Bytes ## Start Addr = 0x00020000 -> go 20208 ## Starting application at 0x00020208 ... ## Application terminated, rc = 0xFF8454 -> go 20208 Hello there try this ## Starting application at 0x00020208 ... ## Application terminated, rc = 0xFF8454 ->

In message 1181772566.29103.151.camel@al08linux99 you wrote:
Perhaps 20208 (app_startup) might be worth trying as an entry point...
No, definitely not.
Maybe app_startup is a wrapper for main. Just a guess.
Don't guess. Read documentation and source code instead.
Often times systems have entry points like _start, etc which set things up and then jump to main.
Please have at least a tiny glance at the code before coming up with bogus comments.
Best regards,
Wolfgang Denk

In message 200706132147.OAA13240@unix.telasic.com you wrote:
-> loads ## Ready for S-Record download ...
Which exact file did you download here?
Can you please dump the first 100 bytes or so of this file under Linux (for example using xxd), and then...
## First Load Addr = 0x00020000 ## Last Load Addr = 0x000222F7 ## Total Size = 0x000022F8 = 8952 Bytes ## Start Addr = 0x00020000
...type "md 20000" here before trying to start the image?
-> go 0x00020000 ## Starting application at 0x00020000 ...
Eventually you did not download the binary image?
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
In message 200706132147.OAA13240@unix.telasic.com you wrote:
-> loads ## Ready for S-Record download ...
Which exact file did you download here?
Can you please dump the first 100 bytes or so of this file under Linux (for example using xxd), and then...
Output of "xxd < hello_world.srec": *0000000: 5330 3133 3030 3030 3638 3635 3643 3643 S013000068656C6C 0000010: 3646 3546 3737 3646 3732 3643 3634 3245 6F5F776F726C642E 0000020: 3733 3732 3635 3633 3736 0d0a 5332 3134 7372656376..S214 0000030: 3032 3030 3030 3445 3536 4646 4630 3438 0200004E56FFF048 0000040: 4437 3234 3043 3236 3245 3030 3038 3234 D7240C262E000824 0000050: 3245 3030 3043 3444 0d0a 5332 3134 3032 2E000C4D..S21402 0000060: 3030 3130 3246 3032 3232 3644 3030 3343 00102F02226D003C 0000070: 3445 3931 3438 3738 3030 3033 3246 3244 4E91487800032F2D 0000080: 3030 3043 4433 0d0a 5332 3134 3032 3030 000CD3..S2140200 0000090: 3230 3232 3644 3030 3243 3445 3931 3232 20226D002C4E9122 00000a0: 3644 3030 3434 3445 3931 3246 3030 3246 6D00444E912F002F 00000b0: 3244 4632 0d0a 5332 3134 3032 3030 3330 2DF2..S214020030 00000c0: 3030 3130 3232 3644 3030 3243 3445 3931 0010226D002C4E91 00000d0: 3246 3244 3030 3134 3232 3644 3030 3243 2F2D0014226D002C 00000e0: 4534 0d0a 5332 3134 3032 3030 3430 3445 E4..S2140200404E 00000f0: 3931 3246 3033 3246 3244 3030 3138 3232 912F032F2D001822 0000100: 3644 3030 3243 3445 3931 3234 3432 3234 6D002C4E91244224 0000110: 0d0a 5332 3134 3032 3030 3530 3432 3832 ..S2140200504282 0000120: 3446 4546 3030 3230 3630 3145 3230 3132 4FEF0020601E2012 0000130: 3636 3034 3230 3244 3030 3143 4634 0d0a 6604202D001CF4.. 0000140: 5332 3134 3032 3030 3630 3246 3030 3246 S2140200602F002F 0000150: 3032 3246 3244 3030 3230 3232 3644 3030 022F2D0020226D00 0000160: 3243 3445 3931 3532 3832 3346 0d0a 5332 2C4E9152823F..S2 0000170: 3134 3032 3030 3730 3538 3841 3446 4546 14020070588A4FEF 0000180: 3030 3043 4236 3832 3643 4445 3246 3244 000CB6826CDE2F2D
*
## First Load Addr = 0x00020000 ## Last Load Addr = 0x000222F7 ## Total Size = 0x000022F8 = 8952 Bytes ## Start Addr = 0x00020000
...type "md 20000" here before trying to start the image?
See Below for transcript. Board hangs after go command.
-> go 0x00020000 ## Starting application at 0x00020000 ...
Eventually you did not download the binary image?
I have not tried binary yet.
Best regards,
Wolfgang Denk
U-Boot 1.1.6 (Jun 5 2007 - 07:23:45)
CPU: Freescale MCF5272 (Mask:1) Board: Telasic RLB 2.0 (Arun Biyani) DRAM: 16 MB Reserving 135k for U-Boot at: 00fde000 Reserving 256k for malloc() at: 00f9e000 Reserving 64 Bytes for Board Info at: 00f9dfc0 Reserving 48 Bytes for Global Data at: 00f9df90 Reserving 64k for boot parameters at: 00f8df90 Stack Pointer at: 00f8df78 Start relocate of code from fe000400 to 00fde000 Now running in RAM - U-Boot at: 00fde000 FLASH: flash_protect ON: from 0xFE000000 to 0xFE03FFFF protect on 0 protect on 1 32 MB *** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial U-Boot relocated to 00fde000 ### main_loop entered: bootdelay=5
### main_loop: bootcmd="<UNDEFINED>" -> loads ## Ready for S-Record download ...
## First Load Addr = 0x00020000 ## Last Load Addr = 0x000222F7 ## Total Size = 0x000022F8 = 8952 Bytes ## Start Addr = 0x00020000 -> md 20000 00020000: 4e56fff0 48d7240c 262e0008 242e000c NV..H.$.&...$... 00020010: 2f02226d 003c4e91 48780003 2f2d000c /."m.<N.Hx../-.. 00020020: 226d002c 4e91226d 00444e91 2f002f2d "m.,N."m.DN././- 00020030: 0010226d 002c4e91 2f2d0014 226d002c .."m.,N./-.."m., 00020040: 4e912f03 2f2d0018 226d002c 4e912442 N././-.."m.,N.$B 00020050: 42824fef 0020601e 20126604 202d001c B.O.. `. .f. -.. 00020060: 2f002f02 2f2d0020 226d002c 4e915282 /././-. "m.,N.R. 00020070: 588a4fef 000cb682 6cde2f2d 0024226d X.O.....l./-.$"m 00020080: 002c4e91 588f226d 00344e91 4a8067f6 .,N.X."m.4N.J.g. 00020090: 226d0030 4e912f2d 0028226d 002c4e91 "m.0N./-.("m.,N. 000200a0: 42804cee 240cfff0 4e5e4e75 4e560000 B.L.$...N^NuNV.. 000200b0: 2047d1fc 0000002c 2050d1fc 00000000 G....., P...... 000200c0: 20504ed0 2047d1fc 0000002c 2050d1fc PN. G....., P.. 000200d0: 00000004 20504ed0 2047d1fc 0000002c .... PN. G....., 000200e0: 2050d1fc 00000008 20504ed0 2047d1fc P...... PN. G.. 000200f0: 0000002c 2050d1fc 0000000c 20504ed0 ..., P...... PN. -> go 20000 Hello There ## Starting application at 0x00020000 ...

I tried to build u-boot under Cygwin. It failed with error message below. Although not critical since I can always build it on Linux, I'd still like to find out how to fix error below . Looks like the compiles were all successful. Only the last link step failed. Perhaps, I need newer cross compile toolchain. Does anyone know where I can download a pre-built cross compile toolchain for 68k running under Cygwin?
cd /c/home/wrk/u-boot-1.2.0 && m68k-elf-ld -Bstatic -T /c/home/wrk/u-boot-1.2.0/board/m5272c3/u-boot.lds -Ttext 0xffe00000 -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 /bin/../lib/gcc-lib/m68k-elf/3.4.0/m5307 -lgcc \ -Map u-boot.map -o u-boot m68k-elf-ld: internal error /usr/src/xtools-3.4w/ld/ldlang.c 1974 make: *** [u-boot] Error 1 [u-boot-1.2.0$:523]

Arun Biyani wrote:
I tried to build u-boot under Cygwin. It failed with error message below. Although not critical since I can always build it on Linux, I'd still like to find out how to fix error below . Looks like the compiles were all successful. Only the last link step failed. Perhaps, I need newer cross compile toolchain. Does anyone know where I can download a pre-built cross compile toolchain for 68k running under Cygwin?
cd /c/home/wrk/u-boot-1.2.0 && m68k-elf-ld -Bstatic -T
/c/home/wrk/u-boot-1.2.0/board/m5272c3/u-boot.lds -Ttext 0xffe00000 -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 /bin/../lib/gcc-lib/m68k-elf/3.4.0/m5307 -lgcc \ -Map u-boot.map -o u-boot m68k-elf-ld: internal error /usr/src/xtools-3.4w/ld/ldlang.c 1974 make: *** [u-boot] Error 1 [u-boot-1.2.0$:523]
I updated my cross compile tools (in Cygwin) to gcc 4.1.1. Now u-boot builds successfully under Cygwin.

Wolfgang Denk wrote:
Eventually you did not download the binary image?
Best regards,
Wolfgang Denk
This morning, I also tried to run the .bin file (hello_world.bin). U-Boot just hung up. Current status is, the hello_world program in the distribution (unmodified) does not run on Coldfire based board. I tried this on our target board as well as a CSB360 board from Cogent Computers. I tried both the hello_world.srec file and the hello_world.bin file.
Any ideas as to what I can do to make simple applications run in U-Boot on Coldfire? Has anyone else tried this?
Thx

-----Original Message----- From: u-boot-users-bounces@lists.sourceforge.net [mailto:u-boot-users-bounces@lists.sourceforge.net]On Behalf Of Arun Biyani Sent: 15 June, 2007 Friday 11:00 PM To: Wolfgang Denk Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] U-Boot 1.2 - Cannot run hello_world - Coldfire
Wolfgang Denk wrote:
Eventually you did not download the binary image?
Best regards,
Wolfgang Denk
This morning, I also tried to run the .bin file (hello_world.bin). U-Boot just hung up. Current status is, the hello_world program in the distribution (unmodified) does not run on Coldfire based board. I tried this on our target board as well as a CSB360 board from Cogent Computers. I tried both the hello_world.srec file and the hello_world.bin file.
Any ideas as to what I can do to make simple applications run in U-Boot on Coldfire? Has anyone else tried this?
Thx
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 SoftDel Systems Ltd "ACROPOLIS", 2nd Floor Marol Maroshi Military Road Andheri(East) Mumbai - 400 059

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 Biyani Sent: 15 June, 2007 Friday 11:00 PM To: Wolfgang Denk Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] U-Boot 1.2 - Cannot run hello_world - Coldfire
Wolfgang Denk wrote:
Eventually you did not download the binary image?
Best regards,
Wolfgang Denk
This morning, I also tried to run the .bin file (hello_world.bin). U-Boot just hung up. Current status is, the hello_world program in the distribution (unmodified) does not run on Coldfire based board. I tried this on our target board as well as a CSB360 board from Cogent Computers. I tried both the hello_world.srec file and the hello_world.bin file.
Any ideas as to what I can do to make simple applications run in U-Boot on Coldfire? Has anyone else tried this?
Thx
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 SoftDel Systems Ltd "ACROPOLIS", 2nd Floor Marol Maroshi Military Road Andheri(East) Mumbai - 400 059
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
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
participants (4)
-
Arun Biyani
-
Ganesh Chandra Patro
-
Lee Nipper
-
Wolfgang Denk