2010-05-19 16:19:24     passing control back to u-boot from stand alone application

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2010-05-19 16:19:24     passing control back to u-boot from stand alone application

Ashish Gupta (INDIA)

Message: 89558   

 

Hi,

 

I need to run a standalone elf executable from u-boot using "bootelf" at startup, and pass the control back to uboot so that uboot can then boot the uclinux kernel.

 

Is there some way to do that.

 

Thanks,

 

Ashish

QuoteReplyEditDelete

 

 

2010-05-19 16:24:42     Re: passing control back to u-boot from stand alone application

Mike Frysinger (UNITED STATES)

Message: 89559   

 

return like any other function

QuoteReplyEditDelete

 

 

2010-05-20 09:17:06     Re: passing control back to u-boot from stand alone application

Ashish Gupta (INDIA)

Message: 89589   

 

Hi,

 

This is my simple test code compiled using 2009R1 toolchain:

 

main (){

    int i=0;

    i++;

    return 0;

}

 

 

And following is the uboot dump, after loading the elf file, control never goes back to uboot.

 

CM-BF537E> version

U-Boot-1.1.3-ADI-R06R2 (Feb 15 2007 - 09:16:20)

 

CM-BF537E> tftp 0x01000000 testv1

Using MAC Address 02:80:AD:20:31:B8

TFTP from server 192.168.1.5; our IP address is 192.168.1.85

Filename 'testv1'.

Load address: 0x1000000

Loading: ##############

done

Bytes transferred = 66776 (104d8 hex)

CM-BF537E> bootelf 0x01000000

Loading .text @ 0xffa00000 (3908 bytes)

Loading .init @ 0xffa00f44 (18 bytes)

Loading .fini @ 0xffa00f56 (14 bytes)

Loading .rodata @ 0xff800000 (8 bytes)

Loading .eh_frame @ 0xff800008 (4 bytes)

Loading .ctors @ 0xff80000c (8 bytes)

Loading .dtors @ 0xff800014 (8 bytes)

Loading .jcr @ 0xff80001c (4 bytes)

Loading .data @ 0xff800020 (2076 bytes)

Clearing .bss @ 0xff80083c (92 bytes)

## Starting application at 0xffa00000 ...

QuoteReplyEditDelete

 

 

2010-05-20 10:02:45     Re: passing control back to u-boot from stand alone application

Robin Getz (UNITED STATES)

Message: 89591   

 

Ashish:

 

That is because it's not a U-Boot standalone application.

 

look in the examples/standalone dir.

 

-Robin

QuoteReplyEditDelete

 

 

2010-05-20 23:17:13     Re: passing control back to u-boot from stand alone application

Mike Frysinger (UNITED STATES)

Message: 89607   

 

that u-boot version is very old

 

ignoring that, you never said how you compiled+linked the ELF.  the default elf toolchain includes a lot of CRT code that reprograms the CEC among other things which means it isnt usable.  so provide your own CRT logic that doesnt clobber the u-boot settings.

Attachments

    Outcomes