17.4.6. Flash programming

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

FME files include:

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

The board-specific assembler and Flash memory programming files are installed in a directory called program_directory\flash, as part of the base product. The board-specific files have names starting with b_, for example b_board.s. The Flash memory files have names starting with f_, for example f_MCUeval.s.

RealView Debugger projects to create FME files from these sources are also provided, for example in program_directory\flash\examples\...

Programming an image to the evaluation board Flash target

This example describes how to use the predefined evaluation board Flash configuration to write an image to the Flash memory on the Integrator system board.

Note

If you program the Flash on your evaluation board using this release of RealView Debugger, you bypass the 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 trying the example.

The example is split into these sections, which must be executed in this sequence:

Defining the new target

To configure the Flash target:

  1. Ensure that RealView Debugger is not connected to a target.

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

  3. Set the BoardChip_name of the CONNECTION to MCUeval, so that the predefined board file is used for this connection.

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

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

  6. Click on the Log tab in the Output pane, shown in Figure 17.27. This includes the line:

    Using BoardChips: MCUeval
    

    This tells you that RealView Debugger is using the MCUeval Board/Chip Definition file (MCUeval.bcd). As a result, the memory map now contains the definitions required to use the Flash memory on your evaluation board.

    Figure 17.27. Output pane after configuration

    Output pane after configuration
Programming the image into Flash

To program the image, you request RealView Debugger to write to the Flash memory region that you have defined by using the MCUeval board file. For example, the MCUeval Flash starts at memory address 0x04000000, so to write an image to flash:

  1. If necessary, create an image file compiled to run with code at 0x04000000 and that has data in RAM.

    Note

    The values for your evaluation board might be different. See the documentation of your evaluation board for these values.

    This example uses the dhrystone project, located in your examples_directory\dhrystone directory. Open the project and rebuild using modified linker options. Set the Link_Advanced values in the BUILD group using Ro_base = 0x04000000 and Rw_base = 0x8000.

  2. Click File → Load Image... and select the image file.

  3. Click Open in the Load File to Target dialog. The Flash Memory Control dialog appears, shown in Figure 17.28.

    Figure 17.28. The Flash Memory Control dialog

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

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

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