[U-Boot-Users] Need Some Help

My latest endaevor has me cross compiling a stand alone application for MPC8548 PPC for a U-Boot Based target. There is no Operating System to run on the target to speak of, just my application. I'm building the application in Code Warrior using an 8548_init.S hardware intialization file.
1) My first thought was that this should be as simple as using the .ELF image that codewarrior produces, right? So I build a simple hello_world application and sent it down to my target. U-Boot recognizes it as an ELF image, sets up the segements, and tries to run it! But then low and behold, the U-Boot flash image comes up again.
=> bootelf 400000
Loading .init @ 0x00002000 (972 bytes)
Loading .text @ 0x000023d0 (7624 bytes)
Loading .rodata @ 0x00004198 (256 bytes)
Loading .ctors @ 0x00004298 (8 bytes)
Loading .dtors @ 0x000042a0 (8 bytes)
Loading extab @ 0x000042a8 (16 bytes)
Loading extabindex @ 0x000042b8 (72 bytes)
Loading .data @ 0x00004300 (1024 bytes)
Loading .sdata @ 0x00004700 (44 bytes)
Clearing .sbss @ 0x00004730 (28 bytes)
Clearing .bss @ 0x00004750 (784 bytes)
Loading .abs.00000c00 @ 0x00000c00 (244 bytes)
## Starting application at 0x00002044 ...
U-Boot 1.3.0 (Jul 21 2008 - 12:20:51)
CPU: 8548_E, Version: 2.1, (0x80390021)
Core: E500, Version: 2.2, (0x80210022)
Clock Configuration:
2) My next thought was to try and wrap it as a stand alone application image using "mkimage" Ok, Great To no avail....
$ mkimage -A ppc -O u-boot -T standalone -C none -a 2000 -e 2044 -n "Hiya stranger" -d debug.bin uDebug.bin
## Total Size = 0x00003ea0 = 16032 Bytes
=> bootm 400000
## Booting image at 00400000 ...
Image Name: Hiya stranger
Image Type: PowerPC U-Boot Standalone Program (uncompressed)
Data Size: 15968 Bytes = 15.6 kB
Load Address: 00002000
Entry Point: 00002044
Verifying Checksum ... OK
OK
**bleep**: 00000000 XER: 20000000 LR: 0FFD6378 REGS: 0ff9dc98 TRAP: 0700 DAR: 00000000
MSR: 00021200 EE: 0 PR: 0 FP: 0 ME: 1 IR/DR: 00
GPR00: 0FFD634C 0FF9DD88 00000200 00000001 0FFA048C 00000000 00005E5C 00000000
GPR08: 00000000 0FF9E00C 00000170 0FFD398C 0FF9DB70 0000C700 0FFF9A00 10040000
GPR16: 00000000 0FFEC9B4 00000000 00400040 00000001 00400000 00000000 00000001
GPR24: 0FFF52F8 0FFA0488 00000002 00002044 00400040 0FF9DF80 0FFFA2AC 00400000
** Illegal Instruction **
Call backtrace:
0FFD634C 0FFE3790 0FFE28E4 0FFE2D54 0FFD4600 0FFCABC8 0FFC162C
Program Check Exception
**bleep**: 0
How do I go about exporting my code warrior application so that I can run it as stand-alone on a U-Boot based target? Thanks so much

Please do not use HTML on this mailing list. All messages to this list must be in plain text.
Mondesir, Alshine wrote:
My latest endeavor has me cross compiling a stand alone application for > MPC8548 PPC for a U-Boot Based target. There is no Operating System to run on the target to speak of, just my application. I'm building the application in Code Warrior using an 8548_init.S hardware initialization file.
- My first thought was that this should be as
simple as using the .ELF image that codewarrior produces, right? So I build a simple hello_world application and sent it down to my target. U-Boot recognizes it as an ELF image, sets up the segments, and tries to run it! But then low and behold, the U-Boot flash image comes up again.
=> bootelf 400000
=> bootm 400000
How do I go about exporting my code warrior application so that I can run it as stand-alone on a U-Boot based target? Thanks so much
I suspect that your application is using a device or resource that neither U-Boot nor your application have properly initialized.
What is your display device for your hello_world application? Where is this device initialized?
Sincerely,
Ken Fuchs

Ken.Fuchs@bench.com wrote:
Please do not use HTML on this mailing list. All messages to this list must be in plain text.
Mondesir, Alshine wrote:
My latest endeavor has me cross compiling a stand alone application for > MPC8548 PPC for a U-Boot Based target. There is no Operating System to run on the target to speak of, just my application. I'm building the application in Code Warrior using an 8548_init.S hardware initialization file.
- My first thought was that this should be as
simple as using the .ELF image that codewarrior produces, right? So I build a simple hello_world application and sent it down to my target. U-Boot recognizes it as an ELF image, sets up the segments, and tries to run it! But then low and behold, the U-Boot flash image comes up again.
=> bootelf 400000
=> bootm 400000
How do I go about exporting my code warrior application so that I can run it as stand-alone on a U-Boot based target? Thanks so much
I suspect that your application is using a device or resource that neither U-Boot nor your application have properly initialized.
What is your display device for your hello_world application? Where is this device initialized?
Sincerely,
Ken Fuchs
...and are you (Alshine) loading your application in a valid location? I see 0x00002000 and following. I suspect those locations are used by your version of u-boot. You probably want to link your test app at 0x400000 or somewhere up high like that.
=> bootelf 400000 Loading .init @ 0x00002000 (972 bytes)
[snip]
## Starting application at 0x00002044 ...
gvb

In message 7F4C091727699947ACBAB0410268C5D92B2FDB@VS11.EXCHPROD.USA.NET you wrote:
My latest endaevor has me cross compiling a stand alone application for MPC8548 PPC for a U-Boot Based target. There is no Operating System to run on the target to speak of, just my application. I'm building the application in Code Warrior using an 8548_init.S hardware intialization file.
What has this file to do with U-Boot? Nothing! Forget about it.
- My first thought was that this should be as simple as using the .ELF
image that codewarrior produces, right? So I build a simple hello_world
I have no idea what CW produces. You should use the U-Boot Makefile and linker scripts.
application and sent it down to my target. U-Boot recognizes it as an ELF image, sets up the segements, and tries to run it! But then low and
Who says so?
behold, the U-Boot flash image comes up again.
That's to be expected.
Guess it's time for you to start reading the fine manual, especially the section about standalone applications.
Best regards,
Wolfgang Denk

Wolfgang Denk,
Thanks for the reply, but I have a few questions. The first is can U-boot load any application other than a Linux. I simply want to use u-boot as a boot loader, to load a non-Linux app into memory and jump to that app with or without uboot's hardware init. The second wuestion is where can I get some help in doing just that, if it's possible? I don't want to have to build and cross-compile my app in Linux in order for u-boot to load it. Third, if I have to compile my app in Linux, can I simply use mkimage with the hello world binary and do a bootm from that?
Thanks in adavance,
Alshine Mondesir Firmware Engineer xG Technology Inc. 7771 W. Oakland Park Blvd, Sunrise, FL 33351 Tel: 954-572-0395 ext 3323 Fax: 954-572-0397 http://www.xgtechnology.com -----Original Message----- From: wd@denx.de [mailto:wd@denx.de] Sent: Wednesday, July 23, 2008 11:18 PM To: Mondesir, Alshine Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] Need Some Help
In message 7F4C091727699947ACBAB0410268C5D92B2FDB@VS11.EXCHPROD.USA.NET you wrote:
My latest endaevor has me cross compiling a stand alone application for MPC8548 PPC for a U-Boot Based target. There is no Operating System to run on the target to speak of, just my application. I'm building the application in Code Warrior using an 8548_init.S hardware intialization file.
What has this file to do with U-Boot? Nothing! Forget about it.
- My first thought was that this should be as simple as using the .ELF
image that codewarrior produces, right? So I build a simple hello_world
I have no idea what CW produces. You should use the U-Boot Makefile and linker scripts.
application and sent it down to my target. U-Boot recognizes it as an ELF image, sets up the segements, and tries to run it! But then low and
Who says so?
behold, the U-Boot flash image comes up again.
That's to be expected.
Guess it's time for you to start reading the fine manual, especially the section about standalone applications.
Best regards,
Wolfgang Denk

In message 004a01c8f403$f1a4d590$d4ee80b0$@com you wrote:
Thanks for the reply, but I have a few questions. The first is can U-boot load any application other than a Linux.
Of course it can. If you had read the manual, you should have found the section about standalone applications. And of course it can boot a couple of other operating systems as well, which, from U-Boot's point of view, are just different applications.
I simply want to use u-boot as a boot loader, to load a non-Linux app into memory and jump to that app with or without uboot's hardware init. The
If you want to avoid U-Boot's hardware init, then run your application on the raw hardware without U-Boot. But be prepared that then you have to reinvent all the needed hardware init steps yourself.
second wuestion is where can I get some help in doing just that, if it's possible? I don't want to have to build and cross-compile my app in Linux in order for u-boot to load it. Third, if I have to compile my app in Linux, can I simply use mkimage with the hello world binary and do a bootm from that?
May I suggest that you just read the related sections in the manual? It comes with a couple of examples which show exactly what you are asking for.
Best regards,
Wolfgang Denk
participants (5)
-
Alshine Mondesir
-
Jerry Van Baren
-
Ken.Fuchs@bench.com
-
Mondesir, Alshine
-
Wolfgang Denk