3.12. Running CLI commands automatically on connection

There are situations when you might want to perform various actions automatically when you connect to a target. For example, you might want load an image and stop execution at a specific point ready for debugging. To do this, you can define a sequence of CLI commands that are executed automatically after connecting to the target.

Before you define commands that run automatically on connection, be aware of the following:

To run CLI commands when you connect to a specific target:

  1. Select Target → Connect to Target... from the Code window main menu to open the Connect to Target window.

  2. Locate the required Debug Configuration:

    1. Select Configuration from the Grouped By list.

    2. Expand the Debug Interface containing the Debug Configuration of interest. For this example, expand RealView ICE.

    3. Make sure that all targets are disconnected on the Debug Configuration.

  3. Right-click on the required Debug Configuration to display the context menu. For example, right-click on RealView-ICE.

  4. Select Properties... from the context menu to open the Connection Properties dialog box.

  5. Click the Advanced button to open the Connection Properties window.

    The settings group for the Debug Configuration entry is selected, and the contents are displayed in the right pane.

  6. Create a target-specific Advanced_Information block for the target. For example, create a block called ARM940T.

  7. Click the group name you have created. For example, click ARM940T.

  8. Enter the commands to be run on the target:

    1. In the right pane, right-click on the black Commands setting to display the context menu.

    2. Select Edit Value... from the context menu.

    3. Enter the required CLI command. A new Commands setting is added for the command, colored blue.

    4. Repeat these steps for each command to be added.

      Note

      You must add the commands in the reverse order that they are to execute. However, you can change the order if required.

    Alternatively, you can define the command sequence in a script file:

    1. Specify the CLI commands and any macro definitions in a command script.

    2. Add an INCLUDE command in the Commands setting to run the command script.

      For example, to run commands in the script C:\rvd_scripts\myscript.inc, add the command:

      include 'C:\rvd_scripts\myscript.inc'

  9. Select File → Save and Close from the menu to save your changes and close the Connection Properties window.

  10. Click the OK button to close the Connection Properties dialog box.

See also:

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0182N
Non-ConfidentialID052111