USBDM  V4.12
Codewarrior - Coldfire V2-V4 Flash programming

Creating a Flash Programming Task in Codewarrior 10.x

USBDM does not support the automatic programming of Coldfire V2 - V4 devices as the programming algorithms required are too varied between different devices. This situation is no different from the arrangement that applies to the other Codewarrior supported BDM interfaces.
Codewarrior Eclipse allows the creation of Flash programming tasks which may then be automatically executed prior to debugging a device. The following describes the setting up of a such a task for a MCF52233.
Open the Flash Programmer as shown:

Click on the Green Plus to add a new task

Choose a suitable name for the Task and complete the required details.

  • Run Configuration - Associate with the current task
  • Task Type - Choose the CFV234 Flash Programmer

The dialogue that opens allows the selection of target device and the necessary Flash programming Actions to be scheduled as a sequence of steps that will be automatically carried out.

  • Click on the Add Device button and choose the device to be programmed.
    You can type a partial device type to reduce the number of alternatives displayed.
    Select a device and click on the Add Device button to add it.

Click Done to close this dialogue when finished.

Select the Add Erase/Blank Check Action from the Add Action drop-down

The following actions selected are added to the original dialogue.

  • Select Erase All Sectors Using Chip Erase Command checkbox so that actions are applied to the entire Flash.
  • Click on Add Erase Action button to do a mass erase of the device.
  • Click on Add Blank Check Action button to add a check for successful erasure.
  • Click Done to close this dialogue when finished.
  • Select Use File From Launch Configuration checkbox so that target initialization settings will be taken from the associated debugging Launch Configuration.
  • Click on Add Program Action button to program the device.
  • Click on Add Verify Action button to add a programming verification.
  • Click Done to close this dialogue when finished.

The final step in setting up the Flash programmer is determining a suitable location for the Target RAM buffer required to hold the Flash Programming code and Flash data buffer. Unfortunately on the Coldfire chips this is movable and depends upon how the target is configured.
The easiest way (that I've found) to determine a suitable location is to inspect the linker configuration for the project being debugged.
Look under Project_Settings/Linker_Files for the appropriate .lcf file, in this case MCF52232_Internal_Flash.lcf.

Look for the Memory section as shown and note the settings for the two (RWX) sections. You can choose a suitable RAM buffer from these two.

In this case I've used all the available RAM from the start of the first section 0x20000000 for the combined size of 0x8000 since the two sections are contiguous.

Now that we have created a programming task we need to set up the debug launch configuration so that this task runs automatically at the start of a debugging session.
Open the debug launch configuration using the Run->Debug Configurations... menu item.

Locate the launch configuration associated with the Flash target as shown:
Unselect the Perform Standard Download checkbox and select the Execute Task checkbox.

Click on the Add... button to open a new Download Task dialogue.
Select the Target Task checkbox and select the programming task created earlier. Unselect Execute on successive Runs as it is only necessay to program the device once at the start of the debugging sessions - Not every time the session is restarted.

Close the dialog using the OK button and confirm that the task has been correctly added to the Debugger tab.