- Run out of SRAM, it goes quite a lot faster
- Cache the DAP clock frequency
- Read RDATA and write WDATA all in one go, and merge the turnaround
into the ACK phase. Reduces the number of missed PIO SM cycles during an
SWD transfer
Also fix a compiler warning and demote the loglevel of some debug messages.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
CMSIS-DAP v1 is a pseudo-HID device which allows "driver-less" use on
Windows. DAP v2 is a vendor-specific bulk protocol, so there needs to be
a companion MS OS 2.0 descriptor for the debug interface with
DeviceInterfaceGUID set to the Keil GUID.
Allow for selection between these and the openocd protocol at compile time.
Parts of the v1 implementation are derived from the DapperMime project, so
add credit where due.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
CMSIS-DAP implementations explicitly use CPU bitbash to control SWD and
SWDIO, but we can do better. Transfers are handed off to PIO in phases,
which gets us deterministic clock timing as well as freeing the CPU up
for other tasks.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
This commit fixes a few deadlock scenarios and makes cdc_task more
amenable to being called in a threadable context. Full-duplex is now
reliable at fast and slow baudrates.
There is still an annoyance where if the CDC interface is deactivated
while the UART RX is still active, buffers queued to the endpoint
hardware aren't flushed. This is a tinyUSB interface bug.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>