13.5.1 About using the default implementation FlashMethodv1

Flash programming methods are written as Python classes that are required to implement the com.arm.debug.flashprogrammer.IFlashMethod interface. This interface defines the methods the flash programming layer of DS-5 Debugger might invoke.

See the flash_method_v1.py file in the <Install folder>\sw\debugger\configdb\Flash\flashprogrammer for a default implementation of com.arm.debug.flashprogrammer.FlashMethodv1. This has empty implementations of all functions - this allows a Python class derived from this object to only implement the required functions.
Running a flash programming method is split into three phases:
  1. Setup - the setup() function prepares the target for performing flash programming. This might involve:
    • Reading and validating parameters passed from the configuration file.
    • Opening a connection to the target.
    • Preparing the target state, for example, to initialize the flash controller.
    • Loading any flash programming algorithms to the target.
  2. Programming - the program() function is called for each section of data to be written. Images might have multiple load regions, so the program() function might be called several times. The data to write is passed to this function and the method writes the data into flash at this stage.
  3. Teardown - the teardown() function is called after all sections have been programmed. At this stage, the target state can be restored (for example, take the flash controller out of write mode or reset the target) and any debug connection closed.

    Note

    The setup() and teardown() functions are not to be confused with the target platform optional setup() and teardown() scripts. The setup() and teardown() functions defined in the flash method class are for the method itself and not the board.
Non-ConfidentialPDF file icon PDF versionARM DUI0446W
Copyright © 2010-2015 ARM. All rights reserved.