13.7 About flash method parameters

Programming methods can take parameters that serve to change the behavior of the flash programming operation.

Example parameters could be:

  • The programming algorithm image to load, for example, the Keil Flash Algorithm file.
  • The location & size of RAM the method can use for running code, buffers, and similar items.
  • Clock speeds.
  • Timeouts.
  • Programming and erase page sizes.

The default values of the parameters are taken from the flash configuration file.

Note:

You can override the parameters from the DS-5 command line.

The programming method can obtain the value of the parameters with:

  • getParameter(name) returns the value of a parameter as a string. The method can convert this to another type, such as integers, as required. None is returned if no value is set for this parameter.
  • getParameters() returns a map of all parameters to values. Values can then be obtained with the [] operator.

For example:

def setup(self):
    # get the name of the core to connect to
    coreName = self.getParameter("coreName")
 
    # get parameters for working RAM
    self.ramAddr = int(self.getParameter("ramAddress"), 0)
    self.ramSize = int(self.getParameter("ramSize"), 0)
Non-ConfidentialPDF file icon PDF versionARM DUI0446Z
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.