Over a million developers have joined DZone.

Reprogramming the Hexiwear Docking Station

DZone's Guide to

Reprogramming the Hexiwear Docking Station

You can (and must) use a debug probe to reprogram the Hexiwear docking station. This guide will show you how to get in using the station's pins.

· IoT Zone
Free Resource

The Hexiwear docking station has a nice feature: an embedded a debug circuit (OpenSDA). That way, I don't need an external debug probe to debug the Hexiwear. However, a debug probe is required to reprogram the docking station itself:

Repgrogramming the Mikroelektronika Docking Station

Reprogramming the Mikroelektronika docking station

I have not used the docking station debug circuit so far. It does not work out of the box. I would have to install pyOCD (which never worked well on my machine), and the default OpenOCD is simply not usable (too slow and seems not to support the KW40 device). Additionally, Windows 10 rendered the default OpenSDA debug firmware useless within seconds (see Bricking and Recovering OpenSDA Boards in Windows 8 and 10).

Instead, I successfully used external debug probes (P&E Multilink and Segger J-Links), including restoring the original firmware (see Flashing and Restoring the Hexiwear Firmware). Still, it might come handy if I have working firmware on the docking station, either the P&E or Segger one. However, to recover and program the OpenSDA bootloader, an external probe is required.

I’m using a Segger J-Link in this post, but any other ARM SWD/JTAG probe would do it too. It shows how to program the OpenSDA (DAPLink) bootloader on the docking station.

NXP Kinetis K20 SWD Header

First I need to find the SWD debug header to reprogram the NXP Kinetis K20 on the board:

Hexiwear Docking Station Schematics

Hexiwear docking station schematics

The footprint for that header is located here:

K20 SWD Footprint

K20 SWD footprint

No idea why the designers have placed that header under the Hexiwear itself: having it placed outside (with the correct orientation would make more sense in my opinion.

For programming the K20/OpenSDA, make sure the OSDA switch is in the ON position:

OSDA in ON Position

OSDA in the ON position

Because that connector is not populated, a standard ARM 10-pin debug header is needed:

ARM 2x5 SWD/JTAG Header

ARM 2×5 SWD/JTAG header

However, I’m not going to solder that header in (not needed). Instead, I put the header into the debug connector cable:

Debug Header on Debug Cable

Debug header on debug cable

Then use the header to make a connection with the board on the bottom side. Pay attention to the white dot marking pin 1:

Debug Header Footprint on Bottom Side

Debug header footprint on bottom side

Put in the header with the cable. The header should fit nicely and make contact — otherwise, pull on the cable to make sure there's good contact. Make sure you properly align the red wire to pin 1:

Inserted Debug Cable

Inserted debug cable

Programming the DAPLink Bootloader

I used the approach outlined in “Bricking and Recovering OpenSDA Boards in Windows 8 and 10” to program the OpenSDA/DAPLink bootloader:

Running Script to program the bootloader

Running script to program the bootloader

After successfully programming the bootloader, it shows up as DAPLINK:



Now it is ready to be programmed with any OpenSDA (P&E, Segger, etc.) firmware.

The default bootloader on the Hexiwear docking station can be reprogrammed so it can be used with Windows 10 either as a P&E or Segger OpenSDA probe. I still prefer to use the external debug probe, but to have an extra debug interface on the docking station comes handy. In any case, I recommend always to have a commercial debug probe at hand, as the ‘free’ ones from the silicon vendors are good to start with, but they cannot solve the hard problems, or you might end up with a pile of bricked boards on your desk.

Happy Dockstationing!

debug ,hexiwear ,iot ,tutorial ,bootloader

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}