Specifications

=>
Hint: maximum flexibility can be achieved if you are using the Hush shell as command interpreter in
U-Boot; see section 14.2.17. How the Command Line Parsing Works
5.12. U-Boot Standalone Applications
U-Boot supports "standalone" applications, which are loaded dynamically; these applications can have access
to the U-Boot console I/O functions, memory allocation and interrupt services.
A couple of simple examples are included with the U-Boot source code:
5.12.1. "Hello World" Demo
examples/hello_world.c contains a small "Hello World" Demo application; it is automatically compiled when
you build U-Boot. It's configured to run at address 0x00040004, so you can play with it like that:
=> loads
## Ready for S-Record download ...
~>examples/hello_world.srec
1 2 3 4 5 6 7 8 9 10 11 ...
[file transfer complete]
[connected]
## Start Addr = 0x00040004
=> go 40004 Hello World! This is a test.
## Starting application at 0x00040004 ...
Hello World
argc = 7
argv[0] = "40004"
argv[1] = "Hello"
argv[2] = "World!"
argv[3] = "This"
argv[4] = "is"
argv[5] = "a"
argv[6] = "test."
argv[7] = ""
Hit any key to exit ...
## Application terminated, rc = 0x0
Alternatively, you can of course use TFTP to download the image over the network. In this case the binary
image (hello_world.bin) is used.
Note that the entry point of the program is at offset 0x0004 from the start of file, i. e. the download address
and the entry point address differ by four bytes.
=> tftp 40000 /tftpboot/hello_world.bin
...
=> go 40004 This is another test.
## Starting application at 0x00040004 ...
Hello World
argc = 5
argv[0] = "40004"
argv[1] = "This"
argv[2] = "is"
argv[3] = "another"
argv[4] = "test."
argv[5] = ""
Hit any key to exit ...
5.12. U-Boot Standalone Applications 83