Reprinted uboot command

Source: Internet
Author: User
Tags crc32 crc32 checksum echo command

1. bootm

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

The bootm command can boot the program image stored in memory. These memories include Ram and Flash files that can be stored permanently.

The 1st parameter ADDR is the address of the program image. The program image must be converted to the U-boot format.

The 2nd parameters are useful for Linux kernel boot. They are generally used as the ramdisk image storage address in the U-boot format. They can also be the parameters passed to the Linux kernel (the bootargs environment variable is passed to the kernel by default ).

Note: The binary code must be formatted. It is generally a binary file processed by mkimage. Start the compressed Linux kernel created by uboot tools, bootm 3200000

 

2. BOOTP

BOOTP [loadaddress] [bootfilename]

In a bootp request, The BOOTP Command requires the DHCP server to allocate an IP address and then download the specified file to the memory through the TFTP protocol.

The 1st parameters are the memory address of the downloaded file.

The 2nd parameters are the name of the file to be downloaded. The file should be prepared on the Development host.

Note: When the network is enabled, you must set the hardware address bdinfo in advance to print arm information.

 

3. CMP

CMP [. B,. W,. L] addr1 addr2 count

-Compare memory

The CMP command can compare the content in two pieces of memory .. B is in bytes;. W is in words;. L is in long words. Note: Do not retain spaces in the middle of CMP. B. You need to enter the command continuously.

The first parameter addr1 is the starting address of the first block of memory.

The first parameter addr2 is the starting address of the second memory.

The Count parameter is the number to be compared. The unit is byte, word, or long word.

 

4. CP

CP [. B,. W,. L] Source Target count

-Copy memory

The CP command can copy data blocks in the memory, including read/write operations on flash.

The Source Parameter contains the starting address of the data block to be copied.

The 2nd target parameter is the address to be copied to the data block. If the address is in flash, it will directly call the function operation for writing flash. Therefore, use this command for U-boot flash writing. Of course, you need to clean the corresponding flash area first.

The Count parameter is the number of copies. The unit is byte, word, and long word, respectively, based on CP. B CP. W CP. L.

 

5. CRC32

CRC32 address count [ADDR]

-Compute CRC32 checksum [Save at ADDR]

The CRC32 command can calculate the checksum of stored data.

The 1st parameter address is the start address of the data to be verified.

The Count parameter indicates the number of data bytes to be verified.

The 3rd ADDR parameter is used to specify the address for saving the result.


6. Echo

Echo [ARGs...]

-Echo ARGs to console; C suppresses newline

Echo command echo parameters.

Usage: Echo $ (bootcmd)


7. Erase

Erase start end

-Erase flash from ADDR 'start' to ADDR 'end'

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

The erase command can be used to clean flash.

The parameter must specify the flash erasure range.

According to the start address and end address, start must be the start address of the erased block; end must be the end address of the erased end block. This method is the most common. Example: run the erase 20000 3 FFFF command to erase 0x20000-0x3ffff.

By group and sector, N indicates the flash group number, SF indicates the start fan area number, and SL indicates the end fan area number. In addition, the entire flash group with group number N can be erased. To erase all Flash files, you only need to give an all parameter.

Usage:

Run this command before writing data.

Usage: erase 0xc ******* + 0 xyyyyyyyy

Description: deletes the 0xyyyyyyyy bytes starting with 0xc ******* (bytes must be block aligned)

Example:

Z228 # erase 0xc4040000 + 0x180000

...................... Done

Erased 24 sectors

Additional: erase 1:0-2 (delete the 0-2 sector of each flash)

H. CP. B

Copy data from the specified source address to the target address. The address can be Ram or nor flash.

Usage: CP. B 0x ******** 0x ######### 0 xyyyyyyyy

Note: copy the source 0x ******** to the target 0x ########. A total of 0xyyyyyyy bytes are copied.

Example:

Z228 # cp. B 0x200000 0xc4040000 0x180000

Copy to flash... Done

 

8. flinfo

Flinfo

-Print information for all flash memory banks

Flinfo n

-Print Information for flash memory bank # N

The flinfo command prints the information of all flash groups, or only one of them can be printed. Generally, there is only one set of flash in embedded systems.

 

9. Go

Go ADDR [arg...]

-Start application at address 'add'

Passing 'arg 'as arguments

The go command can run applications.

The 1st parameters are the entry address of the program to be executed.

2nd Optional parameters are the parameters passed to the program.

 

10. iminfo

Iminfo ADDR [ADDR...]

-Print header information for application image starting

Address 'addr 'in memory; this includes des verification of

Image contents (magic number, header and payload checksums)

Iminfo can print the start information of the program image, including the verification of the image content (serial number, header, and checksum ).

The first parameter specifies the starting address of the image.

The optional parameter specifies more image addresses.

 

11. loadb

Loadb [off] [baud]

-Load binary file over serial line with offset 'off' and baudrate 'baud'

The dknlinux Alliance loadb command can download binary data through the serial port Kermit protocol.


12. Loads

Loads [off]

-Load S-record file over serial line with offset 'off'

The loads command can be used to download files in the S-record format through a string.

 

13. mW

MW [. B,. W,. L] address value [count]

-Write memory

The MW command of the dknlinux alliance can write memory in bytes, words, and long words. The usage of. B. W. L is the same as that of the CP command.

The 1st parameter address is the memory address to be written.

The value of the 2nd parameter is the value to be written.

The 3rd optional parameter count is the number of unit values to be written.

Usage: MW 32000000 FF 10000 (set the 0x10000 bytes starting with memory 0x32000000 to 0xff)

 

14. Nm

NM [. B,. W,. L] address

-Memory modify, read and keep address

The nm command can modify the memory, which can be operated by byte, word, and long word.

The address parameter is the memory address to be read and modified.

 

15. md

Display the content of the memory area.

 

16. Mm

Read or modify the memory. The address increases automatically.

MM memory address press ENTER


Press enter to keep the original content unchanged. To change the content, enter a value after the question mark and press enter to exit.


17. NFS

NFS [loadaddress] [Host ip addr: bootfilename]

The NFS command can start the image over the network using the NFS network protocol.

Usage:

NFS 32000000 192.168.0.2: aa.txt
Read aa.txt in the nfsfile System of Linux 192.168.0.2 into the memory 0x32000000.

 

18. Printenv

Printenv

-Print values of all environment variables

Printenv name...

-Print value of environment variable 'name'

The printenv command prints environment variables.

All environment variables can be printed, or only environment variables listed in parameters can be printed.

 

19. Protect

Protect on start end

-Protect flash from ADDR 'start' to ADDR 'end'

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 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

The protect command is a write protection operation for flash, which can enable and disable write protection.

The 1st on parameter indicates Enable write protection; The off parameter indicates that write protection is disabled.

The 2nd and 3 Parameters specify the flash write protection operation range, which is the same as the erasure method.

Usage:

Protect on 1:0-3 (that is, to protect the 0-3 Sector of the first flash)

Protect off 1:0-3 cancel write Protection

Protect off bank 1 lift/Enable write protection for block N flash

 

20. rarpboot

Rarpboot [loadaddress] [bootfilename]

The rarboot command can use the TFTP protocol to start the image over the network. That is, download the specified object to the specified address and run the command.

The 1st parameters are the memory address to which the image file is downloaded.

The first parameter is the image file to be downloaded.

 

21. Run

Run var [...]

-Run the commands in the environment variable (s) 'var'

The run command can be used to execute the commands in environment variables. The following parameters can be followed by several environment variable names.

Usage:

Uboot> setenv flashit TFTP 20000000 mycode. bin \; erase 10020000 1002ffff \;
CP. B 20000000 10020000 8000
Uboot> saveenv
Uboot> RUN flashit

 

22. setenv

Setenv name value...

-Set environment variable 'name' to 'value ...'

Setenv name

-Delete environment variable 'name'

The setenv command can be used to set environment variables.

The first parameter is the name of the environment variable.

The first parameter is the value to be set. If there are no 2nd parameters, the environment variable is deleted.

Usage:

Uboot> setenv myboard at91rm9200dk
Uboot> printenv
Baudrate = 115200
Ipaddr = 192.168.1.1
Ethaddr = 12: 34: 56: 78: 9A: BC
Serverip = 192.168.1.5
Myboard = at91rm9200dk
Environment size: 102/8188 bytes

 

23. saveenv

Save Environment Variables

Command to save all the Defined variables and their values to flash. The space used to store variables and their values is only 8 KB and should not exceed.

 

24. Sleep

Sleep n

-Delay execution for n seconds (N is _ decimal _!!!)

The sleep command can be executed with a delay of n seconds. N is a decimal number.

 

25. tftpboot

Tftpboot [loadaddress] [bootfilename]

The tftpboot command can use the TFTP protocol to download files over the network. Download in binary format. In addition, related environment variables must be configured to use this command. For example, serverip and ipaddr.

The loadaddress parameter contains the downloaded memory address.

The 2nd parameters are the names of the files to be downloaded and must be placed in the corresponding directory of the TFTP server.

 

26. Ping

Note: Only the Development Board can be pinged to other machines

 

27. USB

USB start: Start the USB Function
USB info: List Devices
USB scan: scans USB storage (USB disk) Devices

 

28. kgo

Start a Linux kernel without compression

Kgo 32000000

 

29. fatls

List dos fat file systems

Fatls USB 0 list files in the first USB flash drive

 

30. fatload

Read a file in fat.

Fatload USB 0: 0 32000000 aa.txt read aa.txt in USB to the physical memory 0x32000000!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.