Tutorial - Using the USBDM - Freemyfreescalewebpage.free.fr/res/Tutorial - Using the USBDM.pdf ·...
Transcript of Tutorial - Using the USBDM - Freemyfreescalewebpage.free.fr/res/Tutorial - Using the USBDM.pdf ·...
Tutorial - Using the USBDM
Author:
Joel - MyFreescaleWebPage
http://myfreescalewebpage.free.fr
Last revision of this document: 1.6 of 2014-10-19.
MyFreescaleWebPage Tutorial - Using the USBDM 2
Table of contents
Revisions ................................................................................................................................................. 2
Introduction ............................................................................................................................................ 3
1 Download the USBDM installation files ............................................................................................ 6
2 Installation of the USBDM ................................................................................................................ 8
3 Flashing the USBDM firmware ....................................................................................................... 15
3.1 Flashing the USBDM firmware with an external tool ............................................................... 15
3.2 Flashing the USBDM firmware with the internal bootloader of the HCS08JS16 microcontroller
15
4 Updating the USBDM firmware ...................................................................................................... 18
5 Programming microcontrollers ...................................................................................................... 21
5.1 Using standalone programmer ............................................................................................... 21
5.2 Using Freescale CodeWarrior ................................................................................................. 23
5.3 Target microcontroller "secured" - Programming failed .......................................................... 24
Conclusion ............................................................................................................................................. 25
Appendix - Uninstalling the USBDM ....................................................................................................... 26
Revisions
Version Date Changes
1.0 2013-02-26 First release (USBDM 4.10.4)
1.1 2013-05-08 Update (USBDM 4.10.5)
1.2 2013-06-02 Update (USBDM 4.10.5b - Released due to some issues with 4.10.5)
1.3 2013-10-13 Update (USBDM 4.10.6c for CodeWarrior 10.5)
1.4 2014-05-04 Update (USBDM 4.10.6.140 for CodeWarrior 10.6)
1.5 2014-06-01 First programming of the target microcontroller added
1.6 2014-10-19 Update (USBDM 4.10.6.200 for CodeWarrior 10.6)
MyFreescaleWebPage Tutorial - Using the USBDM 3
Introduction
The USBDM is an open source programming cable for Freescale microcontrollers released by PGO.
Several hardware versions are available depending of the targets you want to program. All source files,
firmware, schematics are available on http://usbdm.sourceforge.net.
MyFreescaleWebPage proposes its own USBDM. It is based on "USBDM_SWD_JS16CWJ" schematic from
PGO and is able to program HCS08, HCS12, Coldfire V1 and Kinetis SWD microcontrollers. This makes it a
very good choice if you want to begin with Freescale microcontrollers!
This cheap but powerful USBDM is provided with BDM, SWD and USB cables. You can get it on the
following page: http://myfreescalewebpage.free.fr/toolbox/usbdm/shop.htm.
TheUno and BigBrother evaluation boards are based on the USBDM with an additional serial port used
to communicate with the target.
MyFreescaleWebPage Tutorial - Using the USBDM 4
The following USBDM (found on eBay) is able to program RS08, HCS08, HCS12, CFV1, CFV2, CFV3, CFV4,
Kinetis and DSC microcontrollers and is able to supply the target with 3.3 or 5V voltage.
MyFreescaleWebPage Tutorial - Using the USBDM 5
This other USBDM (also found on eBay from BlackBoxStudio seller at http://www.ebay.fr/itm/Freescale-
Debugger-Programmer-for-HCS08-HCS12-Coldfire-V1-/110958979630?) is compatible with HCS08,
HCS12 and CFV1 microcontrollers.
This tutorial explains how to use the USBDM: installation, update, programming the target with
standalone software and Freescale CodeWarrior.
If you want to use your USBDM with CodeWarrior, you must first installed CodeWarrior and then the
USBDM. A tutorial is available on my website at http://myfreescalewebpage.free.fr in you need help.
MyFreescaleWebPage
1 Download the USBDM installation files
Today the last USBDM release is V4.10.
following page: http://sourceforge.n
The drivers are available on the following page:
http://sourceforge.net/projects/usbdm/files/Version%204.10.6/Drivers
Tutorial - Using the USBDM
the USBDM installation files
he last USBDM release is V4.10.6.200. The installation files are available on Sourceforge on the
http://sourceforge.net/projects/usbdm/files/Version%204.10.6/Software
The drivers are available on the following page:
http://sourceforge.net/projects/usbdm/files/Version%204.10.6/Drivers.
6
. The installation files are available on Sourceforge on the
et/projects/usbdm/files/Version%204.10.6/Software.
MyFreescaleWebPage
Download the USBDM Installer and the right USBDM Drivers according to your computer.
Tutorial - Using the USBDM
Download the USBDM Installer and the right USBDM Drivers according to your computer.
7
Download the USBDM Installer and the right USBDM Drivers according to your computer.
MyFreescaleWebPage
2 Installation of the USBDM
Please note that it is recommend to remove your previous USBDM ins
version. See "Appendix - Uninstalling the USBDM
To install the USBDM, execute the installer.
A wizard is displayed. Click "Next
Tutorial - Using the USBDM
the USBDM
Please note that it is recommend to remove your previous USBDM installation before installing the last
Uninstalling the USBDM" for more details.
xecute the installer.
Next".
8
tallation before installing the last
MyFreescaleWebPage
Accept the License Agreement and click
It is possible to custom the installation.
installation (Eclipse Special Edition V10.
perform the USBDM installation
Tutorial - Using the USBDM
Accept the License Agreement and click "Next".
It is possible to custom the installation. I have only verified that the installer detected
(Eclipse Special Edition V10.6) has shown on the following screenshot. Click
.
9
I have only verified that the installer detected my CodeWarrior
has shown on the following screenshot. Click "Next" to
MyFreescaleWebPage
Click "Install".
The setup takes several minutes to complete.
Tutorial - Using the USBDM
several minutes to complete.
10
MyFreescaleWebPage
The installation ends. Click "Finish
It's now time to install the USBDM
configuration (Windows XP or not
Tutorial - Using the USBDM
Finish" to close the wizard.
It's now time to install the USBDM Drivers. Execute the right USBDM Drivers installer according to your
or not, x86 or x64 operating system).
11
USBDM Drivers installer according to your
MyFreescaleWebPage
A wizard is displayed. Accept the License Agreement and click
The wizard install the USBDM Drivers.
Tutorial - Using the USBDM
A wizard is displayed. Accept the License Agreement and click "Install".
wizard install the USBDM Drivers.
12
MyFreescaleWebPage
Window can't verify the publisher of the driver software. Validate the installation.
The installation takes only some few seconds. The wizard says that
USBDM. Click "OK".
Tutorial - Using the USBDM
Window can't verify the publisher of the driver software. Validate the installation.
only some few seconds. The wizard says that it is now possible to
13
Window can't verify the publisher of the driver software. Validate the installation.
it is now possible to connect the
MyFreescaleWebPage
Click "Finish" to close the wizard.
The installation is finished. USBDM
Tutorial - Using the USBDM
to close the wizard.
USBDM shortcuts are available in the start menu.
14
MyFreescaleWebPage Tutorial - Using the USBDM 15
3 Flashing the USBDM firmware
The microcontroller of the USBDM must be programmed with the right USBDM firmware. The table
below present several USBDM versions and their features.
Description Based On Supported Devices & Features Firmware
USBDM_JS16CWJ HCS08JS16 HCS08, HCS12, CFV1 USBDM_JS16CWJ_V4
USBDM_SER_JS16CWJ HCS08JS16 HCS08, HCS12, CFV1 - Serial Port USBDM_SER_JS16CWJ_V4
USBDM_SWD_JS16CWJ HCS08JS16 HCS08, HCS12, CFV1, Kinetis USBDM_SWD_JS16CWJ_V4
USBDM_SWD_SER_JS16CWJ HCS08JS16 HCS08, HCS12, CFV1, Kinetis - Target
Power, Serial Port
USBDM_SWD_SER_JS16CWJ_V4
USBDM_CF_JS16CWJ HCS08JS16 CFV2, CFV3, CFV4, Kinetis, DSC USBDM_CF_JS16CWJ_V4
USBDM_CF_SER_JS16CWJ HCS08JS16 HCS08, HCS12, CFV1, CFV2, CFV3,
CFV4, Kinetis, DSC - Serial Port
USBDM_CF_SER_JS16CWJ_V4
USBDM_CF_JMxxCLD_V3 HCS08JM60 RS08, HCS08, HCS12, CFV1, CFV2,
CFV3, CFV4, Kinetis, DSC - Target
Power, Serial Port
USBDM_CF_JMxxCLD_V4
The USBDM schematics and firmware are available in the "BDM Flash Images" directory of the USBDM
installation (a shortcut is available in the start menu following the installation of the USBDM).
The USBDM based on the HCS08JM60 microcontroller must be flashed using an external tool (another
USBDM for example). The USBDM based on the HCS08JS16 microcontroller can be flashed using the
internal USB bootloader present in this device.
3.1 Flashing the USBDM firmware with an external tool
This will depend of the programmer used. You can refer to §5 "Programming microcontrollers" if you are
using another USBDM.
3.2 Flashing the USBDM firmware with the internal bootloader of the
HCS08JS16 microcontroller
The internal bootloader of the HCS08JS16 microcontroller is very convenient and can be used to flash
the USBDM firmware. The internal bootloader is a specific peripheral and is always available.
First short the BLMS pin of the HCS08JS16 microcontroller to the ground. As shown below, on TheUno it
is done by shorting X3 with a simple jumper. Adapt this step to your own USBDM. Please note that this is
not necessary if the USBDM is blank (never programmed before), because it is starting by default with
the internal bootloader in this case.
MyFreescaleWebPage
Now connect the USBDM to your computer. A new peripheral called "JS16" is d
automatically installed.
Start "JS16 First Level Bootloader" utility.
Tutorial - Using the USBDM
Now connect the USBDM to your computer. A new peripheral called "JS16" is detected and
Start "JS16 First Level Bootloader" utility.
16
etected and
MyFreescaleWebPage
Select the right firmware according to your USBDM.
Description Firmware
USBDM_JS16CWJ USBDM_JS16CWJ_V4
USBDM_SER_JS16CWJ USBDM_SER_JS16CWJ_V4
USBDM_SWD_JS16CWJ USBDM_SWD_JS16CWJ_V4
USBDM_SWD_SER_JS16CWJ USBDM_SWD_SER_JS16CWJ_V4
USBDM_CF_JS16CWJ USBDM_CF_JS16CWJ_V4
USBDM_CF_SER_JS16CWJ USBDM_CF_SER_JS16CWJ_V4
Click "Program" to flash the USBDM.
Wait some few seconds. The following message is finally displayed to indicate that the USBDM has been
correctly flashed.
Click "OK" and disconnect the USBDM.
Tutorial - Using the USBDM
Select the right firmware according to your USBDM.
Firmware BDM Firmware choice
USBDM_JS16CWJ_V4 HCS08/HCS12/CFV1
USBDM_SER_JS16CWJ_V4 HCS08/HCS12/CFV1 + Serial
USBDM_SWD_JS16CWJ_V4 HCS08/HCS12/CFV1/ARM
USBDM_SWD_SER_JS16CWJ_V4 HCS08/HCS12/CFV1/ARM
USBDM_CF_JS16CWJ_V4 CFVx/DSC/ARM_JTAG
USBDM_CF_SER_JS16CWJ_V4 CFVx/DSC/ARM_JTAG + Serial
to flash the USBDM.
Wait some few seconds. The following message is finally displayed to indicate that the USBDM has been
nnect the USBDM. It is now possible to use the USBDM.
17
BDM Firmware choice
HCS08/HCS12/CFV1
HCS08/HCS12/CFV1 + Serial
HCS08/HCS12/CFV1/ARM-SWD
HCS08/HCS12/CFV1/ARM-SWD + Serial
CFVx/DSC/ARM_JTAG
CFVx/DSC/ARM_JTAG + Serial
Wait some few seconds. The following message is finally displayed to indicate that the USBDM has been
MyFreescaleWebPage
4 Updating the USBDM firmware
Connect the USBDM to your computer and start "USBDM Firmware Updater"
Tutorial - Using the USBDM
Updating the USBDM firmware
Connect the USBDM to your computer and start "USBDM Firmware Updater" utility
18
utility.
MyFreescaleWebPage
You can check "Auto select BDM firmware"
the Serial Number of the USBDM will be set to its default value in this case.
Instead, you can load the right firmware yourself by clicking "Load Source File" button and browsing to
the USBDM firmware. It is then possible to set the Serial Number
to reuse the existing Serial Number
able to use them at the same time on your computer by giving
Click on "Program Flash" button.
1
3
Tutorial - Using the USBDM
"Auto select BDM firmware" to automatically chose the right USBDM firmware. Note that
the Serial Number of the USBDM will be set to its default value in this case.
ou can load the right firmware yourself by clicking "Load Source File" button and browsing to
mware. It is then possible to set the Serial Number yourself or to click "Read from device"
to reuse the existing Serial Number. This is very useful if you have several USBDM because you will be
able to use them at the same time on your computer by giving them different Serial Number values.
h" button. The following window is displayed.
2
19
to automatically chose the right USBDM firmware. Note that
ou can load the right firmware yourself by clicking "Load Source File" button and browsing to
yourself or to click "Read from device"
This is very useful if you have several USBDM because you will be
them different Serial Number values.
MyFreescaleWebPage
Click "OK" to validate. The USBDM reboots.
On my computer this is sometimes failing and the following message is
Click "No" to cancel the operation and try again by pressing "Program Flash" button
The firmware of the USBDM is updated and verified.
It is now possible to use the USBDM.
Tutorial - Using the USBDM
Click "OK" to validate. The USBDM reboots.
On my computer this is sometimes failing and the following message is displayed.
ck "No" to cancel the operation and try again by pressing "Program Flash" button
The firmware of the USBDM is updated and verified.
It is now possible to use the USBDM.
20
displayed.
ck "No" to cancel the operation and try again by pressing "Program Flash" button.
MyFreescaleWebPage
5 Programming microcontrollers
5.1 Using standalone programmer
Some applications are provided by PGO to program microcontrollers with the USBDM
example is done using TheUno, on which the target microcontroller is a HCS08DZ60 device.
Connect the USBDM and start "HCS08 Programmer
been detected. Click "Detect" if not.
Tutorial - Using the USBDM
Programming microcontrollers
programmer
Some applications are provided by PGO to program microcontrollers with the USBDM
example is done using TheUno, on which the target microcontroller is a HCS08DZ60 device.
HCS08 Programmer". The following window is displayed. The USBDM has
been detected. Click "Detect" if not.
21
Some applications are provided by PGO to program microcontrollers with the USBDM. The following
example is done using TheUno, on which the target microcontroller is a HCS08DZ60 device.
s displayed. The USBDM has
MyFreescaleWebPage
Go to the "Target" tab.
Click on "Detect Chip" to check the target microcontroller.
Choose the right microcontroller in the device selection list ("DZ
Tutorial - Using the USBDM
Click on "Detect Chip" to check the target microcontroller.
Choose the right microcontroller in the device selection list ("DZ-MC9S08DZ60" in this
22
MC9S08DZ60" in this example).
MyFreescaleWebPage
Click on "Load Hex Files" to select the application you want to program. Finally click on "Program Flash".
The device is programmed and a message is displayed to indicate that the operation completed.
Click "No" and close the HCS08 Programmer utility.
5.2 Using Freescale CodeWarrior
It is possible to use the USBDM with Freescale CodeWarrior to load and debug applications.
Tutorial - Using the USBDM
s" to select the application you want to program. Finally click on "Program Flash".
The device is programmed and a message is displayed to indicate that the operation completed.
Programmer utility.
Using Freescale CodeWarrior
It is possible to use the USBDM with Freescale CodeWarrior to load and debug applications.
23
s" to select the application you want to program. Finally click on "Program Flash".
The device is programmed and a message is displayed to indicate that the operation completed.
It is possible to use the USBDM with Freescale CodeWarrior to load and debug applications.
MyFreescaleWebPage
Simply choose the USBDM in the connection list during the creation of the project, as shown on the
following screenshot (Freescale CodeWarrior V10.
Then, it is possible to load and debug application
tool.
5.3 Target microcontroller "secured"
The target microcontroller may be "secured"
if you have secured it. This means that the content of the Flash memory is protected and the USBDM
fails to program the microcontroller in this case.
To unsecure the device, first power off your tar
and power on the target again. Finally remove the short circuit and load your program. This should now
succeed (the microcontroller is no more secured).
Tutorial - Using the USBDM
Simply choose the USBDM in the connection list during the creation of the project, as shown on the
screenshot (Freescale CodeWarrior V10.6).
Then, it is possible to load and debug applications with the USBDM as done if you were using any other
Target microcontroller "secured" - Programming failed
The target microcontroller may be "secured" the first time you attempt to perform the programming
if you have secured it. This means that the content of the Flash memory is protected and the USBDM
fails to program the microcontroller in this case.
To unsecure the device, first power off your target, make a short circuit on BKGD signal with the ground
. Finally remove the short circuit and load your program. This should now
succeed (the microcontroller is no more secured).
24
Simply choose the USBDM in the connection list during the creation of the project, as shown on the
if you were using any other
the first time you attempt to perform the programming or
if you have secured it. This means that the content of the Flash memory is protected and the USBDM
get, make a short circuit on BKGD signal with the ground
. Finally remove the short circuit and load your program. This should now
MyFreescaleWebPage Tutorial - Using the USBDM 25
Conclusion
The USBDM is a powerful device. It is regularly updated to support new microcontrollers. You are now
ready to build your own USBDM and use it to load and debug applications on many Freescale devices.
MyFreescaleWebPage
Appendix - Uninstalling the USBDM
Uninstalling the USBDM is done very
Select USBDM and click "Uninstall" button.
The USBDM is uninstalled.
Tutorial - Using the USBDM
Uninstalling the USBDM
BDM is done very simply using the Control Panel.
and click "Uninstall" button.
26