1. About the SWDAP probe
I bought an SWDAP probe some time ago from L-Tek (see https://www.l-tek.com/web-shop/l-tek-swdap-interface/). It took me some time to figure out the terminology, but I learned that:
CMSIS-DAPis a standard defined by ARM. All probes that comply with this standard can flash and debug ARM target chips.
SWDAPis an open-source probe, built by ARM. In fact, it's a reference hardware-implementation of the above mentioned standard. The SWDAP is sold by L-Tek and is based on a NXP
LPC11U35chip. (See https://github.com/ARMmbed/mbed-HDK-Eagle-Projects/tree/master/DAPLink/Probes/SWDAP).
DAPLinkis an open-source firmware (written by ARM) that runs on the SWDAP probe. It is the reference software-implementation of the above mentioned standard. (See https://github.com/ARMmbed/DAPLink).
2. Firmware update
I would like to update the firmware on my SWDAP probe. In other words, I want to flash the latest DAPLink firmware to my SWDAP probe.
I don't see a proper explanation how to do this.
2.1 First try
I found the following webpage:
But this webpage is a two year old blogpost. The binaries it links to are certainly deprecated.
2.2 Second try
Thank you @RonBeyer for your answer. I clicked on your link (https://os.mbed.com/platforms/SWDAP-LPC11U35/) and noticed there are indeed some Prebuilt Images (binaries), but only for:
- NXP K64F
- NXP LPC1768
- Nordic nRF51822
- Multitech xDOT
Unfortunately, the NXP
LPC11U35 is not in that list. Anyhow, I downloaded all of the binaries, and guess what their names are:
- NXP K64F =>
- NXP LPC1768 =>
- Nordic nRF51822 =>
- Multitech xDOT =>
So this confuses me even more. I have no idea which binary I should flash to the probe.
2.3 Third try
Thank you @RonBeyer for clarifying the naming convention of these binaries:
Also many thanks for pointing out the webpage where to find the latest binaries for the SWDAP probe:
From the releases page, just scroll down a little bit until you see ">Assets" right under the "notes" part and expand that. You will see a download link for the release.
It seems natural to have a different binary per Probe Chip. But it is striking to have different binaries for the Target Chips, especially because the SWDAP probe aims to work for all ARM targets (all targets that follow the CMSIS-DAP standard). Therefore, I developed my own theory about this thing:
If you want a general SWDAP probe, take the binary without
[Target Chip]in the name. So for my probe that would be
0254being the version nr,
lpc11u35the probe chip and
0x0000the standard offset. The drag-and-drop feature* from this general SWDAP probe doesn't work. But if you use OpenOCD to flash the target, then it will always work.
If you want to use the drag-and-drop feature*, then choose the binary that corresponds to your specific target chip.
* The drag-and-drop feature makes the SWDAP probe appear as a MSD (Mass Storage Device) when you plug it into your computer. To flash the target chip, you simply have to drag-and-drop the binary file to that MSD.
This is just a theory of mine. Please help if you got more insight into the matter.
EDIT: Apparently, this theory is correct. Thank you @ChrisReed to clarify that ^_^
Now that I finally got the right binary file
0254_lpc11u35_0x0000.bin I am totally ready to flash it to the probe.
I plug in the probe while holding the reset button down. As soon as it is plugged in, Dropbox pops up and asks me to import stuff. I click No, but it makes me hopeful that some kind of storage device is recognized. I open the Windows File Explorer, and I see the "CRP Disabled" device:
Only now that I see the "CRP Disabled" device, I dare to release the reset button on the SWDAP probe. I click on the "CRP Disabled" device to see its contents:
I delete the
firmware.bin file from the probe (but I first save a backup of it somewhere on my computer). And yes, I am sure:
I copy-paste the new firmware
0254_lpc11u35_0x0000.bin to the probe:
I plug out the probe, and plug it back in (this time not touching the reset button). The first time I did this, I got a little Windows announcement in the right down corner that CMSIS-DAP was being installed. But from the second time onward, that announcement no longer appears. However, I can see the device in:
Control Panel > Hardware and Sound > Devices and Printers
I connect the SWDAP probe to my target board (a small board with a STM32F767ZI microcontroller). Now I run OpenOCD to flash a binary to the target chip. It doesn't work!
I use the exact same OpenOCD commands that I used before updating the SWDAP firmware. It used to work before that update. But now it fails over and over again. I get the following error from OpenOCD:
2.4 Restore original firmware
Luckily I had taken a backup from the original
firmware.bin on the probe. I now follow the steps described above again, this time to restore the original firmware.
To my great relief, I can again flash my target board using OpenOCD.
With the help from @RonBeyer and @ChrisStratton, I managed to flash the SWDAP probe with the latest DAPLink firmware
0254_lpc11u35_0x0000.bin. Unfortunately, this causes the probe to malfunction with OpenOCD. Luckily I had kept a backup from the original firmware on the probe. Restoring that backup brings the probe back to live.
The purpose of this question is fulfilled: I can flash new firmware to the probe. The new problem that arised is about the firmware itself. I've opened a separate question for that problem: DAPLink firmware doesn't operate with OpenOCD
🖒 Thumbs up for ARM, and for @ChrisReed who replied very quickly on my GitHub issue that I raised on DAPLink! He clarified to me that all binaries with a specific "target chip" in the name should actually work for all target chips, provided that you don't use the drag-and-drop functionality.