Using the Freescale Freedom (FRDM-KL43Z) to Debug other Boards

In “Unboxing the Freescale FRDM-KL43Z Board” I was using the FRDM-KL43Z board the first time. The FRDM-KL43Z board has an on-board debug interface (Kinetis K20, OpenSDA). In this post I show how to use the FRDM-KL43Z board to debug another ARM board.

FRDM-KL43Z Board debugging custom (tinyK20) Board

FRDM-KL43Z Board debugging custom (tinyK20) Board

Outline

In this post I show how to use a normal Freescale Freedom (FRDM) board into a SWD (Single Wire Debug) debugging probe to potentially debug any other ARM Cortex core supporting SWD. I’m using here the FRDM-KL43Z board, but the other Freescale Freedom boards are very similar.

Hardware Setup

There are two things involved to use the board as a debugging probe:

  1. J18: This is a header to separate the trace between the OpenSDA/K20.
  2. J11: This is a 2×5 SWD header for standard ARM 10pin
SWD Connector Schematic on FRDM-KL43Z

SWD Connector Schematic on FRDM-KL43Z (Source: Freescale FRDM-KL43Z Schematics)

Both J11 and J18 are *not* populated on the board.

J11 SWD and J18 on FRDM-KL43Z Board

J11 SWD and J18 on FRDM-KL43Z Board

FRDM-KL43Z J18 and J11 on Back Side of Board

FRDM-KL43Z J18 and J11 on Back Side of Board

I need to have the following available parts:

  1. 1×2 Jumper and Header for J18 (you probably have a few on your desk?)
  2. 2×5 SWD Header for J11 (SAMTEC ā€“ FTS-105-01-L-D, e.g. 1667728)
  3. Standard ARM SWD/JTAG cable (e.g. 1667659), or borrow it from a P&E Multilink or Segger J-Link

Beside of that: a sharp knife and a soldering iron (small soldering tip) with solder wire šŸ™‚

Use a sharp knife to cut the trace on the backside of J18:

Cut Trace of J18

Cut Trace of J18

Solder the 1×2 header on J18:

Populated J18

Populated J18

Solder the 2×5 SWD/JTAG header on J11:

Populated J11

Populated J11

To debug another board, install the 10pin flat cable (Pin 1 of J11 matching the red cable) and have the jumper on J18 removed ( J18 is open):

J11 and J18 to debug another board

J11 and J18 to debug another board

Connect the other side of the cable to the target board:

Connected Boards

Connected Boards

OpenSDA Debug Firmware

With the default (P&E) firmware on the FRDM-KL43Z it is *not* possible to debug another processor, except the device on the FRDM board itself.

Instructions how to update the firmware are explained here: “Illustrated Step-by-Step Instructions: Updating the Freescale Freedom Board Firmware

There are the following other debug firmware files available for OpenSDA (with links to articles and firmware files):

  1. Segger J-Link, see “Freedom Board with Segger OpenSDA Debug Firmware
  2. CMSIS-DAP with OpenOCD: see “CMSIS-DAP with IAR and the KL25Z Freedom Board
  3. USBDM: see “Debug External Processors with USBDM and Freedom Board

The CMSIS-DAP and USBDM firmware files are open source and can be used without restrictions. The Segger J-Link has the following TERMS OF USE:

TERMS OF USE
1) The firmware is only to be used with Freescale target devices. Using it with other devices is prohibited and illegal.
2) The firmware is for use with evaluation boards only. It is not for use with custom hardware.
3) The firmware may only be used for development and/or evaluation purposes. It may not be used for production purposes.
4) The firmware is made available without any warranty and without support.
5) The firmware may be used with the OpenSDA platform only.

So I can use it to debug another FRDM Board:

Debugging FRDM-KL25Z with FRDM-KL43Z Board

Debugging FRDM-KL25Z with FRDM-KL43Z Board

Updating the OpenSDA Firmware

šŸ’” In case you want to use the board with Windows 8, 10 or Mac, you need to have first a Windows 7 machine to update the bootloader. See “Illustrated Step-by-Step Instructions: Updating the Freescale Freedom Board Firmware“.

To update the OpenSDA firmware of the FRDM board:

  1. Power the board through the USB port labeled ‘SDA’, while having the Reset (RST) button pressed.
  2. Green LED near K20/USB port blinks with about 2 Hz
  3. The board enumerates as ‘BOOTLOADER’ device (MSD, disk drive) on the host.
  4. Copy the firmware file to the BOOTLOADER device.
  5. Repower the board normally.

šŸ’” If the ‘copy’ operation fails or does not work: use the command prompt, additionally make sure you don’t have an issue with firewalls or virus scanners.

With that, the FRDM board is like a normal debug probe and can be used as such.

Summary

It requires some soldering skills, a little extra hardware and a firmware file to turn a FRDM board into a normal debugging probe. I still recommend to use normal SWD/JTAG debug probes e.g. from Segger or P&E, as they were able to recover and work with all of my boards (especially unsecuring devices), while the FRDM board solution works, it is not that powerful. But as a quick and cheap solution it works fine.

Happy Debugging šŸ™‚

Links

Advertisements

30 thoughts on “Using the Freescale Freedom (FRDM-KL43Z) to Debug other Boards

  1. Erich,
    Another source for the 10 Pin headers is Mouser: 649-221111-00010T4LF.
    I add these to all the target CPU SWD on my FRDM-xxxx boards so I can debug with my J-Links.

    Mouser also has a nice ribbon cable: 855-M50-9100542
    It is 150mm long. They also stock a 300mm version too. I have tried both and they work fine with my two J-Links.
    Thanks for all your great work.

    Like

  2. Pingback: SWD Debugging the FRDM-KL43Z | MCU on Eclipse

  3. Hello Erich,

    I’m sorry if the procedure to attach an external target is a little difficult. When designing openSDA hardware, I wanted to make its output able to be used with a different target, but FRDM boards were required to work with a very tight budget, so having no headers at all was requested and I came up with the idea to leave unplaced footprints and solder shorts.

    Regards,
    Rafael.

    Like

    • Hi Raphael,
      so you designed that board? Nice to meet you :-). It is understood that the primary purpose of the board is to show and debug the onboard device. having parts and headers not populated is a common way to save costs: footprints and solder shorts are good to me. It is just that other vendors either do the same, or have more parts populated than Freescale.

      Like

      • Hello Erich,

        I designed FRDM concept with FRDM-KL25 board and openSDA. FRDM-KL25z bill of materials was required to cost around $5USD, including PCB; even USB routing technique is state of the art so we could maintain target impedance with a cost effective PCB (I mean uber-cheap). Actually, I had the opportunity to publish a paper about that.

        I’m a follower of your blog, I’m not very used to software and I would like to make a full app with FRDM boards. Nevertheless I often recommend my students to take a look at it.

        Un saludo,
        Rafael.

        Like

      • Hi Rafael,
        interesting, my thinking was that the FRDM board even in high volume will be at a cost above $5 (my guess is around $10). Is that paper you mention public somewhere?
        Probably you have seen https://mcuoneclipse.com/2015/11/28/a-raspberry-pi-for-5-what-are-your-decision-factors/: As for the $5 for the Raspberry Pi Zero: alone the memory and the ARM device should be around $5 in volume, not to count in all the other parts (but not that many). It is interesting to see what is possible.

        Like

      • Hi Raphael,
        yes, I have access to IEEE :-), thanks for passing that link. Interesting paper, indeed. As for the Raspberry Pi Zero for $5: I have ordered one, and if UPS is right, I should have it in my hand by today or tomorrow. I won’t have probably time to write a lot about it in the next two weeks, but hey: Christmas vacation is coming up šŸ™‚

        Like

  4. Pingback: How to Recover the OpenSDA V2.x Bootloader | MCU on Eclipse

  5. Pingback: Using the LPCXpresso V2/V3 Boards to Debug an external Board | MCU on Eclipse

  6. Hello,
    Can i use same FRDM KL43Z board to program/debug custom made MK10DN64 board using SWD interface. What changes are to be made.

    Thanks

    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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s