Skip to main content.
Navigation:
DENX
>
DULG
>
UBootCmdGroupMemory
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
DULG
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
DULG Home
BoardSelect
Manual
FAQ
Application Notes
Changes
Index
List of pages in DULG
Search
%SECTION0{name=UBootCmdMemory}% Memory Commands %SECTION1{name=UBootCmdBase}% base - print or set address offset %INCLUDE{DULGData_%BOARD%.UBootBaseHelp}% You can use the =base= command (short: =ba=) to print or set a "base address" that is used as the address offset for all subsequent memory commands; the default value of the base address is 0, so all addresses you enter are used unmodified. However, when you repeatedly have to access a certain memory region (like the internal memory of some embedded [[PowerPC][Power Architecture]]® processors) it can be very convenient to set the base address to the start of this area and then use only the offsets: %INCLUDE{DULGData_%BOARD%.UBootBase}% %SECTION1{name=UBootCmdCrc}% crc32 - checksum calculation The =crc32= command (short: =crc=) can be used to calculate a CRC32 checksum over a range of memory: %INCLUDE{DULGData_%BOARD%.UBootCrc}% When used with 3 arguments, the command stores the calculated checksum at the given address: %INCLUDE{DULGData_%BOARD%.UBootCrcStore}% As you can see, the CRC32 checksum was not only printed, but also stored at address 0x100000. %SECTION1{name=UBootCmdCmp}% cmp - memory compare %INCLUDE{DULGData_%BOARD%.UBootCmpHelp}% With the =cmp= command you can test whether the contents of two memory areas are identical or not. The command will test either the whole area as specified by the 3rd (length) argument, or stop at the first difference. %INCLUDE{DULGData_%BOARD%.UBootCmp}% Like most memory commands the =cmp= can access the memory in different sizes: as 32 bit (long word), 16 bit (word) or 8 bit (byte) data. If invoked just as =cmp= the default size (32 bit or long words) is used; the same can be selected explicitly by typing =cmp.l= instead. If you want to access memory as 16 bit or word data, you can use the variant =cmp.w= instead; and to access memory as 8 bit or byte data please use =cmp.b=. %X% Please note that the _count_ argument specifies the number of data items to process, i. e. the number of long words or words or bytes to compare. %INCLUDE{DULGData_%BOARD%.UBootCmpExt}% %SECTION1{name=UBootCmdCp}% cp - memory copy %INCLUDE{DULGData_%BOARD%.UBootCpHelp}% The =cp= command is used to copy memory areas. %INCLUDE{DULGData_%BOARD%.UBootCp}% The =cp= command understands the type extensions =.l=, =.w= and =.b= : %INCLUDE{DULGData_%BOARD%.UBootCpExt}% %SECTION1{name=UBootCmdMd}% md - memory display %INCLUDE{DULGData_%BOARD%.UBootMdHelp}% The =md= command can be used to display memory contents both as hexadecimal and ASCII data. %INCLUDE{DULGData_%BOARD%.UBootMd}% This command can also be used with the type extensions =.l=, =.w= and =.b= : %INCLUDE{DULGData_%BOARD%.UBootMdExt}% The last displayed memory address and the value of the count argument are remembered, so when you enter =md= again _without arguments_ it will automatically continue at the next address, and use the same count again. %INCLUDE{DULGData_%BOARD%.UBootMdLength}% %SECTION1{name=UBootCmdMm}% mm - memory modify (auto-incrementing) %INCLUDE{DULGData_%BOARD%.UBootMmHelp}% The =mm= command is a method to interactively modify memory contents. It will display the address and current contents and then prompt for user input. If you enter a legal hexadecimal number, this new value will be written to the address. Then the next address will be prompted. If you don't enter any value and just press ENTER, then the contents of this address will remain unchanged. The command stops as soon as you enter any data that is not a hex number (like =.=): %INCLUDE{DULGData_%BOARD%.UBootMm}% Again this command can be used with the type extensions =.l=, =.w= and =.b= : %INCLUDE{DULGData_%BOARD%.UBootMmW}% %INCLUDE{DULGData_%BOARD%.UBootMmB}% %SECTION1{name=UBootCmdMtest}% mtest - simple RAM test %INCLUDE{DULGData_%BOARD%.UBootMtestHelp}% The =mtest= provides a <emphasis>simple</emphasis> memory test. %INCLUDE{DULGData_%BOARD%.UBootMtest}% %X% This tests writes to memory, thus modifying the memory contents. It will fail when applied to ROM or flash memory. %X% This command may crash the system when the tested memory range includes areas that are needed for the operation of the U-Boot firmware (like exception vector code, or U-Boot's internal program code, stack or heap memory areas). %SECTION1{name=UBootCmdMw}% mw - memory write (fill) %INCLUDE{DULGData_%BOARD%.UBootMwHelp}% The =mw= command is a way to initialize (fill) memory with some value. When called without a <emphasis>count</emphasis> argument, the value will be written only to the specified address. When used with a <emphasis>count</emphasis> value, the entire memory area will be initialized with this value: %INCLUDE{DULGData_%BOARD%.UBootMw}% This is another command that accepts the type extensions =.l=, =.w= and =.b= : %INCLUDE{DULGData_%BOARD%.UBootMwExt}% %SECTION1{name=UBootCmdNm}% nm - memory modify (constant address) %INCLUDE{DULGData_%BOARD%.UBootNmHelp}% The =nm= command (<emphasis>non-incrementing memory modify</emphasis>) can be used to interactively write different data several times to the same address. This can be useful for instance to access and modify device registers: %INCLUDE{DULGData_%BOARD%.UBootNm}% The =nm= command also accepts the type extensions =.l=, =.w= and =.b=. %SECTION1{name=UBootCmdLoop}% loop - infinite loop on address range %INCLUDE{DULGData_%BOARD%.UBootLoopHelp}% The =loop= command reads in a tight loop from a range of memory. This is intended as a special form of a memory test, since this command tries to read the memory as fast as possible. %X% This command will never terminate. There is no way to stop it but to reset the board! <pre> %UBOOT_PROMPT% loop 100000 8 </pre>
5.9.1. Information Commands
1. Abstract
5.9.3. Flash Memory Commands
Prev
Home
Next