Very brief instructions of using USBDM with CodeSourcery-Lite

==================================================
Files:
osbdm-jm60.dll - This is a DLL that makes the USBDM look like a OSBDM-JM60 with a CFV1 target (at least as far as CodeSourcery thinks).
libusb-1.0.dll - Used by above for USB access

Copy the above files to the "C:\Program Files\CodeSourcery\Sourcery G++ Lite\bin" directory:
It may be necessary to rename the osbdm-jm60.dll DLL in the windows directories to make sure it doesn't get used 
but I don't think this is necessary.

You can do a very basic test of the sprite using the command:

m68k-elf-sprite  osbdm://0/ mcf51cn128

It should indicate that the target is reset.

==================================================
I used the following in the debugger launch startup tab in Eclipse

target remote | m68k-elf-sprite osbdm://0/ mcf51cn128
load
 
This was with V4.4 firmware

NOTE: The "//0/" in the above refers to the USB device number times TWO(2).  This is being used to allow selection of CFV1 or CFVx 
targets since some versions of USBDM can support both at once unlike OSBDM-JM60 which can support both WITH FIRMWARE CHANGES i.e. a
given osbdm-jm60 does one or the other so there is no need to select which. 
It is therefore necessary to have some mechanism to tell the DLL which mode to operate the BDM in.  The crude mechanism is as follows:

// Hack for combined CFV1/CFVx USBDM - device number is actually device_no x 2
// Odd numbers  => CFVx, 
// Even numbers => CFV1
// e.g. 0 => open device #0 as a CFV1 interface
//      1 => open device #0 as a CFVx interface
//      2 => open device #1 as a CFV1 interface
//      3 => open device #1 as a CFV1 interface

=======================================================
Testing
I have used it with CodeSourcery lite and Eclipse under Win-XP to do some simple tests with a MCF51CN128 and a MCF52233.

----
You can flash the CFV1 chips beforehand using the stand-alone programmer provided. The programmer only supports S19
files so you have to generate them.  You can convert the elf file used by Codesourcery to a S19 file using
a command similar to the following:

m68k-elf-objcopy.exe -Osrec TryCodeSourcery.elf TryCodeSourcery.s19

After doing the above you can flash the chip using a command similar to:

CFV1_FlashProgrammer.exe TryCodeSourcery.s19 -vdd=3v3 -trim=31.25 -device=MCF51CN128 -program

It is quite a simple matter to set up an External Tool(s) under Eclipse to do the above commands.

----
You can use CFFlasher with USBDM to program the CFV2-4 chips in a smiilar fashion.
