The FRDM-K64F board as other Freescale Freedom board have an onboard debugging device. For everyone who wants to debug the FRDM-K64F board with say a P&E Universal Multilink, here is my setup in case you do not get it working out of the box:
The blue LED on the Multilink should be on to indicate the USB drivers on the host are installed. The orange LED on the Multilink indicates that the target board has power.
- Power the board through the USB K64F connector
- Connect the SWD debug cable to the 10pin SWD/JTAG connector near the K64F CPU
- All jumpers can remain on the default (see picture):
- J21: installed
- J14: not installed
- J25: installed on 1-2
Screenshots of Debug configuration taken from Kinetis Design Studio v3.0.0:
The important part is to have the USB Multilink as interface, the correct device selected with the SWD protocol:
Happy Debugging 🙂
First of all thank you for your effort put into this area. I really like these boards from Freescale. I think I am now a collector and I have to stop 🙂
I just go the K64F board and tried with the onboard mbed cmsis-dap to debug. But the last 0.9.0 openocd does not have the kinetis.cfg and is not supporting anymore the syntax from the kinteis.cfg. It throws an error on line 11 about “newdap .. ” subfunction. Anyway, with the other boards, with Segger firmware I had a really good experience but I would like to switch to some external debugging.
What debugger would you recommend?
– I could get my hands on a Segger j-Trace for ARM Cortex-M debugger. But this only as a “rented” debugger and only on the weekends 😉
– Or an ARMKEIL ULINK2
– Or there is a cheap eBay ULINK2 version
– or any other option that to the “free” eclipse development tool-chain fits.
Anything that does not break the bank is welcome.
I recommend that you go with the free Kinetis Design Studio. It already comes with OpenOCD included, and it is free and unlimited. On another note: I do not recommend to use OpenOCD, unless you are kind of masochist ;-): At least for me OpenOCD has been an endless source of pain. Rather go with P&E and Segger firmware which is free for the FRDM-K64F board too.
ULINK2 is only supported by the commercial/not free toolchain like Keil MDK, so not an option here in my view.
As for the Segger OpenSDA v2 firmware for the K64F, see https://mcuoneclipse.com/2014/04/27/segger-j-link-firmware-for-opensdav2/
Happy collecting boards, I have the same ‘problem’ 🙂
Thank you for the quick reply.
If I had read the comments on the above mentioned article back then, I would have had my answer.
After a total of 6h of shilly shallying with the openOCD I switched to Segger and had it going in 5 minutes.
I encountered with the board.
With the original / updated firmware the board behaves strange on Win7. If I am starting in bootloader, I can see the bootloader drive for 2-3 seconds after it disappears. If I power off the board and try to start it in normal mode then it is not starting anymore. It does nothing. By pushing the reset button then it switches into bootloader mode but with the same behavior. The drive is only a short time available.
I powered the board off and rebooted my PC into Linux.
Powering the board had the same behavior, the board will not start up and after a reset it switches into bootloader mode.
But, this time luckily the bootloader drive is available and I can update the firmware.
So somehow switching the board in Bootloader mode under windows makes the firmware invalid. Why? I have no idea. Some driver is not right, but is not logging any error in the windows log. Or somehow the antivirus tries to write on the drive and this invalidates somehow the firmware.
Anyway strange. With the other boards I’m not having this issue.
Maybe it’s only on my PC but if someone else had also the same issue maybe it will help to know the workaround.
Thank you again for the reply.
Could it be that the board somehow reboots/restarts after that 2-3 seconds?
That could indicate a problem with the board/hardware (shortcut somewhere?).
I guess you only have one board, but in such cases using a second board helps to find out if it is a host or a board problem.
Thank you for the reply.
After I tried on another computer just to confirm my hunch, I can confirm that the issue was related to my PC. It is somehow a kind of W T F?.
My antivirus “Panda Security” had the vaccinate USB drives option enabled. So it seems that it writes something to the BOOTLOADER drive making the BOOTLOADER flash the written data and then to restart trying to execute the newly flashed “firmware”.
Well ain’t that cute? But it’s wroooong! (quote from 2StupidDogs) :).
Now, with the vaccinate set to off the issue is gone.
Thank you and have a great weekend.
MSD (Mass Storage Device) bootloaders like the one on the FRDM boards are very sensitive to ‘unexpected’ read/write to the device. The bootloader only behaves like a mass storage device, but actually is not a real one. So if the Operating System or a virus firewall/program is writing/reading to that device in a way which confuses the bootloader, things like this might happen. So I always recommend to verify if issues could be caused by an antivirus or similar tool which monitors such a MSD device.
First of all, thank you for your effort. It was really helpful.
Actually, I’m trying to run K20DX128VFM5(in KW019032 DVK) in bootloader mode but it is not easy.
Would you please help me how to enter the bootloader mode using P&E Multilink?
I don’t know that board (any link you can share?). But to enter bootloader mode on any of the OpenSDA circuits known to me you have to power the K20DX128 with the reset button pressed, see https://mcuoneclipse.com/2014/11/01/illustrated-step-by-step-instructions-updating-the-freescale-freedom-board-firmware/
Thank you for your reply.
I attached the MK20DX128 chip to the other board. It can be connected via 10pin cable using multilink and powered by usb cable.
I want to upgrade the firmware which is binary file.
I already used that way(power the kit with the reset button pressed) but it doesn’t work.
Are there any other ways to upgrade this chip?
And I’m sorry that I cannot explain detail because I’m not good at english. Please understand.
Are there any ways to show you the picture of my board?
I really appreciate for your reply.
You need the a multilink (or j-link) to program the K20 on the FRDM board, using the SWD header nearby.
Thank you for your reply.
It was really helpful! Thank you.
Hello Erich Sir…
This is Kishan again..
Actually my question is that if I Debug/program through USB multilink (MK64f controller) and program with mass erase ….and after that I want to use OpenSDA again…can I do this without any problem… or I have to do some other configuration also to switch from USB multilink to Open SDA?… (have to put any bootloader for mk64f controller to program/control by Mk20DX controller)
yes, I don’t see any problems with that, I’m doing this too (switching between OpenSDA and through the SWD header, both with P&E and Segger).
LikeLiked by 1 person