I love the Freescale Freedom boards because they are low-cost, and I do not need a special debug device, as they have the on-board OpenSDA. It is using a small Kinetis-K20 which acts as JTAG debugging probe. Why not using the Freedom board to program another board?

FRDM-KL25Z board programs another board

OpenSDA features a MSD (Mass Storage Device) Bootloader application. With this I can copy a S19 file to the ‘programmer’ and program another board. The Freedom boards come with an unpopluated JTAG 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 a JTAG cable to a microcontroller on another board.

For this I need:

The OpenSDA Firmware with Bootloader.

A 10pin ARM Cortex JTAG debug header to populate the one on the Freedom board.

To cut J11 trace on the Freedom board to isolate the microcontroller from OpenSDA.

A 10pin ARM Cortex JTAG debug cable to connect the two boards.

OpenSDA Firmware

P&E has recently (17th April 2013) updated the firmware. That package has the latest firmware files and supports the new FRDM-K20D50M which I’m using here. The firmware is available from http://www.pemicro.com/opensda.

OpenSDA 17th April 2013 Firmware

Required Hardware Changes

The Freedom board needs a 10pin JTAG debug header, and both boards needs to be connected by a 10pin ARM Cortex Debug cable.

By default, the Freedom boards come without the 10pin ARM Cortex debug header populated. So I need to add and solder such a header on J6:

SWD J6 Populated on the FRDM-KL25Z

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. I recommend to carefully inspect the soldered pins.

Next step is to 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 I cut off the resident microcontroller from OpenSDA on the same board:

J11 to isolate SWD Clock (Source: Freescale FRDM-KL25Z schematic)

So I need to cut the connection between J11 on the backside of the board:

J11 on the board backside

I recommend to cut the trace and install a dual-pin header/jumper:

Cut J11 Trace

J11 Header populated

Cutting the J11 trace is only needed for the Freedom ‘programmer’ board. If I want to program another Freedom board with the programmer, the ‘target’ board only needs the 10pin ARM Cortex Header populated. I have not modified the target board otherwise. If using a custom target board, then all what it needs is that ARM Cortex header for the connection.

Connecting the Boards

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

Connected Boards

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 power properly the target board.

Programming with MSD

The ‘programmer’ boards needs to have the MSD (Mass Storage Device) Bootloader loaded:

Now I can drag&drop or copy files to the bootloader device, and it will program the target board microcontroller (instead the resident microprocessor):

S-Record Generation with gcc for ARM/Kinetis

Programming a different Freedom Board

So far I have programmed with a KL25Z board another KL25Z Freedom board. But what about a programming a different ARM microcontroller, e.g. the K20 on the FRDM-K20D50M? This board has an SWD connector too:

Added the JTAG header:

Added JTAG Header

And then I hooked up the two boards:

FRM-KL25Z and FRDM-K20D50M

Unfortunately, that did not work . The OpenSDA green LED was flashing an error code, and failed to program the K20 on the other board.

It seems that OpenSDA is checking the target processor, and only allows to program the same processor as on the Freedom board. I only have one FRDM-K20D50M and one FRDM-KL05Z, so I cannot check if it is possible to program the same device. Given what works with the FRDM-KL25Z, I would think that it is possible to program the same microcontroller from the FRDM-K20D50M, and same for the FRDM-KL05Z.

Debugging

So far I have used the MSD Bootloader to program the other board. What about using the debugger? The result is the Error 17926 which tells that I only can debug the processor on the board:

Error 17926

To bad

Summary

With the Freedom board and OpenSDA, I have an inexpensive programmer for my boards. Programmer in the sense of programming a device, but not debugging it. It does not replace a P&E Multilink and it is not as fast as a Multilink, but for hobby projects it is a viable alternative or add-on value of the Freedom Board. Using the Freedom board as programmer seems only to allow to program the same microcontroller. To me, this limitation is in place not to cannibalize programming probe vendors like P&E Multilink or Segger J-Link. On the other end: as it is now, the Freedom board enables me to evaluate the microcontroller, and if I’m going to create my board with that microcontroller, I can program it with the Freedom board too. Debugging and developing things on the Freedom board, and then program a mini-batch of boards with it too. But I better have a Multilink or J-Link at hand when there is a problem I have to debug on that other board. Having the ability to use the Freedom board as a mini-series programmer is a plus in any case.