All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] Unable to run hello_world
@ 2004-10-08 16:18 Jim McNamara
  2004-10-08 18:20 ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: Jim McNamara @ 2004-10-08 16:18 UTC (permalink / raw)
  To: u-boot

Hi all,

I'm working on an mcf5272 based board that has 32MB of Flash arranged in
uniform sectors of 64KB and 16MB of SDRAM.

I've managed to get u-boot to start from Flash and successfully relocate to
SDRAM. Below is the debug output from the console:

DRAM:  16 MB
Reserving 217k for U-Boot at: 00fc9000
Reserving 256k for malloc() at: 00f89000
Reserving 64 Bytes for Board Info at: 00f88fc0
Reserving 48 Bytes for Global Data at: 00f88f90
Reserving 64k for boot parameters at: 00f78f90
Stack Pointer at: 00f78f78
Start relocate of code from fe000400 to 00fc9000
Now running in RAM - U-Boot at: 00fc9000
FLASH: flash_protect ON: from 0xFE000000 to 0xFE03FFFF
protect on 0
protect on 1
protect on 2
protect on 3
32 MB
In:    serial
Out:   serial
Err:   serial
U-Boot relocated to 00fc9000
No PHY device found.
### main_loop entered: bootdelay=5

### main_loop: bootcmd="<UNDEFINED>"

I've configured the hello_world example program to run from SDRAM at
0x40000. Here's a dump of the elf headers:

hello_world:     file format elf32-m68k

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         000001de  00040000  00040000  00002000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .rodata       0000008a  000401de  000401de  000021de  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .data         00000000  00042268  00042268  00002268  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  3 .got          00000048  00042268  00042268  00002268  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  4 .bss          00000000  000422b0  000422b0  000022b0  2**2
                  ALLOC
  5 .stab         00000e40  00000000  00000000  000022b0  2**2
                  CONTENTS, READONLY, DEBUGGING
  6 .stabstr      00001d3a  00000000  00000000  000030f0  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .comment      0000014c  00000000  00000000  00004e2a  2**0
                  CONTENTS, READONLY

I can load the resultant binary using the loadb command but an exception is
generated when I attempt to run the program:

-> loadb
## Ready for binary (kermit) download to 0x00040000 at 19200 bps...
## Total Size      = 0x000022b0 = 8880 Bytes
## Start Addr      = 0x00040000
-> go 40004
## Starting application at 0x00040004 ...


*** Unexpected exception ***
Vector Number: 4  Format: 04  Fault Status: 0

PC: 00ff97b8    SR: 00002004    SP: 00f78c20
D0: 00000004    D1: 000006d0    D2: 00ffa12c    D3: 00000000
D4: 00000000    D5: 00000000    D6: 00000001    D7: 00f88f90
A0: 00ff97b8    A1: 00fe9fc8    A2: 00040004    A3: 00000000
A4: 00f78ce0    A5: 00ff8500    A6: 00f78cac

*** Please Reset Board! ***

I had a look at what's going on with the debugger - hello_world is jumping
to an incorrect address (0xff97b8). This happens at the very start of the
program.

I've read through the README and DULG I've scoured the mailing list archive.
I still haven't been able to come up with a solution. Any ideas as to what I
could be doing wrong??

Thanks for any help you can give.

Regards,
Jim...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] Unable to run hello_world
  2004-10-08 16:18 [U-Boot-Users] Unable to run hello_world Jim McNamara
@ 2004-10-08 18:20 ` Wolfgang Denk
  2004-10-11 16:06   ` Jim McNamara
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2004-10-08 18:20 UTC (permalink / raw)
  To: u-boot

In message <PKEEJGHDPBIDKDLLBHPIAEKBCBAA.jmcnamara@kimble.ie> you wrote:
> 
> I can load the resultant binary using the loadb command but an exception is
> generated when I attempt to run the program:
...
> I had a look at what's going on with the debugger - hello_world is jumping
> to an incorrect address (0xff97b8). This happens at the very start of the
> program.

This probably means that the stub code which exports U-Boot functions
for use in stanbdalone applications is  incorrect  and/or  incomplete
for your platform.

> I've read through the README and DULG I've scoured the mailing list archive.
> I still haven't been able to come up with a solution. Any ideas as to what I
> could be doing wrong??

Please see doc/README.standalone and  check  the  implementation  for
your arch.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
To be a winner, all you need to give is all you have.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] Unable to run hello_world
  2004-10-08 18:20 ` Wolfgang Denk
@ 2004-10-11 16:06   ` Jim McNamara
  0 siblings, 0 replies; 5+ messages in thread
From: Jim McNamara @ 2004-10-11 16:06 UTC (permalink / raw)
  To: u-boot

> In message <PKEEJGHDPBIDKDLLBHPIAEKBCBAA.jmcnamara@kimble.ie> you wrote:
> >
> > I can load the resultant binary using the loadb command but an
> exception is
> > generated when I attempt to run the program:
> ...
> > I had a look at what's going on with the debugger - hello_world
> is jumping
> > to an incorrect address (0xff97b8). This happens at the very
> start of the
> > program.
>
> This probably means that the stub code which exports U-Boot functions
> for use in stanbdalone applications is  incorrect  and/or  incomplete
> for your platform.

I've stepped through the code with the debugger and the stub code seems to
be working fine. I set the PC to getc() in hello_world and I was able to
jump to serial_getc() in u-boot. D7 is pointing to the start of global data,
as expected.

However, I did notice that both the u-boot monitor and the hello_world app
are using the same vaue for A5 when jumping to other functions - hello_world
is pointing to u-boot's data/bss section. Does anyone know how I can get the
hello_world app to load it's own A5 value before it begins its own
processing??
>
> > I've read through the README and DULG I've scoured the mailing
> list archive.
> > I still haven't been able to come up with a solution. Any ideas
> as to what I
> > could be doing wrong??
>
> Please see doc/README.standalone and  check  the  implementation  for
> your arch.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
> Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
> To be a winner, all you need to give is all you have.
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to
> find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] Unable to run hello_world
  2004-10-08 18:08 Smith, Craig
@ 2004-10-08 20:25 ` Wolfgang Denk
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2004-10-08 20:25 UTC (permalink / raw)
  To: u-boot

In message <EA78B62757AF1E4799828249310AC4CA071D2834@stca206a.bus.sc.rolm.com> you wrote:
> >>## Ready for binary (kermit) download to 0x00040000 at 19200 bps...
> >>## Total Size      = 0x000022b0 = 8880 Bytes
> 
> My hello_world.bin (for ppc) is 66280 bytes.

This is normal, depending on your toolchain.  The  binary  image  may
include a large "gap" between sections.


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
How does a project get to be a year late?      ... One day at a time.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] Unable to run hello_world
@ 2004-10-08 18:08 Smith, Craig
  2004-10-08 20:25 ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: Smith, Craig @ 2004-10-08 18:08 UTC (permalink / raw)
  To: u-boot

>>## Ready for binary (kermit) download to 0x00040000 at 19200 bps...
>>## Total Size      = 0x000022b0 = 8880 Bytes

My hello_world.bin (for ppc) is 66280 bytes.
Have you tried the s-record format?
What terminal program are you using?
minicom won't work...at least I can't get it to.

Regards,
-Craig

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-11 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-08 16:18 [U-Boot-Users] Unable to run hello_world Jim McNamara
2004-10-08 18:20 ` Wolfgang Denk
2004-10-11 16:06   ` Jim McNamara
2004-10-08 18:08 Smith, Craig
2004-10-08 20:25 ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.