-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented CMSIS-DAP v2 support on Linux
- Loading branch information
Showing
6 changed files
with
314 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// Copyright (c) 2013-2022, Alex Taradov <[email protected]>. All rights reserved. | ||
// Copyright (c) 2013-2024, Alex Taradov <[email protected]>. All rights reserved. | ||
|
||
/*- Includes ----------------------------------------------------------------*/ | ||
#include <stdio.h> | ||
|
@@ -682,7 +682,7 @@ static void append_word(uint32_t value) | |
//----------------------------------------------------------------------------- | ||
static bool buffer_request(dap_request_t *req) | ||
{ | ||
int packet_size = dbg_get_report_size(); | ||
int packet_size = dbg_get_packet_size(); | ||
int buf_size, ops_size, response_size, address_inc; | ||
uint32_t address, csw; | ||
bool set_address; | ||
|
@@ -1046,7 +1046,7 @@ void dap_jtag_flush(void) | |
tdo_count = 0; | ||
req_count = 0; | ||
req_size = 2; // Command and Count | ||
remaining = dbg_get_report_size() - req_size - 1; | ||
remaining = dbg_get_packet_size() - req_size - 1; | ||
|
||
while (index < dap_jtag_request_count) | ||
{ | ||
|
@@ -1107,7 +1107,7 @@ void dap_jtag_flush(void) | |
tdo_count = 0; | ||
req_count = 0; | ||
req_size = 2; // Command and Count | ||
remaining = dbg_get_report_size() - req_size - 1; | ||
remaining = dbg_get_packet_size() - req_size - 1; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// Copyright (c) 2013-2022, Alex Taradov <[email protected]>. All rights reserved. | ||
// Copyright (c) 2013-2024, Alex Taradov <[email protected]>. All rights reserved. | ||
|
||
#ifndef _DBG_H_ | ||
#define _DBG_H_ | ||
|
||
/*- Includes ----------------------------------------------------------------*/ | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
#include <stdbool.h> | ||
|
||
/*- Definitions -------------------------------------------------------------*/ | ||
#define DBG_MAX_EP_SIZE 1024 | ||
#define DBG_MAX_EP_SIZE 1024 | ||
|
||
#define DBG_CMSIS_DAP_V1 (1 << 1) | ||
#define DBG_CMSIS_DAP_V2 (1 << 2) | ||
|
||
/*- Types -------------------------------------------------------------------*/ | ||
typedef struct | ||
|
@@ -21,13 +25,26 @@ typedef struct | |
char *product; | ||
int vid; | ||
int pid; | ||
|
||
int versions; | ||
bool use_v2; | ||
|
||
int v1_interface; | ||
int v1_ep_size; | ||
int v1_tx_ep; | ||
int v1_rx_ep; | ||
|
||
int v2_interface; | ||
int v2_ep_size; | ||
int v2_tx_ep; | ||
int v2_rx_ep; | ||
} debugger_t; | ||
|
||
/*- Prototypes --------------------------------------------------------------*/ | ||
int dbg_enumerate(debugger_t *debuggers, int size); | ||
void dbg_open(debugger_t *debugger); | ||
void dbg_open(debugger_t *debugger, int version); | ||
void dbg_close(void); | ||
int dbg_get_report_size(void); | ||
int dbg_get_packet_size(void); | ||
int dbg_dap_cmd(uint8_t *data, int resp_size, int req_size); | ||
|
||
#endif // _DBG_H_ | ||
|
Oops, something went wrong.