Skip to content

Commit

Permalink
Added CMSIS-DAP v2 support on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ataradov committed Jan 16, 2024
1 parent a0687aa commit c983cef
Show file tree
Hide file tree
Showing 5 changed files with 331 additions and 101 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ else
else
BIN = edbg.exe
SRCS += dbg_win.c
LIBS += -lhid -lsetupapi
LIBS += -lhid -lwinusb -lsetupapi
endif
endif

Expand Down
2 changes: 2 additions & 0 deletions dbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ typedef struct
int versions;
bool use_v2;

char *v1_path;
int v1_interface;
int v1_ep_size;
int v1_tx_ep;
int v1_rx_ep;

char *v2_path;
int v2_interface;
int v2_ep_size;
int v2_tx_ep;
Expand Down
6 changes: 6 additions & 0 deletions dbg_lin.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ static void parse_descriptors(debugger_t *debugger, int fd, uint8_t *desc, int s

if (USB_CLASS_HID == interface->bInterfaceClass)
{
if (!usb_endpoint_xfer_int(ep0) || !usb_endpoint_xfer_int(ep1))
continue;

if (usb_endpoint_dir_in(ep0))
{
debugger->v1_tx_ep = ep1->bEndpointAddress;
Expand All @@ -150,6 +153,9 @@ static void parse_descriptors(debugger_t *debugger, int fd, uint8_t *desc, int s

if (USB_CLASS_VENDOR_SPEC == interface->bInterfaceClass)
{
if (!usb_endpoint_xfer_bulk(ep0) || !usb_endpoint_xfer_bulk(ep1))
continue;

if (usb_endpoint_dir_in(ep0))
continue;

Expand Down
Loading

0 comments on commit c983cef

Please sign in to comment.