Note: This procedure assumes that you have imported a pre-defined Flash Programmer task in the
Target Tasks view. It also assumes that you have previously created other tasks, so that the
Target Tasks view is visible. If it is not visible, perform the steps in the
Working with Flash Programmer topic to open the
Target Tasks view.
- Go to the Target Tasks view in either the C/C++ or Debug perspective.
- Right-click in the Target Tasks view and select Import . Alternatively, click the Import icon on the Target Tasks view toolbar.
The
Open
dialog box appears.
- Navigate to the pre-defined tasks folder at <CW MCU install>\MCU\bin\plugins\support\TargetTask\Flash_Programmer\ and select the desired .xml file for your hardware target. For example, select M52277EVB_SPI.xml.
- Click Open.
The selected task appears in the
Target Tasks
view.
Figure 1. Pre-defined Task in Target Tasks View 
Note: The predefined erase/program tasks are not mandatory for diagnostics.
- Right-click on the task's name and select Execute.
The task's Flash Programmer actions execute in sequence. First, they erase the
hardware target's flash memory. Next, they check whether the flash is correctly
erased. If true, they program the file's code into the flash and check if it programmed
without errors.
Note: When a predefined flash programmer task is imported, its Run Configuration is set as Active Debug Context. If the task is imported and there is no active debug session, then the Execute icon will be disabled as in. Associate the selected target task to a different Run Configuration to enable the Execute icon.
- Double-click on the task name, to examine the task stored Flash Programmer actions.
The <target>
Flash Programmer Task
editor window appears.
Figure 2. <target> Flash Programmer Task Editor Window 
- Select the Diagnostics action from the Add Action drop-down list.
The
Add Diagnostics Action
dialog box appears. It displays the flash devices and the
base addresses.
Note: The full diagnostics does the same thing as diagnostics but also prints the blank status for sectors. It can take significantly longer to complete.
Note: If more than one flash is available in Flash Devices table, the Add Diagnostics Action table lets you select the flash where you want to run the diagnostics.
Figure 3. Add Diagnostics Action Dialog Box 
- Check the Perform Full Diagnostics checkbox if you want to perform complete diagnostics on the selected flash device.
- Select the Diagnostics action from the Add Action drop-down list.
You get a popup with a status that the device is added.
Figure 4. Add Diagnostics Actions Dialog Box - Popup with Status 
- Click Done.
The
Add Diagnostics Action
dialog box closes. The action appears in the
Flash Programmer Actions
table of the <target>
Flash Programmer Task
editor window.
Figure 5. Flash Programmer Actions Table 