Debugging the FRDM-K64F with P&E Multilink

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:

FRDM-K64F with P&E Multilink

FRDM-K64F with P&E Multilink (click to enlarge)

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.

  1. Power the board through the USB K64F connector
  2. Connect the SWD debug cable to the 10pin SWD/JTAG connector near the K64F CPU
  3. All jumpers canremain as the default (see picture):
    1. J21: installed
    2. J14: not installed
    3. 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:

FRDM-K64F Debugger Launch Settings

FRDM-K64F Debugger Launch Settings

Happy Debugging šŸ™‚

Advertisements

13 thoughts on “Debugging the FRDM-K64F with P&E Multilink

  1. Hello,

    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.

    Thank you.

    Like

    • Hello,
      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’ šŸ™‚

      Like

      • Hello,

        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.
        DG

        Like

        • 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.

          Erich

          Like

        • Hello,

          Thank you for the reply.
          Issue solved.

          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.
          DG

          Like

        • Hi DG,
          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.

          Like

  2. Hello,

    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?

    Thank you.

    Like

  3. 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)

    Thank you..
    Kishan

    Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.