EDIT :
I got the basic questions (for example, what is CMSIS-DAP
?) answered by user @Nipo. Based on that, I restructured my post in a more logical way. Hopefully the remaining questions will be answered as well 🙂
Â
1. Programming a microcontroller
To program and/or debug a microcontroller, the following procedure is common:
There are tons of different probes on the market. The communication between the probe and the microcontroller is standardized in the SWD
and JTAG
protocols. The communication between the probe and the host computer is unfortunately not standardized. That makes the job of OpenOCD very hard. This software – running on the host computer – attempts to connect to the probe. Just imagine how much work the OpenOCD folks have to support all of them!
ARM makes an effort to standardize this USB-communication between the probe and the host computer.
Â
2. The CMSIS-DAP standard
CMSIS-DAP
is the specification (or standard, or protocol, or …) from ARM, defining how a programmer/debug probe should be built. From my understanding, it specifies some hardware aspects as well as the communication protocol between the host computer and the probe(1).
QUESTION 1:
Where is the official CMSIS-DAP
specification to be found? I know the GitHub of CMSIS-DAP
is getting replaced by a new GitHub from DAPLink
. But let's not forget: DAPLink
is merely an implementation of the standard. I don't know where to find the standard itself…
ANSWER:
User @Nipo posted the links:
- Official
CMSIS-DAP
page: http://arm-software.github.io/CMSIS_5/DAP/html/index.html CMSIS-DAP
Details: http://arm-software.github.io/CMSIS_5/DAP/html/group__DAP__Commands__gr.html
Â
(1) I believe the communication between the probe and the host computer is defined by this CMSIS-DAP
protocol, but not the communication between the probe and the microcontroller, because that's already defined by either the JTAG
or SWD
protocol.
Â
3. The SWDAP probe and DAPLink
The SWDAP
probe is a hardware implementation and DAPLink
a firmware implementation of the CMSIS-DAP
specification. Obviously, the DAPLink
firmware runs on the SWDAP
hardware.
I list the SWDAP
resources for you:
- Official website: https://os.mbed.com/teams/mbed/wiki/SWDAP
- Official docs: https://os.mbed.com/platforms/SWDAP-LPC11U35/
- Official distributor page: https://l-tek.si/web-shop/l-tek-swdap-interface/
And the DAPLink
resources:
- Official website: https://os.mbed.com/handbook/DAPLink
- Official GitHub page: https://github.com/ARMmbed/DAPLink
Â
QUESTION 2:
The SWDAP
probe runs the DAPLink
firmware, so it should support both SWD
and JTAG
. But Mr. Gorazd Kovacic from LTek answered me in a mail that the SWDAP
probe supports only SWD
. I believe he is wrong. What do you think?
Note: I can only test it next week when the right hardware arrives.
ANSWER:
User @Nipo states: "All probes using DAPLink implementation as core firmware will provide the same set of functionalities." So the only limitation is on the hardware. If the hardware manufacturer did not provide the proper JTAG connections, you're out of luck.
Â
4. Using OpenOCD for the SWDAP probe
I know that the SWDAP
probe is built for use with pyOCD. That brings us to my third question:
Â
QUESTION 3:
Can the SWDAP
probe (and the CMSIS-DAP
probe) be used with OpenOCD also? Or only with pyOCD?
Â
Â
ANSWER:
I got a mail from the OpenOCD developers mailing list to answer this question. Mr. Paul Fertser mentioned the cmsis-dap.cfg
config file, to be found in the openocd/scripts/interface/
folder. I will test it next week, when my hardware arrives.
Â
5. The mysterious CMSIS-DAP probe
The CMSIS-DAP
probe from LTek (https://l-tek.si/web-shop/cmsis-dap-debug-probe) is still somewhat a mystery to me. As CMSIS-DAP
is just a standard (or call it 'specification' or 'protocol'), the probe's name is a bit confusing. Therefore it should be named CMSIS-DAP
-compliant probe instead.
This brings us to the last question:
Â
QUESTION 4:
I still don't get how this probe differs from the SWDAP
probe. They are both from the same supplier LTek, and seem to be designed both by ARM.
ANSWER:
Apparently, this probe is just some kind of clone of the SWDAP
probe, therefore complying to the CMSIS-DAP
standard. The name of this probe is just a bit misleading.
Best Answer
CMSIS is the generic name for ARM-specified infrastructure around Cortex processors. The project we know today as DAPLink actually started as mbedmicro/CMSIS-DAP, we can find multiple references of the rename in the project history. "CMSIS-DAP" name became ambiguous as it was both the name for the spec and Mbed's implementation.
So today, CMSIS-DAP is the protocol, DAPLink is an implementation of this protocol.
CMSIS-DAP is not the most efficient debugger protocol in the JTAG/SWD world, but gets the job done at a (very) reasonable probe-side computing resources (i.e. entry-level MCUs with USB can run it, like cheap LPC11s). CMSIS-DAP is supported by OpenOCD and many other tools on the host side.
CMSIS-DAP specifies both JTAG and SWD commands, DAPLink provides support for both.
As DAPLink is an implementation with a permissive license, it can basically be used anywhere at no extra cost. Many different vendors create boards with DAPLink firmware on them, either alone (making a standalone probe like you linked) or alongside a target CPU (like we have on devboards). All hardware implementations of DAPLink embed the same firmware with the same functionalities, and you should be able to rebuild DAPLink and update them if needed.
Update after modifications from OP
CMSIS-DAP is defined in relevant document on ARM software page. You'll find all the details in Reference section.
LTek may name its boards as they want, even if name is somewhat misleading.
As I wrote above, all probes using DAPLink implementation as core firmware will provide the same set of functionalities.
As for the SWD/JTAG support, the only limitation you may have on some boards will be hardware: if manufacturers did not provide connections for TDI and TDO, you are out of luck to make JTAG work with them.
About SWDAP probe, ARM's own page states "The SWDAP is an open hardware design delivered as part of the mbed-HDK", that's why LTek is able to provide a verbatim clone.