|Non-Confidential||PDF version||ARM DUI0446Z|
|Home > File-based Flash Programming in ARM DS-5 > About creating a new flash method > 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
folder>\sw\debugger\configdb\Flash\flashprogrammer for a default
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:
setup()function prepares the target for performing flash programming. This might involve:
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.
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.
teardown()functions are not to be confused with the target platform optional
teardown()functions defined in the flash method class are for the method itself and not the board.