8.4.4. Flash programming

Before you can use RealView Debugger to control a Flash device on your target, you must:

The following example describes how to use the FME file to program Flash memory on the your evaluation board.

The board specific assembler and Flash memory programming files are installed as part of the root installation, in program_directory\flash\examples, see Flash definition files for details.

This example describes how to use the predefined Flash configuration for your evaluation board to write an image to the Flash memory on the board, connected using RealView ICE Micro Edition (RVI-ME). The example is split into sections, which must be executed in this sequence:

  1. Defining your target

  2. Programming the image into Flash.

Note

If you program the Flash on your evaluation board using this release of RealView Debugger, you bypass the ARM® Firmware Suite (AFS) Flash library system information blocks. These blocks are used by the AFS Flash Library, and are stored at the end of each image written to Flash. If you rely on these blocks to keep track of what is in the Flash memory of your target, keep a record of the state and recreate it after working through the example.

Defining your target

To configure the Flash target:

  1. Start up RealView Debugger without connecting to a target.

  2. Select File → Connection → Connect to Target... to display the Connection Control window.

  3. Right-click on the entry RVI-ME and select Connection Properties... from the context menu.

    This displays the Connection Properties window where you can view configuration settings stored in your board file.

  4. Click on the entry CONNECTION=RVI-ME, in the left pane, to display the settings values in the right pane.

  5. Right-click on the entry BoardChip_name and select the name of your evaluation board from the context menu. This means that the associated board file (boardname.brd) is used for this connection.

  6. Select File → Save and Close to close the Connection Properties window.

  7. Connect to the target using the Connection Control window.

  8. Click on the Log tab in the Output pane to see that RealView Debugger is using the board file for your evaluation board.

  9. Select View → Pane Views → Memory Map to display the Map tab where you can see the Flash memory on your evaluation board.

In this example, memory has been mapped, using a board/chip definition file, to declare Flash.

Programming the image into Flash

To program the image, you ask RealView Debugger to write to the Flash memory region that you have defined in the board file. The Flash on your evaluation starts at memory address 0x04000000, so to write an image to Flash:

  1. Build an image compiled to run with code at 0x04000000 and that has data in RAM.

    This example uses the dhrystone program stored in the examples_directory\dhrystone directory in your root installation. Open the project and rebuild using modified linker options.

    Set the Link_Advanced settings in the BUILD group:

    • Ro_base = 0x04000000

    • Rw_base = 0x8000.

  2. Select File → Load Image... to load your image. This displays the Load File to Target dialog box where you can locate the required image.

  3. Click Open in the Load File to Target dialog box. This displays the Flash Memory Control dialog box, shown in Figure 8.2.

    Figure 8.2. Flash Memory Control dialog box

    Flash Memory Control dialog box
  4. Click Write to program the image into Flash.

  5. Click Close to close the Flash Memory Control dialog box.

  6. Click on the Cmd tab in the Output pane to see the Flash operations.

  7. Select View → Pane Views → Memory Map to display the Map tab where you can see the Flash memory on your evaluation board.

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B
Non-Confidential