1.3. U-Boot Command Line Interface
In the default configuration, U-Boot operates in an interactive mode which provides a simple command line-oriented user interface using a serial console port. (CN20)
1.3.1. Command Line Interface Initial Steps
When you entering the command Ine interface, in the simplest case, this means that u-boot shows a prompt (default: =>) when it is ready to receive user input. You then type a command, and press enter. U-boot will try to run the required action(s), and then prompt for another command.
To see a list of the available u-boot commands, you can type help (or simply ?). This will print a list of all commands that are available in your current configuration. [Please note that u-boot provides a lot of configuration options; not all options are available for all processors and boards, and some options might be simply not selected for your configuration.]
=> help
askenv - get environment variables from stdin
autoscr - run script from memory
base - print or set address offset
bdinfo - print Board Info structure
bootm - boot application image from memory
bootp - boot image via network using BootP/TFTP protocol
bootd - boot default, i.e., run 'bootcmd'
cmp - memory compare
coninfo - print console devices and informations
cp - memory copy
crc32 - checksum calculation
date - get/set/reset date & time
dhcp - invoke DHCP client to obtain IP/boot params
diskboot- boot from IDE device
echo - echo args to console
erase - erase FLASH memory
flinfo - print FLASH memory information
go - start application at address 'addr'
help - print online help
ide - IDE sub-system
iminfo - print header information for application image
loadb - load binary file over serial line (kermit mode)
loads - load S-Record file over serial line
loop - infinite loop on address range
md - memory display
mm - memory modify (auto-incrementing)
mtest - simple RAM test
mw - memory write (fill)
nm - memory modify (constant address)
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset - Perform RESET of the CPU
run - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv - set environment variables
sleep - delay execution for some time
tftpboot- boot image via network using TFTP protocol
and env variables ipaddr and serverip
version - print monitor version
? - alias for 'help'
=>
With the command help you can get additional information about most commands:
=> help tftpboot
tftpboot [loadAddress] [bootfilename]
=> help setenv printenv
setenv name value ...
- set environment variable 'name' to 'value ...'
setenv name
- delete environment variable 'name'
printenv
- print values of all environment variables
printenv name ...
- print value of environment variable 'name'
=>
Most commands can be abbreviated as long as the string remains unambiguous:
=> help fli tftp
flinfo
- print information for all FLASH memory banks
flinfo N
- print information for FLASH memory bank # N
tftpboot [loadAddress] [bootfilename]
=>
The following section briefly describes the most important commands available in U-Boot. Since this document is not an exhaustive manual for u-boot, if you are looking for a detailed reference manual or command index, you should consult the main U-boot manual at http://www.denx.de/twiki/bin/view/DULG/Manual or type help to get additional information.
Please note that u-boot is highly configurable, so not all of these commands may be available in the configuration of u-boot installed on your hardware, or additional commands may exist. You can use the help command to print a list of all available commands for your configuration.
For most commands, you do not need to type in the full command name; instead it is sufficient to type a few characters. For instance, help can be abbreviated as h.
Note:
- The behaviour of some commands depends of the configuration of u-boot and on the definition of some variables in u-boot environment.
- All u-boot commands expect numbers to be entered in hexadecimal input format.
1.3.2. Basic Command Set
1.3.2.1. Information Commands
| bdinfo | print Board Info structure |
| coninfo | print console devices and informations |
| flinfo | print Flash memory information |
| iminfo | print header information for application image |
| imls | list all images found in flash |
| help | print online help |
1.3.2.2. Memory Commands
| base | print or set address offset |
| crc32 | checksum calculation |
| cmp | memory compare |
| cp | memory copy |
| md | memory display |
| mm | memory modify (auto incrementing) |
| mtest | simple RAM test |
| mw | memory write (fill) |
| nm | memory modify (constant address) |
| loop | infinite loop on address range |
1.3.2.3. Flash Memory Commands
| cp | memory copy (program flash) |
| flinfo | print FLASH memory information |
| erase | erase FLASH memory |
| protect | enable or disable FLASH write protection |
| nandw | write image to NAND flash |
1.3.2.4. Execution Control Commands
| autoscr | run script from memory |
| bootm | boot application image from memory |
| bootelf | Boot from an ELF image in memory |
| bootvx | Boot vxWorks from an ELF image |
| go | start application at address 'addr' |
1.3.2.5. Network Commands
| bootp | boot image via network using BOOTP/TFTP protocol |
| cdp | Perform Cisco Discovery Protocol network configuration |
| dhcp | invoke DHCP client to obtain IP/boot params |
| loadb | load binary file over serial line (kermit mode) |
| loads | load S Record file over serial line |
| nfs | boot image via network using NFS protocol |
| tftp | invoke TFTP client for file transfer |
| ping | send ICMP ECHO_REQUEST to network host |
| rarpboot | boot image via network using RARP/TFTP protocol |
| tftpboot | boot image via network using TFTP protocol |
1.3.2.6. Environmental Variable Commands
| printenv | print environment variables |
| saveenv | save environment variables to persistent storage |
| askenv | get environment variables from stdin |
| setenv | set environment variables |
| run | run commands in an environment variable |
| bootd | boot default, i.e., run 'bootcmd' |
1.3.2.7. Filesystem Support (FAT, cramfs, JFFS2, Reiser)
| chpart | change active partition |
| fsinfo | print information about filesystems |
| fsload | load binary file from a filesystem image |
| ls | list files in a directory (default /) |
| fatinfo | print information about filesystem |
| fatls | list files in a directory (default /) |
| fatload | load binary file from a dos filesystem |
| nand | NAND flash sub system |
| reiserls | list files in a directory (default /) |
| reiserload | load binary file from a Reiser filesystem |
1.3.2.8. Special Commands
| i2c | I2C sub system |
| doc | Disk On Chip sub system |
| dtt | Digital Thermometer and Themostat |
| eeprom | EEPROM sub system |
| fpga | FPGA sub system |
| ide | IDE sub system |
| kgdb | enter gdb remote debug mode |
| diskboot | boot from IDE device |
| icache | enable or disable instruction cache |
| dcache | enable or disable data cache |
| diag | perform board diagnostics (POST code) |
| log | manipulate logbuffer |
| pci | list and access PCI Configuraton Space |
| regdump | register dump commands |
| usb | USB sub system |
| sspi | SPI utility commands |
1.3.2.9. Miscellaneous Commands
| bmp | manipulate BMP image data |
| date | get/set/reset date & time |
| echo | echo args to console |
| exit | exit script |
| kbd | read keyboard status |
| in | read data from an IO port |
| out | write datum to IO port |
| reset | Perform RESET of the CPU |
| sleep | delay execution for some time |
| test | minimal test like /bin/sh |
| version | print monitor version |
| wd | check and set watchdog |
| ? | alias for 'help' |
|
Next section, we will introduce the u-boot environment variables so that developers could configure the system and to store parameters for commands, and sequences of commands (simple scripts).