? - alias for 'help'
askenv - get environment variables from stdin
base - print or set address offset
bdinfo - print Board Info structure
bmp - manipulate BMP image data
boot - boot default, i.e., run 'bootcmd'
bootd - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm - boot application image from memory
bootp - boot image via network using BOOTP/TFTP protocol
bootvx - Boot vxWorks from an ELF image
cmp - memory compare
coninfo - print console devices and information
cp - memory copy
crc32 - checksum calculation
date - get/set/reset date & time
dcache - enable or disable data cache
dhcp - boot image via network using DHCP/TFTP protocol
echo - echo args to console
editenv - edit environment variable
eeprom - EEPROM sub-system
erase - erase FLASH memory
exit - exit script
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls - list files in a directory (default /)
flinfo - print FLASH memory information
fsinfo - print information about filesystems
fsload - load binary file from a filesystem image
go - start application at address 'addr'
help - print online help
i2c - I2C sub-system
icache - enable or disable instruction cache
iminfo - print header information for application image
imls - list all images found in flash
imxtract- extract a part of a multi-image
itest - return true/false on integer compare
loadb - load binary file over serial line (kermit mode)
loads - load S-Record file over serial line
loadx - load binary file over serial line (xmodem mode)
loady - load binary file over serial line (ymodem mode)
loop - infinite loop on address range
ls - list files in a directory (default /)
md - memory display
mm - memory modify (auto-incrementing address)
mmc - MMC sub-system
mtest - simple RAM read/write test
mw - memory write (fill)
nand - NAND sub-system
nboot - boot from NAND device
nfs - boot image via network using NFS protocol
nm - memory modify (constant address)
ping - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reginfo - print register information
reset - Perform RESET of the CPU
run - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv - set environment variables
showvar - print local hushshell variables
sleep - delay execution for some time
source - run script from memory
test - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
unzip - unzip a memory region
usb - USB sub-system
usbboot - boot from USB device
version - print monitor version
bootm
引导启动存储在内存中的程序映像
# bootm [addr [arg ...]]
Sub-commands to do part of the bootm sequence. The sub-commands must beissued in
the order below (it's ok to not issue all sub-commands):
start [addr [arg ...]]
loados - load OS image
cmdline - OS specific command line processing/setup
bdt - OS specific bd_t processing
prep - OS specific prep before relocation or go
go - start OS
第一个参数:映像地址
第一个参数:通常是Ramdisk映像存储地址;也可以是传递给Linux内核的参数(缺省情况下传递bootargs环境变量)
例:
# bootm kernel_addr ramdisk_addr device_tree_addr
如果不想加载ramdisk,用’-‘代替即可
bootp
通过TFTP协议下载文件到内存
# bootp [loadAddress] [bootfilename]
loadAddress:文件存放的内存地址
bootfilename:文件名称
cmp
内存比较
# cmp [.b, .w, .l] addr1 addr2 count
b:1Byte
w:2Byte
l:4Byte
例:cmp.b,下同
cp
内存复制
# cp [.b, .w, .l] source target count
source:原地址
target:目的地址
注:这个地址如果在Flash中,那么会直接调用写Flash的函数操作。uboot写Flash就使用这个命令,当然要先擦除对应Flash
crc32
计算存储数据的校验和
# crc32 address count [addr]
address:起始地址
addr:结果地址
echo
回显参数
# echo [args..]
erase
擦除Flash
# erase start end
# erase N:SF[-SL]
# erase bank N
# erase all
start:块起始地址
end:块结束地址
N:Flash组号
SF:起始扇区号
SL:结束扇区号
all:全部Flash
flinfo
# flinfo
# flinfo N
flinfo:Flash组信息
N:某个组
go
# go addr [arg ...]
addr:程序入口地址
arg:参数
iminfo
映像的开头信息(序列号、头和校验和)
# iminfo addr [addr ...]
addr:起始地址
…:多地址
loadb
通过串口Kermit协议下载二进制数据
# loadb [ off ] [ baud ]
loads
通过串口线下载S-Record格式文件
# loads [ off ]
mw
写内存
# mw [.b, .w, .l] address value [count]
address:内存地址
value:写的值
count:单位值的数目
nm
修改内存
# nm [.b, .w, .l] address
address:读出并且修改的内存地址
md
显示内存的内容
例:
# md.w 0x8200000 0x8
mm
修改内存
nfs
通过NFS协议启动网络映像
# nfs [loadAddress] [host ip addr:bootfilename]
loadAddress:内存地址
printenv
打印环境变量
# printenv
# printenv name ...
name:变量名
protect
Flash写保护
# protect on/off start end
# protect on/off N:SF[-SL]
# protect on/off bank N
# protect on/off all
on:写保护
off:解除保护
rarpboot
通过TFTP启动网络映像
# rarpboot [loadAddress] [bootfilename]
run
执行环境变量中的命令
# run var [...]
setenv
设置环境变量
# setenv name value ...
# setenv name
注:设置包含特殊字符时需要用”
# setenv bootcmd 'nand read...'
saveenv
保存环境变量。将变量写入flash
注:变量空间只有8k
sleep
延迟N秒钟执行,N为十进制数
# sleep N
tftpboot
# tftpboot [loadAddress] [bootfilename]
通过TFTP协议下载文件
ping
uboot ping 别的主机
usb
# usb start
# usb info
# usb scan
start:启动usb
info:列出设备
scan:扫描usb设备
kgo
启动没有压缩的linux内核
fatls
列出DOS FAT文件系统
fatload
读入FAT中的一个文件
与环境变量相关
bootdelay:执行自动启动的等候秒数
baudrate:串口波特率
netmask:以太网的网络掩码
ethaddr:以太网的MAC地址
bootargs:传递给Linux内核的启动参数
bootcmd:自动启动时执行命令
serverip:TFTP服务器端的IP地址
ipaddr:本地的IP地址
Nand Flash相关
# nand info
显示可使用的Nand Flash
# nand read addr off size
从Nand的 off 偏移地址处读取size字节的数据到SDRAM的addr地址
# nand write addr off size
将SDRAM的addr地址处size字节的数据烧写到Nand的 off 偏移地址
# nand write[.yaffs[1]] addr off size
例:
# nand write.yaffs 0x8000000 0x100000 0
0:自动判断文件大小去烧写
# nand erase [clean] [off size]
擦除Nand Flash的 off 偏移地址处的size字节的数据
# nand bad
显示Nand Flash的坏块
# nand dump[.oob] off
显示Nand Flash中的数据(16进制)
# nand scrub
彻底擦除整块Nand Flash中的数据,包括OOB。可以擦除软件坏块标志
# nand markbad off
标识Nand的 off 偏移地址处的块为坏块
Nor Flash
Nor Flash的烧写时序和SDRAM的写入不同,烧写Nor Flash不能使用mm等命令,只能使用cp命令从内存拷贝到Nor Flash,而且烧写之前必须解除保护并擦除
Nor Flash擦除的最小单位是Sector,也就是0x10000字节。如果你定义的大小不满1 Sector或超过Sector的边界,那么被定义到的Sector会被全部擦除