Turn the freedom board KL25Z in a USBDM Debugger interface allows to program various Freescale MCU and other compatible ones (look here):

  • RS08
  • HCS08,
  • HC12,
  • Coldfire V1-4 microcontrollers
  • MC56F800xx Digital Signal Controllers (very limited range of devices).
  • Kinetis ARM-cortex

First of all it is necessary to prepare the hardware as shown in the previous article regarding the KL25Z as an OpenSDA programmer using the P&E Micro firmware (vedi qui). Prepare the board with the necessary hardware changes, but do not load the OpenSDA firmware, follow instead these steps:

Download the USBDM driver at this link:

opensda

Then, when the driver is installed, open this link (check for the last version) for the USBDM software:

download programs
Start the setup and during the procedure be sure to enable the installation of the components related to your development environment (in my case Codewarrior 10.6.4), and also the programmer Stand-alone, as I prefer simplicity, or as a plan B in case the development environment is not able to integrate the required plug-ins:

setup

When the setup is completed you just have to prepare your FRDM-KL25Z to proceed with the USBDM firmware update. Browse the default folder for installed software on your PC, you will findPGOand inside this folder the USBDM application one: inside this folder i will find “FlashImages” folder and then MKxx” referring to the micro board in the family. On my computer the full path is “C: \ Program Files (x86)\ pgo\USBDM 4.12.1.70\FlashImages\MKxx”.

Within this folder, we find the “OpenSDAvX.X.bin” file where X stands for the version available at the time. Keep this file handy!

usbdm flash application

It’s now time to connect the board to the computer with a USB cable, hold down the reset button a second or two, this will boot into bootloader mode and will appear as a USB mass storage device (Bootloader). If you have activated the internet, opening “sda_info.htm” file you can check the bootloader versions currently loaded in the flash app. However, we’re going to upgrade everything, to transform the board into a programmer “semi-universal” via SWD.

20160426_152446

So you just need to upload the file “OpenSDAvX.X.bin” in the mass storage device, wait a few seconds, then power cycle the device. At this point, as a confirmation of the successful firmware update, Windows will warn you that “new hardware is found and USBDM drivers will be automatically (probably) loaded, and the device will be recognized as a programmer from CodeWarrior and the stand-alone flash programmer.

Be careful: with Windows 7 and Windows 10 for still unknown reasons this process failed to update the firmware of the board as last step, however, I had here a computer with Windows XP and in that case it worked immediately. This step must be done only once, so I did not study in deep this strange problem.

To check if everything is working fine, you can connect the SWD connector to the target device, plug the board to the usb port and start the stand-alone flash programmer (with my setup in “C:\Program Files (x86)\pgo\USBDM 4.12.1.70\UsbdmFlashProgrammer.exe”):

stand alone usbdm flash programmer test

First of all, in the “Interface” tab via the “Detect” button I checked for a proper recognition of the KL25Z board detected as a SWD programmer. Next step, in the “Target” tab (rightmost image) using the “Detect Chip” function I do a quick check of the device that I have connected via SWD, in this example it is properly recognized as ID and correctly selected from the devices list.

However, initially it was not so simple, because the micro “MKV10” was not recognized, being present in the list but not fully configured. I tried to configure it manually by entering all parameters as per datasheet, but without success. I decided to contact the developer of USBDM, Peter O’Donoghue, who was by chance facing the same problem: so in less than 24 hours we have solved and now it works perfectly! Surely, with older micro or simply with more luck you will not have my same problem.

Stay tuned!

You can find more info at this link:
https://mcuoneclipse.com/2013/04/27/debug-external-processors-with-usbdm-and-freedom-board/

20160426_155241Having to develop a project with the Freescale Kinetis series micro, I looked on the net for the most suitable programmers using the SWD protocol (Serial Wire Debug). I didn’t like the solution of expensive programmers such as P&E Micro one’s, so I preferred the classic solution for geeks: I have discovered that is possible to turn FRDM-KL25Z (a demo platform that costs less than 20 €!) In a fast and cheap programmer with OpenSDA.

I have ordered mine from rs-components (look at this link) that ships in 24h in Italy, so the next day I was able to try it immediately. Looking to the schematics, is obviusly necessary to cut the short connection under the jumper J11, just to separate the clock of the internal micro from the external one we want to program by SWD connection:

cut

I did it in a barbaric way, however by inserting a jumper in order to restore the connection if i need to update the on-board mcu.

20160426_152316

It is better to prepare some files: you need to download from the website P&E Micro (click here) drivers for OpenSDA and the firmware to upgrade your KL25Z. Installed first of all the P&E Micro drivers (if they are not already on your computer), then extract from the zip “firmware apps” the MSD-DEBUG firmware for the KL25z and keep it at hand!

download

It’s now time to connect the board to the computer with a USB cable, hold down the reset button a second or two, this make the board boot into bootloader mode and will appear as a USB mass storage device (Bootloader). If you have an internet connection working, opening “sda_info.htm” file you can check the bootloader versions currently loaded in the flash and also the firmware application. However, we‘re going to upgrade everything, to turn the board into a programmer.

20160426_152446

So you just need to upload the file “MDS-DEBUG-FRDM-KL25Z_Pemicro_v ***. SDA” in the mass storage device, wait a few seconds, then power cycle the device. At this point, as a confirmation of the successful firmware update, Windows will warn you that “new hardware is found and OpenSDA drivers will be automatically (probably) loaded, and the device will be recognized as a programmer from CodeWarrior.

Be careful: with Windows 7 and Windows 10 for still unknown reasons this process failed to update the firmware of the board as last step, however, I had here a computer with Windows XP and in that case it worked immediately. This step must be done only once, so I did not study in deep this strange problem.

The SWD connector used to program third-party mcu’s is the J6:

programming connector

error-17926

The annoying thing of this solution is the OpenSDA firmware, which verifies the CPU target every time: if you try to program a different mcu from KL25Z, CodeWarrior will return a nasty error message. However, having the need to program a different mcus, I still found a solution, even if it took me more time…. I will update with this new solution the next time!