dap42 firmware release 2.0.0
This is a major release adding support for the CMSIS-DAP v2 bulk interface and changing the way the USB stack is processed.
Core changes
Updated CMSIS-DAP to version 2
dap42 now support CMSIS-DAP protocol version 2.1.0. It doesn't support all of the new functionality for SWO/UART, but it at least recognizes all of the latest commands, especially for new fields in DAP_INFO
commands to report version information and capabilities.
dap42 will now report its own firmware version in DAP_INFO
separately from the CMSIS-DAP protocol version. It also reports its serial number.
Updating to CMSIS-DAP 2.0 also improves compatibility with multi-drop targets like the RP2040.
Thanks to @dmsc for the help updating to v2.0 in #17.
Furthermore, thanks to @xobs for adding support for bulk transfers by in #23, which offers a big speedup over the CMSIS-DAP v1 HID interface.
On STM32F042 targets, both the v1 and v2 interfaces are exposed in the same configuration, allowing the host to use whichever interface it supports. On STM32F103 targets, there is not enough space in the USB packet memory area to support both v1 and v2 at the same time. On those targets going forward, the v2 bulk interface is the default selection, but for compatibility, I'm also providing -HID
targets that use the v1 HID interface instead.
The -HID
targets will also report CMSIS-DAP version 1.3.0 instead of 2.1.0 to reflect that they only support the HID interface.
JTAG support
JTAG support is now included, but not enabled on any of the release binaries. Check out the TINYDYNE target for an example that enables JTAG. (Thanks @xobs in #26!)
Automatic WinUSB drivers
To facilitate support on Windows, dap42 now provides MS-OS 2.0 descriptors to automatically bind the WinUSB driver to the CMSIS-DAP v2 bulk interface and the DFU interface, when applicable. This should avoid the need to install drivers manually on recent versions of Windows.
Note: this may not work automatically in all instances, especially on a machine that has already seen dap42 plugged in at least once. You may need to fall back on Zadig instead if this happens.
Interrupt-based USB handler
USB is now handled in an interrupt handler instead of polling from the main loop. To avoid race conditions, we no longer support reading the response via HID GET_REPORT
class request. In practice, it is unlikely this ever could have worked since we need to consume response reports by pushing them to the endpoint buffer.
LEDs and reset lines are now optional
If any of the relevant pin and port definitions are left undefined for LEDs or the reset line, that functionality will be disabled.
Thanks to @xcvista in #6.
Target changes
Bluepill target
The defacto "bluepill" target is now supported as a target. Because the pinout is somewhat arbitrary, I'm not including prebuilt binaries for this target in this release; I encourage you to adapt it to your needs and compile it yourself. Thanks to @Disasm in #9.
STLink/v2-1 Nucleo target
The experimental target for the embedded STLink/v2-1 on Nucleo boards now has the correct UART configuration and has a conventional build target suitable for directly flashing to the STLink/v2-1 (requires some soldering). Thanks to @omicronns in #25.
Because this is experimental and requires soldering and erasing the read-protected bootloader, I'm not including prebuilt binaries for this target in this release.
libopencm3 updates
- The libopencm3 submodule has been updated to [3a85f91] (2025-02-26) (with help from @hemashushu in #19 along the way).
- This fixes a bug in the CDC-ACM implementation that was using the wrong definition for the GET LINE CODING request that I pulled from who knows where.