7.5.5. Filling memory with a pattern

To fill a specified area of memory with a predefined pattern:

  1. Select Target ? Reload Image to Target to reload the image dhrystone.axf.

  2. Click on the Src tab to view the source file dhry_1.c.

  3. Set a default breakpoint by double-clicking on line 301.

  4. Click Run to start execution.

  5. Enter 5000 when asked for the number of runs.

    The program starts and then stops when execution reaches the breakpoint at line 301. The red box marks the location of the PC when execution stops.

  6. Select View ? Memory to display the Memory pane.

  7. Double-click in the address column of the Memory pane, and enter 0x88A0 to view the memory contents at that location.

  8. Select Debug ? Memory/Register Operations ? Fill Memory with Pattern... from the Code window main menu to display the Fill Memory with Pattern dialog box, shown in Figure 7.4.

    Figure 7.4. Fill Memory with Pattern dialog box

    Fill Memory with Pattern dialog box
  9. Set up the required memory settings:

    Start:

    Enter the start address for the memory range to be filled, for example 0x88A0.

    If required, use the drop-down arrow to select a previously used start address from the stored list.

    End/Len:

    By default, the memory area that is filled is defined by a start address and a length. Enter the length of the memory block to be filled in this data field, for example 14 (decimal).

    The specified length must be given relative to the data type given in the Size data field.

    If the Use Length (Count) check box is unselected, you can specify the address that marks the end of the memory block.

    Size:

    Enter the data type to be used in the file where:

    • natural indicates the format specified as native for the debug target

    • byte indicates support for 8-bit signed and unsigned byte form

    • half-word indicates support for 16-bit signed and unsigned halfwords

    • long-word indicates support for 32-bit signed and unsigned words.

    Use Length (Count)

    By default, the memory block to be filled is defined by a start address and the length. If this check box is unselected you can specify an address to mark the end of the filled block.

    Pattern:

    Enter the pattern to be used as the fill, for example:

    “AB”

    0,1,0,1,0

    Note

    Strings must be enclosed in quotes.

  10. Click OK to confirm your settings and close the Fill Memory with Pattern dialog box. Memory contents are rewritten and the Memory pane is automatically updated with changed values displayed in blue.

  11. Double-click on the red marker disc to clear the breakpoint at line 301.

When filling memory blocks, you must be aware of the following:

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0153G
Non-Confidential