Skip to main content.

5.9.2. Memory Commands

5.9.2.1. base - print or set address offset

Note: Included topic DULGData.canyonlandsUBootBaseHelp? does not exist yet

You can use the base command (short: ba) to print or set a "base address" that is used as address offset for all 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 processors) it can be very convenient to set the base address to the start of this area and then use only the offsets:

Note: Included topic DULGData.canyonlandsUBootBase? does not exist yet

5.9.2.2. crc32 - checksum calculation

The crc32 command (short: crc) can be used to caculate a CRC32 checksum over a range of memory:

Note: Included topic DULGData.canyonlandsUBootCrc? does not exist yet

When used with 3 arguments, the command stores the calculated checksum at the given address:

Note: Included topic DULGData.canyonlandsUBootCrcStore? does not exist yet

As you can see, the CRC32 checksum was not only printed, but also stored at address 0x100000.

5.9.2.3. cmp - memory compare

Note: Included topic DULGData.canyonlandsUBootCmpHelp? does not exist yet

With the cmp command you can test of the contents of two memory areas is identical or not. The command will either test the whole area as specified by the 3rd (length) argument, or stop at the first difference.

Note: Included topic DULGData.canyonlandsUBootCmp? does not exist yet

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

ALERT! 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.

Note: Included topic DULGData.canyonlandsUBootCmpExt? does not exist yet

5.9.2.4. cp - memory copy

Note: Included topic DULGData.canyonlandsUBootCpHelp? does not exist yet

The cp is used to copy memory areas.

Note: Included topic DULGData.canyonlandsUBootCp? does not exist yet

The cp understands the type extensions .l, .w and .b :

Note: Included topic DULGData.canyonlandsUBootCpExt? does not exist yet

5.9.2.5. md - memory display

Note: Included topic DULGData.canyonlandsUBootMdHelp? does not exist yet

The md can be used to display memory contents both as hexadecimal and ASCII data.

Note: Included topic DULGData.canyonlandsUBootMd? does not exist yet

This command, too, can be used with the type extensions .l, .w and .b :

Note: Included topic DULGData.canyonlandsUBootMdExt? does not exist yet

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.

Note: Included topic DULGData.canyonlandsUBootMdLength? does not exist yet

5.9.2.6. mm - memory modify (auto-incrementing)

Note: Included topic DULGData.canyonlandsUBootMmHelp? does not exist yet

The mm 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 .):

Note: Included topic DULGData.canyonlandsUBootMm? does not exist yet

Again this command can be used with the type extensions .l, .w and .b :

Note: Included topic DULGData.canyonlandsUBootMmW? does not exist yet

Note: Included topic DULGData.canyonlandsUBootMmB? does not exist yet

5.9.2.7. mtest - simple RAM test

Note: Included topic DULGData.canyonlandsUBootMtestHelp? does not exist yet

The mtest provides a simple memory test.

Note: Included topic DULGData.canyonlandsUBootMtest? does not exist yet

ALERT! This tests writes to memory, thus modifying the memory contents. It will fail when applied to ROM or flash memory.

ALERT! This command may crash the system when the tested memory range includes areas that are needed for the operation of the U-Boot firnware (like exception vector code, or U-Boot's internal program code, stack or heap memory areas).

5.9.2.8. mw - memory write (fill)

Note: Included topic DULGData.canyonlandsUBootMwHelp? does not exist yet

The mw is a way to initialize (fill) memory with some value. When called without a count argument, the value will be written only to the specified address. When used with a count, then a whole memory areas will be initialized with this value:

Note: Included topic DULGData.canyonlandsUBootMw? does not exist yet

This is another command that accepts the type extensions .l, .w and .b :

Note: Included topic DULGData.canyonlandsUBootMwExt? does not exist yet

5.9.2.9. nm - memory modify (constant address)

Note: Included topic DULGData.canyonlandsUBootNmHelp? does not exist yet

The nm command (non-incrementing memory modify) 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:

Note: Included topic DULGData.canyonlandsUBootNm? does not exist yet

The nm command too accepts the type extensions .l, .w and .b.

5.9.2.10. loop - infinite loop on address range

Note: Included topic DULGData.canyonlandsUBootLoopHelp? does not exist yet

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.

ALERT! This command will never terminate. There is no way to stop it but to reset the board!

=> loop 100000 8
5.9.1. Information Commands 1. Abstract 5.9.3. Flash Memory Commands
Prev Home Next