14.5. Loading the contents of a file into memory

You can load all or part of the contents of a file into target memory.

Before you can load the contents of a file into target memory, you must have downloaded a memory range into a file:

To load the contents of a file into memory:

  1. Select Debug → Memory/Register Operations → Upload/Download Memory file... from the Code window main menu to display the Upload/Download file from/to Memory dialog box. Figure 14.22 shows an example.

    Figure 14.22. Upload/Download file from/to Memory dialog box

    Upload/Download file from/to Memory dialog box

  2. Specify the operation and set up the controls, as follows:

    1. Select the Load File into Memory radio button.

    2. In the File: field, enter the full pathname of the file to use to read/write memory values.

    3. In the Type of File section of the dialog, select the data type that you used when the specified file was saved:

      • obj specifies an object file in the standard executable target format, for example ARM-ELF for ARM architecture-based targets.

      • raw specifies raw data using the most efficient access size for the target.

      • raw32 specifies a data file as a stream of 32-bit values.

      • raw16 specifies a data file as a stream of 16-bit values.

      • raw8 specifies a data file as a stream of 8-bit values.

      • ascii specifies a space-separated file of hexadecimal values. A header line at the start of the file describes the file format:

        [start,end,size]
        

        where:

        • start and end specifies the address range

        • size is a character that indicates the size of each value, where b is 8 bits, h is 16 bits and l is 32 bits.

    4. In the Location: field, specify the start location of the memory block where the contents are to be written:

      • If the file type is obj, then you have only to specify a start location, for example:

        • 0x88A0

        • main

      • If the file type is ascii, then specify a signed offset from the start location that is stored in the ASCII file.

        For example, if the stored location is 0x8000 and you want to load the file starting at 0x9000, then enter 0x1000.

      • If the data type is one of raw, raw8, raw16, or raw32, then you can enter:

        • a start address (0x88A0)

        • an address range (0x88A0..0x8980)

        • a start address and length (0x88A0..+1000 or main..+1000).

        If you specify an address range or a start address and length that is greater than the size of the file, then RealView Debugger stops writing to memory when the end of the file is reached. For example, if 50 bytes of memory are stored in the file, and you specify a length of 100, then only 50 bytes are written to memory.

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

  3. Click Apply to load the memory from the specified file.

    If you are loading to Flash, then the Flash Memory Control dialog box is displayed.

  4. Click Close to close the Upload/Download file to/from Memory dialog box.

See also:

Copyright © 2002-2009 ARM Limited. All rights reserved.ARM DUI 0153K
Non-Confidential