Skip to contentSkip to conversation

Standalone application problem

U-Boot-Users Srikanth Sherman 2 participants 2 messages Nov 25, 2003

lore
Share & tools
lore
#0 lore raw

Hello,

I have an Ebony 440GP development board and as a test, I'm trying to run the hello_world application from the flash. I can run the application
without any problems from the SDRAM (ie, "tftpboot 0x40000 hello_world.bin" and then run "go 0x40004").

However, I would like to burn the application into the onboard flash and execute it on powerup. If I copy the .bin to 0xff800000 and then set my bootcmd to "go 0xff80000" everything seems to work OK until I leave the board off for a while in which case the application displays garbage on the
screen after U-Boot starts it. There appears to be a problem with some
data in 0x40000 load area that isn't there when I power off the board and power it back on.

I've also tried converting the hello_world ELF to an .img by using /tools/mkimage and that causes the application to hang right after U-Boot passes control to it. Also, running "bootelf 0x40000" after "tftpboot 0x40000 hello_world" causes an exception.

So, in summary:

How do I load a stand-alone application .bin onto flash after loading it into RAM? Secondly, how do I load and run "hello_world" (ELF) correctly? I know I'm missing something really basic here!

Thanks.

#1 lore raw

Hello,

Quoted 4 lines · in message <[email protected]> you wrote:

However, I would like to burn the application into the onboard flash and execute it on powerup. If I copy the .bin to 0xff800000 and then set my bootcmd to "go 0xff80000" everything seems to work OK until I leave the

You cannot do this so easy. First, the image is linked to a specific address; it is NOT position-independend. Second, the image expects to find writable data and BSS segments which fail when burned to ROM/flash.

Quoted 3 lines

How do I load a stand-alone application .bin onto flash after loading it into RAM? Secondly, how do I load and run "hello_world" (ELF) correctly? I know I'm missing something really basic here!

You can copy a stand-alone application to flash for storage; but to run it you will have to load (copy it back) to it's link address in RAM. If you want images which support XIP from flash you will need to twiddle the linker script a bit.

Also note that you can wrap your stand-alone application into a "Standalone Image" (image type IH_TYPE_STANDALONE) which would take care of (eventually uncompressing and) loading the image to it's start address.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Nothing ever becomes real until it is experienced.       - John Keats