[U-Boot] U-Boot timer example crashes on EP88xC

Hello,
I am using ELDK 4.2 and U-Boot 2009.03 on an EP88xC rev1.1 board (MPC885 cpu) and am trying to get the example apps working (the ones that come with U-Boot) following instructions on "http://www.denx.de/wiki/view/DULG/UBootStandalone#Section_5.12.2.".
"examples/hello_world.bin" worked fine:
=> tftp 40000 ep88x_helloworld Trying FEC ETHERNET Using FEC ETHERNET device TFTP from server 10.0.54.129; our IP address is 10.0.54.150 Filename 'ep88x_helloworld'. Load address: 0x40000 Loading: ################## done Bytes transferred = 262980 (40344 hex) => go 40004 ## Starting application at 0x00040004 ... Example expects ABI version 4 Actual U-Boot ABI version 4 Hello World argc = 1 argv[0] = "40004" argv[1] = "<NULL>" Hit any key to exit ...
## Application terminated, rc = 0x0 =>
But things didn't go too smoothly with the "examples/timer.bin" app:
=> tftp 40000 ep88x_timerdemo Trying FEC ETHERNET Using FEC ETHERNET device TFTP from server 10.0.54.129; our IP address is 10.0.54.150 Filename 'ep88x_timerdemo'. Load address: 0x40000 Loading: ################## done Bytes transferred = 263740 (4063c hex) => go 40004 ## Starting application at 0x00040004 ... .Bus Fault @ 0x00040038, fixup 0x00000000 Machine check in kernel mode. Caused by (from msr): regs 03f70cd8 Unknown values in msr NIP: 00040038 XER: A000B700 LR: 00040030 REGS: 03f70cd8 TRAP: 0200 DAR: C4B38E78
MSR: 00009002 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 00
GPR00: 00000003 03F70DC8 03F70F8C 00000000 03F70C84 03F70C78 FFFFFFFF 03F70C00 GPR08: 00000041 C4B38E78 00000000 03FE2EBC 00000030 00000001 03FFF000 00000000 GPR16: 03FF58BC 03FF82C8 00000000 00000000 00000000 00000000 00000000 00000000 GPR24: 00000000 03FB11C8 00000000 00000000 03FB127C 00000001 00088608 00000002 Call backtrace: machine check ### ERROR ### Please RESET the board ###
Does anybody have any suggestions for what may be wrong here?
Thanks!

Hi Mikhail,
I am using ELDK 4.2 and U-Boot 2009.03 on an EP88xC rev1.1 board (MPC885 cpu) and am trying to get the example apps working (the ones that come with U-Boot) following instructions on "http://www.denx.de/wiki/view/DULG/UBootStandalone#Section_5.12.2.".
"examples/hello_world.bin" worked fine:
[...]
But things didn't go too smoothly with the "examples/timer.bin" app:
=> tftp 40000 ep88x_timerdemo Trying FEC ETHERNET Using FEC ETHERNET device TFTP from server 10.0.54.129; our IP address is 10.0.54.150 Filename 'ep88x_timerdemo'. Load address: 0x40000 Loading: ################## done Bytes transferred = 263740 (4063c hex) => go 40004 ## Starting application at 0x00040004 ...
Oh huh - this would imply that the "timer" routine got linked to this address. When I use objdump to deassemble the object file, it seems that "timer" is at 40108. Try "go 0x40108" and read the FAQ[1] ;)
Cheers Detlev
[1] http://www.denx.de/wiki/view/DULG/MyStandaloneProgramDoesNotWork

When I use objdump to deassemble the object file, it seems that "timer" is at 40108. Try "go 0x40108" and read the FAQ[1] ;)
Cheers Detlev
[1] http://www.denx.de/wiki/view/DULG/MyStandaloneProgramDoesNotWork
"go 0x40108" did it, thanks! And thanks for the FAQ reference, knowing this will be definitely useful in the future.
Why does the documentation say to use 0x40004? I have not made any changes to the timer program, is it different because the example uses the SREC version of the file and I'm using the binary?

Hi Mikhail,
When I use objdump to deassemble the object file, it seems that "timer" is at 40108. Try "go 0x40108" and read the FAQ[1] ;)
Cheers Detlev
[1] http://www.denx.de/wiki/view/DULG/MyStandaloneProgramDoesNotWork
"go 0x40108" did it, thanks! And thanks for the FAQ reference, knowing this will be definitely useful in the future.
Why does the documentation say to use 0x40004?
The documentation _was_ correct at some point in time. Obviously the situation changed.
The "real" problem is that we currently do not exactly specify the memory layout for the examples elf files. To be deterministic we would need to have a linker script which puts the intended function onto the correct offset. This has not been done and with previous toolchains the examples worked (more or less) like expected.
Obviously nobody used the timer example recently ;)
I have not made any changes to the timer program, is it different because the example uses the SREC version of the file and I'm using the binary?
No this is not a problem - as mentioned above it is the contents of the elf file which is "not according to expectation".
For the fun of it you could try to come up with a linker script for powerpc also. This should get at least the text segment at the intended place. How to order functions in there I'm not so sure. Maybe use attributes to define a specific text segment at the beginning and then mark the "main" function with this attribute.
You're welcome to play here ;)
Cheers Detlev
participants (2)
-
Detlev Zundel
-
Mikhail Zaturenskiy