亚洲精品一二区_国产黄色片网站_99久久久成人国产精品_蜜臀网_国产精品一区二区三区免费_成人av中文字幕_91精品国产欧美一区二区成人


U-Boot命令大全(功能參數(shù)及用法)

分享到:
           

    U-Boot上電啟動(dòng)后,按任意鍵可以退出自動(dòng)啟動(dòng)狀態(tài),進(jìn)入命令行。

    U-Boot 2010.03 (Sep 25 2011 - 16:18:50)
    DRAM: 64 MB
    Flash: 2 MB
    NAND: 64 MiB
    In: serial
    Out: serial
    Err: serial
    Net: CS8900-0
    Hit any key to stop autoboot: 1

    在命令行提示符下,輸入U(xiǎn)-Boot的命令并執(zhí)行。U-Boot可支持幾十個(gè)常用命令,通過(guò)這些命令,可以對(duì)開發(fā)板進(jìn)行調(diào)試,引導(dǎo)Linux內(nèi)核,還可以擦寫Flash完成系統(tǒng)部署等功能。掌握這些命令的使用,才能夠順利地進(jìn)行嵌入式系統(tǒng)的開發(fā)。

    輸入help命令,可以得到當(dāng)前U-Boot的所有命令列表。每一條命令后面是簡(jiǎn)單的命令說(shuō)明。

    U-Boot還提供了更加詳細(xì)的命令幫助,通過(guò)help命令還可以查看每個(gè)命令的參數(shù)說(shuō)明。由于開發(fā)過(guò)程的需要,有必要先把U-Boot命令的用法弄清楚。接下來(lái),根據(jù)每一條命令的幫助信息,解釋一下這些命令的功能和參數(shù)。

    1)bootm命令

    bootm命令可以引導(dǎo)啟動(dòng)存儲(chǔ)在內(nèi)存中的程序映像,這些內(nèi)存包括RAM和可以永久保存的Flash。

    # help bootm
    bootm - boot application image from memory
    Usage:
    bootm [addr [arg ...]]
        - boot application image stored in memory
            passing arguments 'arg ...'; when booting a Linux kernel,
            'arg' can be the address of an initrd image
    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

    ● 第1個(gè)參數(shù)addr是程序映像的地址,這個(gè)程序映像必須轉(zhuǎn)換成U-Boot的格式。
    ● 第2個(gè)參數(shù)對(duì)于引導(dǎo)Linux內(nèi)核有用,通常作為U-Boot格式的RAMDISK映像存儲(chǔ)地址;也可以是傳遞給Linux內(nèi)核的參數(shù)(默認(rèn)情況下傳遞bootargs環(huán)境變量給內(nèi)核)。

    2)bootp命令

    bootp命令要求DHCP服務(wù)器分配IP地址,然后通過(guò)TFTP協(xié)議下載指定的文件到內(nèi)存。

    # help bootp
    bootp - boot image via network using BOOTP/TFTP protocol

    Usage:
    bootp [loadAddress] [[hostIPaddr:]bootfilename]

    ● 第1個(gè)參數(shù)是load Address下載文件存放的內(nèi)存地址。
    ● 第2個(gè)參數(shù)是bootfilename要下載的文件名稱,這個(gè)文件應(yīng)該在開發(fā)主機(jī)上準(zhǔn)備好。

    3)cmp命令

    cmp命令可以比較兩塊內(nèi)存中的內(nèi)容。.b以字節(jié)為單位;.w以字為單位;.l以長(zhǎng)字為單位。注意:cmp.b中間不能保留空格,需要連續(xù)輸入命令。

    # help cmp
    cmp - memory compare

    Usage:
    cmp [.b, .w, .l] addr1 addr2 count

    ● 第1個(gè)參數(shù)addr1是第一塊內(nèi)存的起始地址。
    ● 第2個(gè)參數(shù)addr2是第二塊內(nèi)存的起始地址。
    ● 第3個(gè)參數(shù)count是要比較的數(shù)目,單位是字節(jié)、字或者長(zhǎng)字。

    4)cp命令

    cp命令可以在內(nèi)存中復(fù)制數(shù)據(jù)塊,包括對(duì)Flash的讀寫操作。

    # help cp
    cp - memory copy

    Usage:
    cp [.b, .w, .l] source target count

    ● 第1個(gè)參數(shù)source是要復(fù)制的數(shù)據(jù)塊起始地址。
    ● 第2個(gè)參數(shù)target是數(shù)據(jù)塊要復(fù)制到的地址。這個(gè)地址如果在Flash中,那么會(huì)直接調(diào)用寫Flash的函數(shù)操作。所以U-Boot寫Flash就使用這個(gè)命令,當(dāng)然需要先把對(duì)應(yīng)Flash區(qū)域擦干凈。
    ● 第3個(gè)參數(shù)count是要復(fù)制的數(shù)目,根據(jù)cp.b、cp.w、cp.l分別以字節(jié)、字、長(zhǎng)字為單位。

    5)crc32命令

    crc32命令可以計(jì)算存儲(chǔ)數(shù)據(jù)的校驗(yàn)和。

    # help crc32
    crc32 - checksum calculation

    Usage:
    crc32 address count [addr]
        - compute CRC32 checksum [save at addr]

    ● 第1個(gè)參數(shù)address是需要校驗(yàn)的數(shù)據(jù)起始地址。
    ● 第2個(gè)參數(shù)count是要校驗(yàn)的數(shù)據(jù)字節(jié)數(shù)。
    ● 第3個(gè)參數(shù)addr用來(lái)指定保存結(jié)果的地址。

    6)echo命令

    echo命令回顯參數(shù)。

    # help echo
    echo - echo args to console

    Usage:
    echo [args..]
        - echo args to console; \c suppresses newline

    7)erase命令

    erase命令可以擦除Flash。參數(shù)必須指定Flash擦除的范圍。

    # help erase
    erase - erase FLASH memory

    Usage:
    erase start end
        - erase FLASH from addr 'start' to addr 'end'
    erase start +len
        - erase FLASH from addr 'start' to the end of sect w/addr 'start'+'len'-1
    erase N:SF[-SL]
        - erase sectors SF-SL in FLASH bank # N
    erase bank N
        - erase FLASH bank # N
    erase all
        - erase all FLASH banks

    按照起始地址和結(jié)束地址,start必須是擦除塊的起始地址;end必須是擦除末尾塊的結(jié)束地址,這種方式常用。舉例說(shuō)明:擦除0x20000~0x3ffff區(qū)域命令為erase 20000 3ffff。

    按照組和扇區(qū),N表示Flash的組號(hào),SF表示擦除起始扇區(qū)號(hào),SL表示擦除結(jié)束扇區(qū)號(hào)。另外,還可以擦除整個(gè)組,擦除組號(hào)為N的整個(gè)Flash組。擦除全部Flash只要給出一個(gè)all的參數(shù)即可。

    8)nand命令

    nand命令可以通過(guò)不同的參數(shù)實(shí)現(xiàn)對(duì)Nand Flash的擦除、讀、寫操作。

    常見的幾種命令的含義如下(具體格式見help nand)。

    # help nand
    nand - NAND sub-system

    Usage:
    nand info - show available NAND devices
    nand device [dev] - show or set current device
    nand read - addr off|partition size
    nand write - addr off|partition size
        read/write 'size' bytes starting at offset 'off'
        to/from memory address 'addr', skipping bad blocks.
    nand erase [clean] [off size] - erase 'size' bytes from
        offset 'off' (entire device if not specified)
    nand bad - show bad blocks
    nand dump[.oob] off - dump page
    nand scrub - really clean NAND erasing bad blocks (UNSAFE)
    nand markbad off [...] - mark bad block(s) at offset (UNSAFE)
    nand biterr off - make a bit error at offset (UNSAFE)

    ● nand erase:擦除Nand Flash。
    ● nand read:讀取Nand Flash,遇到flash壞塊時(shí)會(huì)出錯(cuò)。
    ● nand write:寫Nand Flash,nand write命令遇到flash壞塊時(shí)會(huì)出錯(cuò)。

    9)flinfo命令

    flinfo命令打印全部Flash組的信息,也可以只打印其中某個(gè)組。一般嵌入式系統(tǒng)的Flash只有一個(gè)組。

    # help flinfo
    flinfo - print FLASH memory information

    Usage:
    flinfo
        - print information for all FLASH memory banks
    flinfo N
        - print information for FLASH memory bank # N

    10)go命令

    go命令可以執(zhí)行應(yīng)用程序。

    # help go
    go - start application at address 'addr'

    Usage:
    go addr [arg ...]
        - start application at address 'addr'
        passing 'arg' as arguments

    ● 第1個(gè)參數(shù)addr是要執(zhí)行程序的入口地址。
    ● 第2個(gè)可選參數(shù)是傳遞給程序的參數(shù),可以不用。

    11)iminfo命令

    iminfo命令可以打印程序映像的開頭信息,包含了映像內(nèi)容的校驗(yàn)(序列號(hào)、頭和校驗(yàn)和)。

    # help iminfo
    iminfo - print header information for application image

    Usage:
    iminfo addr [addr ...]
        - print header information for application image starting at
        address 'addr' in memory; this includes verification of the
        image contents (magic number, header and payload checksums)

    第1個(gè)參數(shù)addr指定映像的起始地址。可選的參數(shù)是指定更多的映像地址。

    12)loadb命令

    loadb命令可以通過(guò)串口線下載二進(jìn)制格式文件。

    # help loadb
    loadb - load binary file over serial line (kermit mode)

    Usage:
    loadb [ off ] [ baud ]
        - load binary file over serial line with offset 'off' and baudrate 'baud'

    13)loads命令

    loads命令可以通過(guò)串口線下載S-Record格式文件。

    # help loads
    loads - load S-Record file over serial line

    Usage:
    loads [ off ]
        - load S-Record file over serial line with offset 'off'

    14)mw命令

    mw命令可以按照字節(jié)、字、長(zhǎng)字寫內(nèi)存,.b、.w、.l的用法與cp命令相同。

    # help mw
    mw - memory write (fill)

    Usage:
    mw [.b, .w, .l] address value [count]

    ● 第1個(gè)參數(shù)address是要寫的內(nèi)存地址。
    ● 第2個(gè)參數(shù)value是要寫的值。
    ● 第3個(gè)可選參數(shù)count是要寫單位值的數(shù)目。

    15)nfs命令

    nfs命令可以使用NFS網(wǎng)絡(luò)協(xié)議通過(guò)網(wǎng)絡(luò)啟動(dòng)映像。

    # help nfs
    nfs - boot image via network using NFS protocol

    Usage:
    nfs [loadAddress] [[hostIPaddr:]bootfilename]

    16)printenv命令

    printenv命令打印環(huán)境變量。可以打印全部環(huán)境變量,也可以只打印參數(shù)中列出的環(huán)境變量。

    # help printenv
    printenv - print environment variables

    Usage:
    printenv
        - print values of all environment variables
    printenv name ...
        - print value of environment variable 'name'

    17)protect命令

    protect命令是對(duì)Flash寫保護(hù)的操作,可以使能和解除寫保護(hù)。

    help protect
    protect - enable or disable FLASH write protection

    Usage:
    protect on start end
        - protect FLASH from addr 'start' to addr 'end'
    protect on start +len
        - protect FLASH from addr 'start' to end of sect w/addr 'start'+'len'-1
    protect on N:SF[-SL]
        - protect sectors SF-SL in FLASH bank # N
    protect on bank N
        - protect FLASH bank # N
    protect on all
        - protect all FLASH banks
    protect off start end
        - make FLASH from addr 'start' to addr 'end' writable
    protect off start +len
        - make FLASH from addr 'start' to end of sect w/addr 'start'+'len'-1 wrtable
    protect off N:SF[-SL]
        - make sectors SF-SL writable in FLASH bank # N
    protect off bank N
        - make FLASH bank # N writable
    protect off all
        - make all FLASH banks writable

    ● 第1個(gè)參數(shù)on代表使能寫保護(hù);off代表解除寫保護(hù)。
    ● 第2和3個(gè)參數(shù)是指定Flash寫保護(hù)操作范圍,與擦除的方式相同。

    18)rarpboot命令

    rarpboot命令可以使用TFTP協(xié)議通過(guò)網(wǎng)絡(luò)啟動(dòng)映像,也就是把指定的文件下載到指定地址,然后執(zhí)行。

    # help rarpboot
    rarpboot - boot image via network using RARP/TFTP protocol

    Usage:
    rarpboot [loadAddress] [[hostIPaddr:]bootfilename]

    ● 第1個(gè)參數(shù)是loadAddress映像文件下載到的內(nèi)存地址。
    ● 第2個(gè)參數(shù)是bootfilename要下載執(zhí)行的鏡像文件。

    19)run命令

    run命令可以執(zhí)行環(huán)境變量中的命令,后面參數(shù)可以跟幾個(gè)環(huán)境變量名。

    # help run
    run - run commands in an environment variable

    Usage:
    run var [...]
        - run the commands in the environment variable(s) 'var'

    20)setenv命令

    setenv命令可以設(shè)置環(huán)境變量。

    # help setenv
    setenv - set environment variables

    Usage:
    setenv name value ...
        - set environment variable 'name' to 'value ...'
    setenv name
        - delete environment variable 'name'

    ● 第1個(gè)參數(shù)是name環(huán)境變量的名稱。
    ● 第2個(gè)參數(shù)是value要設(shè)置的值,如果沒有第2個(gè)參數(shù),表示刪除這個(gè)環(huán)境變量。

    21)sleep命令

    sleep命令可以使用TFTP協(xié)議通過(guò)網(wǎng)絡(luò)下載文件,按照二進(jìn)制文件格式下載。另外,使用這個(gè)命令,必須配置好相關(guān)的環(huán)境變量,例如serverip和ipaddr。

    help sleep
    sleep - delay execution for some time

    Usage:
    sleep N
        - delay execution for N seconds (N is _decimal_ !!!)

    sleep命令可以延遲N秒執(zhí)行,N為十進(jìn)制數(shù)。

    22)nm命令

    nm命令可以修改內(nèi)存,可以按照字節(jié)、字、長(zhǎng)字操作。

    # help nm
    nm - memory modify (constant address)

    Usage:
    nm [.b, .w, .l] address

    參數(shù)address是要讀出并且修改的內(nèi)存地址。

    23)tftpboot命令

    tftpboot命令可以通過(guò)使用TFTP協(xié)議在網(wǎng)絡(luò)上下載二進(jìn)制格式文件。

    tftpboot - boot image via network using TFTP protocol

    Usage:
    tftpboot [loadAddress] [[hostIPaddr:]bootfilename]

    24)saveenv 命令

    saveenv命令可以保存環(huán)境變量到存儲(chǔ)設(shè)備。

    # help saveenv
    saveenv - save environment variables to persistent storage

    Usage:
    saveenv

    這些U-Boot命令為嵌入式系統(tǒng)提供了豐富的開發(fā)和調(diào)試功能。在Linux內(nèi)核啟動(dòng)和調(diào)試過(guò)程中,都可以用到U-Boot的命令。但是一般情況下,不需要使用全部命令。比如已經(jīng)支持以太網(wǎng)接口,可以通過(guò)tftpboot命令來(lái)下載文件,那么就沒有必要使用串口下載的loadb。反過(guò)來(lái),如果開發(fā)板需要特殊的調(diào)試功能,也可以添加新的命令。

    本文選自華清遠(yuǎn)見嵌入式培訓(xùn)教材《從實(shí)踐中學(xué)嵌入式Linux應(yīng)用程序開發(fā)》

   熱點(diǎn)鏈接:

   1、U-Boot編譯過(guò)程解析
   2、U-Boot源代碼下載地址
   3、Bootloader的種類
   4、配置主機(jī)交叉開發(fā)環(huán)境
   5、搭建嵌入式交叉編譯環(huán)境

更多新聞>> 

主站蜘蛛池模板: 国产永久视频 | 精品国产夜色在线 | 曰本女人色黄网站 | 久久久久久亚洲精品 | 精品国产精品国产 | 久久精品一本到99热免费 | 九九热精品在线观看 | 国产综合成色在线视频 | 天天色天天综合 | 麻豆视频链接 | 国产免费麻豆 | 黄色骚视频 | 亚洲日本va午夜中文字幕一区 | 人喾交性专区免费看 | 人人干日日操 | 欧美性猛交xxx大交 欧美性猛交xxx乱大交 | 97日日碰人人模人人澡 | 欧美亚洲综合在线 | 久久99热精品这里久久精品 | 日本理论片免费观看在线视频 | 免费在线观看a级片 | 在线免费观看黄色大片 | 久久不卡 | 国产精品久久毛片 | 欧美高清一区二区 | 亚洲天堂影院 | 久久婷婷成人综合色 | 黄色片免费看 | 日本xxx片免费高清在线 | 日本xxx 高清 | 日本一区二区三区视频在线观看 | 国产福利在线视频 | 免费啪啪小视频 | 日本视频www色变态 日本视频不卡 | 国产精品v欧美精品v日韩精品 | 狂野欧美性猛交xxxx乱大交 | 久久丝袜视频 | 欧美午夜激情影院 | wwwxxx 日本| 天天摸天天躁天天添天天爽 | 毛片基地免费看 |