I wrote Dapper Miser, an optimized and low-cost implementation of CMSIS-DAP, back in late 2013. ARM's draconian and inconsistent licensing has made me reluctant to risk releasing source code, but I actively use it internally. (EDIT: due to ARM revamping the EULA, the source code is now available here as of Jan 2018).
Seeing as several years has past, I thought that I would jot down some observations / limitations of the CMSIS-DAP standard.
1) The Capabilities value, obtained via DAP_Info, indicates whether SWD and/or JTAG are implemented. A fail in the specification is that it does not formally enumerate which of the CMSIS-DAP messages should be supported for each of these. It should have formally stated that General Commands, Common SWD/JTAG Commands, and Transfer Commands are common to both modes, and SWD Commands and JTAG Commands are specific to their respective modes.
2) The message DAP_SWJ_Pins is ill conceived. This command gives direct control over pins and allows any of them to be driven as outputs. The message cannot be omitted in an implementation, as it is used in real-world PC software implementations for controlling nRESET and nTRST. However, any sensible CMSIS-DAP implementation should not allow the other pins to be controlled at all. Moreover, it is advisable to restrict nRESET and nTRST to only operate as open-collector. Letting PC software cause electrical contention on your hardware is just a bad idea.
3) USB 1.1 implementations require modest expectations for performance. This isn't the fault of USB 1.1 per se, but rather because USB 1.1 HID devices are restricted to packet sizes of 64 bytes. Using a custom USB protocol would have allow better throughput, but the reason the CMSIS-DAP authors chose HID was to ensure a "driver-less" implementation.
4) DAP_ResetTarget: nobody uses it.
5) Value Match and Mask in DAP_Transfer: laudable idea and opportunity to improve performance, but nobody uses it. (EDIT: this was written in 2016, but as of Mar 2019, at least one mainstream IDE is using this feature.)
6) The Transfer Count field is one byte in DAP_Transfer, but two bytes in DAP_TransferBlock. This should have been a consistent size.
7) Don't use their reference source code; trust only ARM's original specifications. Their SW-DP implementation doesn't even properly conform to ARM's specifications.
8) DAP_WriteABORT is redundant.
back to main page contact