linux如何使用uboot的命令,Uboot常用命令使用
1、前言
Uboot啟動后,會進入到一個倒計時,在倒計時結束之前,如果此時我們按下鍵盤的回車鍵,將進入到uboot的命令行模式,有點類似Linux系統終端模式,如果沒有按下回車鍵的話,將直接啟動Linux內核,本篇文章將介紹uboot中的一些常用命令,熟悉這些命令后,以后在適配調試uboot的時候會得心應手。
如下所示,倒計時的時候按下回車鍵后,進入到uboot的命令行模式:
在行的前面多了"=>"字符串,說明此時已經進入uboot的命令行模式了,接下來就可以進行一些命令輸入。
2、查看uboot支持的命令
在使用uboot命令之前,我們先來看看當前的uboot版本所支持的命令有哪些,可以在當前的命令函數輸入:
=>help
or=> ?
該命令用于查看當前uboot版本所支持的所有命令,輸入后按回車即可,在我當前使用的uboot版本中所支持的命令如下:
? - alias for ‘help‘base-print or set address offset
bdinfo-print Board Info structure
bmode- sd1|sd2|qspi1|normal|usb|sata|ecspi1:0|ecspi1:1|ecspi1:2|ecspi1:3|esdhc1|esdhc2|esdhc3|esdhc4 [noreset]
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 inmemory
bootm-boot application image from memory
bootp- boot image via network using BOOTP/TFTP protocol
bootvx-Boot vxWorks from an ELF image
bootz-boot Linux zImage image from memory
clocks-display clocks
clrlogo-fill the boot logo area with blackcmp -memory compare
coninfo-print console devices and informationcp -memory copy
crc32-checksum calculation
dcache-enable or disable data cache
dhcp- boot image via network using DHCP/TFTP protocol
dm-Driver model low level accessecho - echoargs to console
editenv-edit environment variableenv -environment handling commands
erase-erase FLASH memory
exit-exit script
ext2load- load binary filefrom a Ext2 filesystem
ext2ls- list files in a directory (default /)
ext4load- load binary filefrom a Ext4 filesystem
ext4ls- list files in a directory (default /)
ext4size- determine a file‘s size
ext4write- create a file inthe root directoryfalse - donothing, unsuccessfully
fatinfo-print information about filesystem
fatload- load binary filefrom a dos filesystem
fatls- list files in a directory (default /)
fatsize- determine a file‘s size
fdt -flattened device tree utility commands
flinfo-print FLASH memory information
fstype-Look up a filesystem type
fuse- Fuse sub-system
go- start application at address ‘addr‘gpio-query and control gpio pins
help- print command description/usage
i2c- I2C sub-system
icache-enable or disable instruction cache
iminfo- print header information forapplication image
imxtract- extract a part of a multi-image
itest- return true/falseon integer compare
load- load binary filefrom a filesystem
loadb- load binary fileover serial line (kermit mode)
loads- load S-Record fileover serial line
loadx- load binary fileover serial line (xmodem mode)
loady- load binary fileover serial line (ymodem mode)
loop-infinite loop on address rangels - list files in a directory (default /)
md-memory display
mm- memory modify (auto-incrementing address)
mmc-MMC sub system
mmcinfo- display MMC infomw- 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
pmic-PMIC
printenv-print environment variables
protect- enable or disable FLASH writeprotection
reset-Perform RESET of the CPU
run- run commands inan environment variable
save- save fileto a filesystem
saveenv-save environment variables to persistent storage
setenv-set environment variables
setexpr-set environment variable as the result of eval expression
showvar-print local hushshell variables
size- determine a file‘s size
sleep - delay execution for some timesource-run script from memory
test- minimal test like /bin/shtftpboot-boot image via network using TFTP protocoltrue - donothing, successfully
usb- USB sub-system
usbboot-boot from USB device
version- print monitor, compiler and linker version
對于上面的命令列表中的命令,并不是所有都能運行的,如果該命令并沒有在板級文件中使能配置的話,哪么直接在命令行中輸入后按回車鍵,將會直接提示運行不了,也就是說上面列出的命令,并沒有全部都使能了。
上面列出的命令,后面都描述了命令的功能,例如,最后一個version命令,它的功能就是用來輸出uboot編譯和鏈接的相關版本信息,除此之外,如果我們想查看某個命令的詳細用法的話,可以輸入:
=>help command_name
or=> ? command_name
例如,我們查看bootz命令的用法,輸入如下,然后回車:
=> help bootz
or
=> ? bootz
回車后,輸出如下:
從輸出的結果可以看到,bootz命令的用法被詳細的列出來了,該命令就是用來在內存中啟動Linux內核的,對于其它命令的詳細用法,我們也可以使用這個方式進行命令的詳細使用方式進行查詢,接下來,我們了解一些常用的uboot命令用法。
3、信息查詢相關命令
在uboot的命令中,常用的信息查詢命令主要有3個,分別是bdinfo、printenv和version命令。
首先是bdinfo命令,該命令用來查詢當前板子的相關信息,在命令行模式下,直接輸入bdinfo,然后回車即可,輸出如下:
如上所示,通過該命令可以查看板子的DRAM的大小以及DRAM的起始地址、當前使用的網絡接口以及IP地址、波特率和uboot偏移地址以及偏移量等相關信息。
接下來是printenv命令,該命令用于查詢當前板子的一些相關環境變量,同樣,在命令行模式下輸入printenv并回車,輸出如下:
從上圖可以看到,命令輸入后,將會輸出一堆的環境變量,例如:當前串口的波特率baudrate、啟動參數bootargs以及啟動命令bootcmd等,這些環境變量都是字符串,能對其進行修改。
最后則是version命令,該命令用于查詢uboot版本和交叉編譯工具的相關信息,在命令模式下輸入version后并回車,輸出如下:
從輸出的信息可以看到,當前的uboot版本號為2016.03,后面接的是編譯時間,交叉編譯工具鏈為arm-linux-gnueabihf-gcc,版本號為4.9.4。
4、環境變量相關命令
5、內存操作相關命令
原文:https://www.cnblogs.com/Cqlismy/p/12214305.html
總結
以上是生活随笔為你收集整理的linux如何使用uboot的命令,Uboot常用命令使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux 邮件发送时间,Linux-N
- 下一篇: boa linux arm修改网卡,嵌入