Multi-Emulator Debug with CCS

From Texas Instruments Wiki
Jump to: navigation, search

Overview

It may be possible to create a single debug session for multiple devices, each connected to the host machine by a separate debug probe (emulator). The level of support for this varies depending on the devices and emulators used. This wiki article details on how to to this.

NOTE: It is also possible to have two separate running instances of CCS communicating to to different debug probes (connected to two different targets) at the same time. This scenario is a bit simpler than the first since you do not need a single target configuration (ccxml) file for both debug probes. But the same rules apply regarding CCS needing a way to differentiate between debug probes of the same type that are connected to the host.

Different Type Multi-Emulator Configurations

These configurations are multi-emulator configurations where each emulator uses a different connection type. A connection type is what appears in the 'Connection' drop-down list in the Target Configuration Editor. Examples of a connection type are 'Texas Instruments XDS100v3 USB Debug Probe' or 'Spectrum Digital XDS560V2 USB TRAVELER Emulator'. Note that it is possible to have a multi-emulator target configuration of the same emulator class (ex. two XDS510USB) but using two different connection types because the vendors are different and each have their own connection type ('Spectrum Digital XDS510USB Emulator' and 'Blackhawk USB510 Emulator').

Multi-emulator configurations that use different connection types require a custom target configuration which include both emulators and the device(s) they are connected to. You must create a custom configuration using the 'Advanced' target configuration editor. The basics of creating custom target configurations is documented in here.

An example of an mixed multi-emulator target configuration for a cc2560 target with an XDS100v3 connection and an F2812 target with an XDS200 connection is shown below:

Target Configuration Editor - Mixed Multi-Emulator Configuration

When a multi-emulator configuration is created, both emulator/target is visible in the Debug view:

Multi-Emulator Debug Session

NOTE: It is NOT possible to have a mixed multi-emulator configuration that consists of XDS560, XDS560v2 or XDS200 emulators. For example, you cannot have a single configuration that has one XDS560v2 and one XDS200 emulator (though it is possible to have two XDS560v2 or two XDS200 in a single configuration).

Same Type Multi-Emulator Configurations

Using multiple emulators that use the same connection type is a bit more tricky. This is because CCS needs to know how to distinguish between the emulators and because the connection type is the same, it needs some other way to differentiate. This is usually done by associating the serial number of the emulator to the connection type, or the I/O port number that the emulator is connected to. In some cases, both identifiers are used.

XDS100

Multiple XDS100 emulators can be differentiated with their Serial Numbers. To find the serial numbers of all XDS100 emulators attached to the host machine, see this FAQ for XDS100.

In the cases where an emulator does not have a serial number programmed, or multiple emulators have the same serial number, the serial number must be reprogrammed. To change the serial number, see this FAQ for XDS100.

Once the serial numbers for each XDS100 is known (an reprogrammed if needed), create a custom target configuration which include both emulators and the device(s) they are connected to. You must create a custom configuration using the 'Advanced' target configuration editor. The basics of creating custom target configurations is documented in here.

Once you have added all emulators (and the device(s) they are connected to), go to each emulator entry and change the 'Emulator Selection' field to 'Select by serial number' and then enter the serial number for that emulator in the '-- Enter the serial number' field.

Target Configuration Editor - XDS100 Multi-Emulator Configuration

Save your configuration and your target configuration file is now configured to launch a debug session for both emulator targets. Test your configuration by launching a debug session for your new target configuration file.

An example on how to do this is shown in the video below:

XDS110

Multi-emulator debug for XDS110 is supported and work similarly to the XDS100 above. Like the XDS100, multiple XDS110 emulators can be differentiated with their Serial Numbers. To find the serial numbers of all XDS110 emulators attached to the host machine, run the xdsdfu command found in: <CCS INSTALL DIR>\ccsv[x]\ccs_base\common\uscif\xds110.

Target Configuration Editor - XDS110 Multi-Emulator Configuration

NOTE: Serial numbers for the XDS110 must be 8 characters long. Otherwise it will cause an error in a multi-emulator environment. If it is not 8 characters, please use the xdsdfu command to set a serial number of 8 characters long.

Once the serial numbers for each XDS110 is known (and reprogrammed if needed), create a custom target configuration which include both emulators and the device(s) they are connected to. You must create a custom configuration using the 'Advanced' target configuration editor. The basics of creating custom target configurations is documented in here.

Once you have added all emulators (and the device(s) they are connected to), go to each emulator entry and change the 'Emulator Selection' field to 'Select by serial number' and then enter the serial number for that emulator in the '-- Enter the serial number' field.

Target Configuration Editor - XDS110 Multi-Emulator Configuration

Save your configuration and your target configuration file is now configured to launch a debug session for both emulator targets.

XDS200

Multi-emulator debug for XDS200 is supported. Similar to the XDS100, it does not matter if the emulator vendors are different because all XDS200 emulators of the same model share the same connection type. Multiple XDS200 emulators of the same connection type can be differentiated with their I/O Port number. If there is just one XDS200 emulator connected, the port number is '0'. Additional XDS200 emulators connected would take the next number after (1, 2, etc). So the first XDS200 connected to the host machine would have a port number of '0' and the second one connected afterwards would have a port number of '1'.

You must create a custom target configuration which include both emulators and the device(s) they are connected to. This can be done using the 'Advanced' target configuration editor. The basics of creating custom target configurations is documented in here.

Once you have added all emulators (and the device(s) they are connected to), go to each emulator entry and enter the correct port number for that emulator in the the 'Debug Probe I/O Port Number' field.

Target Configuration Editor - XDS200 Multi-Emulator Configuration

Spectrum Digital XDS510USB

Multiple Spectrum Digital XDS510USB emulators can be differentiated with their Emulator I/O Port number or Serial Number. Instructions on how to determine the port numbers and serial numbers and how to use this information in CCS is documented in the SdConfig Setup section on pages 3-5 of this Tech Note documentation from Spectrum Digital.

You must create a custom configuration which include all emulators and the device(s) they are connected to. Note that the above tech note describes steps to create a multi-emulator target configuration on CCSv3. The steps for CCSv4 and greater are different and require using the 'Advanced' target configuration editor. The basics of creating custom target configurations is documented in here.

Once you have added all emulators (and the device(s) they are connected to), go to EACH emulator entry and specify the 'Emulator I/O Port Number' that applies to the emulator.

Target Configuration Editor - XDS510 Multi-Emulator Configuration

Spectrum Digital XDS560v2

Multiple Spectrum Digital XDS560v2 emulators can be differentiated with their Emulator I/O Port number or Serial Number. Instructions on how to determine the port numbers and serial numbers and how to use this information in CCS is documented in this Tech Note documentation from Spectrum Digital.

The above tech note describes how to differentiate between emulators attached to the host machine for a single emulator debug session. For a multi-emulator debug session, the steps are similar except for the need create a custom multi-emulator target configuration which include all emulators and the device(s) they are connected to. You must create a custom configuration using the 'Advanced' target configuration editor. The basics of creating custom target configurations is documented in here.

Once you have added all emulators (and the device(s) they are connected to), go to EACH emulator entry and update the 'Emulator I/O Port Number' field as described in the tech note.

Blackhawk XDS560v2 Mezzanine Card

Multiple Blackhawk XDS560v2 Mezzanine Cards can be differentiated with their Emulator I/O Port number. Each emulator is assigned an individual port number. The Blackhawk Control Panel can be used to detect all the emulators and their port numbers.

Blackhawk Control Panel

In the screenshot above, there are two BH560v2 mezzanine card emulators detected. Each entry has the following format: <PORT NUMBER>:<EMULATOR NAME>:<SERIAL NUMBER>

The issue in the screenshot is that name and serial numbers are identical for both emulator entries. Hence this is not very helpful because it is necessary to be able to determine exactly which physical emulator has which port number when we are configuring the target setup in CCS. While the name cannot be changed, Blackhawk DOES provide a utility to change the serial number. This utility (BH560v2MezzCfg) is available from Blackhawk's website. Note that the utility must be copied into a specific location in your CCS directory: <INSTALL DIR>\ccsv5\ccs_base\common\uscif

NOTE: If the serial numbers for your emulators differ, then you can use the BH560v2MezzCfg utility to determine which physical emulator is associated with which serial number.

Before running the utility, make sure one of the two emulators are disconnected. This is because the utility can only detect the emulator on port 0 so it is important to know exactly which physical emulator it is detecting (otherwise you are back to square one if you don't know which physical emulator got its serial number changed). When disconnecting one emulator, there should only be an entry for the one still connected, and that will have port '0':

Blackhawk Control Panel

Now open a command window and browse to the location of the utility and run the utility. Do the following:

  1. Enter 'y' to continue running the utility when prompted
  2. Enter a value from 0 and 255 to change the last two digits of the serial number. Make sure a value that differs from the current value is chosen
  3. Enter 'y' to confirm your change

The utility will then proceed with the serial number update. It will take a minute or two to complete the update and reboot the emulator. Wait for the 'done' message.

BH560v2MezzCfg Utility

When all is finished, the Blackhawk Control Panel will show the entry with the updated serial number:

Blackhawk Control Panel

Keep note of this new serial number and which physical emulator it is associated with.

Now connect the other emulator to the host machine. You will see both emulators again, except each entry will have a different serial number. Now you know which physical serial number is associated with which port number.

Blackhawk Control Panel

Next, create a custom target configuration which include both emulators and the device(s) they are connected to. You must create a custom configuration using the 'Advanced' target configuration editor. The basics of creating custom target configurations is documented in here.

Once you have added both emulators (and the device(s) they are connected to), go to the emulator entry that is associated with the emulator connected to port number '1' and update the 'Emulator I/O Port Number' field to 'I/O Port=1'.

Target Configuration Editor

Save your configuration and your target configuration file is now configured to launch a debug session for both emulator targets. Test your configuration by launching a debug session for your new target configuration file. As shown in the below screenshot, a debug session consisting of a BH560v2 mezzanine emulator connected to a C6657 and a BH560v2 mezzanine emulator connected to a C6678 has been successfully started and all cores of both devices have been connected to:

Multi-Emulator Debug Session

MSP430

A single debug session consisting of multiple MSP430 connection types is not supported. However, you can still have multiple simultaneous instances (up to three) of CCS, with each one starting a debug session for a different target.

Stellaris ICDI

A single debug session consisting of multiple Stellaris ICDI connection types is not supported.