I mentioned in “Debug External Processors with USBDM and Freedom Board” post that I had a problem to debug the FRDM-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:
The Flash Programmer has a ‘Detect’ functionality, it was not able to detect the KL05Z32 on the FRDM-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 (0x05130480) does not match what the programmer reported (0x5130402). 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:
Happy OSBDMing 🙂
Pingback: Debug External Processors with USBDM and Freedom Board | MCU on Eclipse
Pingback: Adding USBDM to CodeWarrior for MCU10.4 | MCU on Eclipse
Hello from Mexico! Yes, I had the same problem. This was solved with CW10.4 . I hope i had seen this post before. But is very interesting the way you solved the problem, thanks for sharing!
LikeLike
Hello from Switzerland!
yes, I have sometimes the same experience that I find out the solution on the web after the fact. Glad you have found it 🙂
LikeLike
I didn’t understand if you are using the USBDM in a FRDM-KL25 board and then connected it to the FRDM-KL05Z, or if you had programmed the FRDM-KL05Z with USBDM itself ?
I only have a FRDM-KL05Z and I want to use it to debug my particular board.
Best Regards,
Christian
LikeLike
Hi Christian,
All what you need is USBDM to talk to a FRDM board, and that FRDM board connected to your particular board.
See https://mcuoneclipse.com/2013/04/27/debug-external-processors-with-usbdm-and-freedom-board/
So with the FRDM-KL05Z you have everything you need.
LikeLike
Thanks Erich.
I read all that post and this post, then I tried to do all the stuff, but because the actual version of USBDM is 4.10.6, I download that, and there is no USBDM_OpenSDA.zip in this new version.
I think that this new version will do it automatically, but nothing is working.
So, do you think that it will be ok to use the USBDM_OpenSDA.zip in the version 4.10.4 and updated this firmware on the Freedom board ? Or do you know another solution ?
Best Regards,
Christian
LikeLike
Hi Christian,
I have used 4.10.4, and I had no need to switch to a newer version. So yes, I think you should be able to use that version too. Otherwise I suggest that you ask about this in the Freescale Forum: the user pgo is maintaining USBDM and should be able to help.
LikeLike
Thanks again, now it is working perfectly.
Another question: In the FRDM-KL05Z there is another connector, J3 SDA JTAG. What for is this connector ?
Best Regards,
Christian
LikeLike
Hi Christian,
J3 is the SDA JTAG debug header (well, the labeling is somewhat wrong: it is SWD, not full JTAG). With this header, it would be possible to program the K20 OpenSDA device on the board. But this K20 is secured/locked, so you cannot re-program it. So this header would only be usefule if you decide to unsolder the K20 and put a new one on the board.
LikeLike
Waaaaooooo, I just found this at 3:13 a.m, been struggling with USBDM as last option after openOCD script failed, this makes USBDM work perfectly in Linux. Funny, without this fix, it still works but its a hit and miss, sometimes it works, sometimes it doesnt. Thank you!!!! Makes me feel like I should read all the posts on your blog, hehe 🙂
LikeLike