This tutorial was extracted from Erich Styger blog http://mcuoneclipse.wordpress.com with his agreement.
I mentioned in “Debug External Processors with USBDM and Freedom Board” post that I had a problem to debug the FRDM-KL05ZFRDM-KL05Z with USBDM. Well, after a long night with some sleep, with more thinking and searching, finally I have it resolved: I can debug my FRDM-KL05Z with USBDM
The problem was that I received a “Failed to resume target process., Downloading binary to target…’ error message:
This Freescale forum thread has finally lead me to the solution: a wrong USBDM device ID for KL05Z present on the FRDM board .
USBDM Flash Programmer
USBDM comes with standalone flash programmers, and one of it is for ARM based devices:
USBDM 4.10.4 Installed Program Shortcuts
The Flash Programmer has a ‘Detect’ functionality, it was not able to detect the KL05Z32 on the FRDM-KL05ZFRDM-KL05Z board:
Chip ID
The good thing is that it reports the chip ID. After searching around, I realized that the ID mapping is described in the arm_devices.xml file inside the USBDM installation folder:
That file has the KL05Z32 listed as
MKL05Z32M4" family="ARM" subfamily="KL05">
<
memoryRef
ref
=
"kinetisL4K_Ram"
/>
<
memoryRef
ref
=
"kinetis32K_Flash_B0"
/>
<
memoryRef
ref
=
"kinetisIO_KL"
/>
<
sdid
value
=
"0x05130480"
/>
<
tclScriptRef
ref
=
"Kinetis-KLxx-Scripts"
/>
<
flashProgramRef
ref
=
"Kinetis-KLxx-FlashProgram"
/>
</
device
>
That device ID (0×05130480) does not match what the programmer reported (0×5130402). Testing the ID with the working FRDM-KL25Z, it seems to me that the last nibble is zero, so I changed the above entry to:
MKL05Z32M4" family="ARM" subfamily="KL05">
<
memoryRef
ref
=
"kinetisL4K_Ram"
/>
<
memoryRef
ref
=
"kinetis32K_Flash_B0"
/>
<
memoryRef
ref
=
"kinetisIO_KL"
/>
<
sdid
value
=
"0x05130420"
/>
<
tclScriptRef
ref
=
"Kinetis-KLxx-Scripts"
/>
<
flashProgramRef
ref
=
"Kinetis-KLxx-FlashProgram"
/>
</
device
>
With this, the device is properly detected:
And with this change, CodeWarrior for MCU10.3 is successfully debugging the FRDM-KL05Z with USBDM: