USBDM/CF (JMxx Version) V4.9.5

Setting up Coldfire V2-V4 Flash programming for Codewarrior Eclipse

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 MCF52235.

Codewarrior will usually have already set up a suitable Flash Programming task for Coldfire V2-V4 devices when the project was created so the following should only be necessary in rare circumstances.

Creating a Flash Programming Task for USBDM

Open the Flash Programmer as shown:
Flash_Programming_Task_0.png
Click on the Green Plus to add a new task
Flash_Programming_Task_0a.png
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
Flash_Programming_Task_1.png
The dialogue that open 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.
Flash_Programming_Task_2.png
Click on the Add Device button and choose the device type to be programmed.
You can type a partial device type to reduce the number of alternatives displayed.

Click Done to close this dialogue when finished.
Flash_Programming_Task_3.png

Click on the Add Erase/Black Check Action

  • 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.
Flash_Programming_Task_4.png

Click on the Add Program/Verify Action

  • Select Use File From Launch Configuration checkbox so that target intialisation 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.
Flash_Programming_Task_5.png
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.
Flash_Programming_Task_7.png