13.4.1 Adding flash support to an existing platform using an existing Keil flash algorithm

To use the Keil MDK flash algorithms within DS-5, the algorithm binary needs to be imported into the target configuration database and the flash configuration files created to reference the keil_flash.py script.

This example uses the flash configuration for the Keil MCBSTM32E board example in Flash programming configuration as a template to add support to a board called the Acme-Board-2000 made by MegaSoc-Co.

Procedure

  1. Copy the algorithm binary .FLM into your configuration database Flash/Algorithms directory.
  2. Copy the flash configuration file from Boards/Keil/MCBSTM32E/keil-mcbstm32e_flash.xml to Boards/MegaSoc-Co/Acme-Board-2000/flash.xml.
  3. Edit the platform's project_types.xml to reference the flash.xml file by inserting <flash_config>CDB://flash.xml</flash_config> below platform_data entry, for example:
    <?xml  version="1.0" encoding="UTF-8" standalone="no"?>
    <!--Copyright (C) 2009-2012 ARM Limited. All rights reserved.-->
    <platform_data xmlns="http://www.arm.com/project_type"
                   xmlns:peripheral="http://com.arm.targetconfigurationeditor"
                   xmlns:xi="http://www.w3.org/2001/XInclude"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"type="HARDWARE"
                   xsi:schemaLocation="http://www.arm.com/project_type../../../Schemas/platform_data-1.xsd">
                   <flash_config>CDB://flash.xml</flash_config>
  4. Edit the devices section, and create a <device> block for each flash device on the target.

    Note:

    The method_config attribute should refer to a unique <method_config> block for that device in the <method_configs> section.
  5. Optionally, create and then reference any setup or teardown script required for your board. If your board does not need these, then do not add these lines to your configuration.
    <setup script="FDB://Acme-Board-2000-Flash.py" method="setup"/>
    <teardown script="FDB://Acme-Board-2000-Flash.py" method="teardown"/>
  6. Edit the method_configs section, creating a <method_config> block for each device.

    Note:

    • The value for the algorithm parameter should be changed to the path to the algorithm copied in Step 1. The FDB:// prefix is used to indicate the file can be found in the configuration database Flash directory.
    • The coreName parameter must be the name of the core on the target that runs the algorithm. This must be the same name as used in the <core> definition within project_types.xml.

      For example, <core connection_id ="Cortex-M3" core_definition ="Cortex-M3"/>.

    • The ramAddress and ramSize parameters should be set to an area of RAM that the algorithm can be downloaded in to and used as working RAM. It should be big enough to hold the algorithm, stack plus scratch areas required to run the algorithm, and a sufficiently big area to download image data.
    • The other parameters do not normally need to be changed.
Non-ConfidentialPDF file icon PDF versionARM DUI0446Z
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.