How do I use Freedom board as SWD programmer?

The Freescale Freedom boards have the on-board OpenSDA. The OpenSDA features an MSD (Mass Storage Device) Bootloader application. With this you can copy an S19 file to the programmer and program another board. The Freedom boards come with an unpopluated SWD header which can be used to debug the processor with a Multilink or J-Link debug probe. The idea is to disconnect the processor on the board from OpenSDA, and connect it instead with an SWD cable to a microcontroller on another board.

To do this, you need:

To use the Freedom Board as SWD programmer, follow these steps:

  1. Populate the J11 header
    1. By default, the Freedom boards come without the 10pin ARM Cortex debug header populated. So you need to add and solder such a header on J6:
      Figure 1. SWD J6 Populated on the FRDM-KL25Z

      SWD J6 Populated on the FRDM-KL25Z

      Tip: Use a good and fine soldering tip. The pads are very close to each other, so if using too much solder or not carefully solder the connector, there can be shortcuts between the pins. It is recommend to carefully inspect the soldered pins.
    2. Next, cut the J11 trace on the board. J11 needs to be used to remove the SWD clock to the target microcontroller on programmer Freedom board. With this you cut off the resident microcontroller from OpenSDA on the same board:
      Figure 2. J11 to isolate SWD Clock

      J11 to isolate SWD Clock

    3. Then you need to cut the connection between J11 on the backside of the board:
      Figure 3. J11 on the board backside

      J11 on the board backside

      It is recommend to cut the trace and install a dual-pin header/jumper:
      Figure 4. Cut J11 Trace

      Cut J11 Trace

    4. Then populate the J11 header:
      Figure 5. J11 Header - Populated

      J11 Header - Populated

      Note: Cutting the J11 trace is only needed for the Freedom programmer board. If you want to program another Freedom board with the programmer, the target board only needs the 10pin ARM Cortex Header populated. Otherwise, you do not need to modify the target board. If you are using a custom target board, then you only need ARM Cortex header for the connection.
  2. Connect the Boards

    You have to connect the two boards with the 10pin flat cable, making sure pin 1 connects to pin 1:

    Figure 6. Connected Boards

    Connected Boards

    Tip: The debug cable provides 3.3V for the target board. In the case of the Freedom board, that's sufficient to power the target board. Otherwise make sure you properly power the target board.
  3. Program the board with MSD

    To program the board with MSD(Mass Storage Device), you need to:

    1. Power the board with reset button pressed
    2. Wait until it enumerates as 'Bootloader' device
    3. Copy the MSD-FRDM-KL25Z_Pemicro_v109.SDA to it
    4. Re-power the board (without reset button pressed)
    The MSD Bootloader accepts S19 files. You can either drag&drop or copy the files to the bootloader device, and it will program the target board microcontroller (instead the resident microprocessor):
    Figure 7. S-Record Generation with gcc for ARM/Kinetis

    S-Record Generation with gcc for ARM/Kinetis