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.
Join the DZone community and get the full member experience.
Join For FreeThe 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:
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:
The footprint for that header is located here:
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:
Because that connector is not populated, a standard ARM 10-pin debug header is needed:
However, I’m not going to solder that header in (not needed). Instead, I put the header into the debug connector 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:
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:
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:
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!
Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments