OpenOCD
adi_v5_dapdirect.c File Reference

Utilities to support in-circuit debuggers that provide APIs to access directly ARM DAP, hiding the access to the underlining transport used for the physical connection (either JTAG or SWD). More...

Include dependency graph for adi_v5_dapdirect.c:

Go to the source code of this file.

Functions

 COMMAND_HANDLER (dapdirect_jtag_empty_command)
 
 COMMAND_HANDLER (dapdirect_jtag_reset_command)
 
static void dapdirect_constructor (void)
 
static int dapdirect_init (struct command_context *ctx)
 
static int dapdirect_jtag_select (struct command_context *ctx)
 
static int dapdirect_swd_select (struct command_context *ctx)
 
bool transport_is_dapdirect_jtag (void)
 Returns true if the current debug session is using JTAG as its transport. More...
 
bool transport_is_dapdirect_swd (void)
 Returns true if the current debug session is using SWD as its transport. More...
 

Variables

static const struct command_registration dapdirect_jtag_handlers []
 
static const struct command_registration dapdirect_jtag_subcommand_handlers []
 
static struct transport dapdirect_jtag_transport
 
static const struct command_registration dapdirect_swd_handlers []
 
static const struct command_registration dapdirect_swd_subcommand_handlers []
 
static struct transport dapdirect_swd_transport
 

Detailed Description

Utilities to support in-circuit debuggers that provide APIs to access directly ARM DAP, hiding the access to the underlining transport used for the physical connection (either JTAG or SWD).

E.g. STMicroelectronics ST-Link/V2 (from version V2J24) and STLINK-V3.

Single-DAP support only.

For details, see "ARM IHI 0031A" ARM Debug Interface v5 Architecture Specification

FIXME: in JTAG mode, trst is not managed

Definition in file adi_v5_dapdirect.c.

Function Documentation

◆ COMMAND_HANDLER() [1/2]

COMMAND_HANDLER ( dapdirect_jtag_empty_command  )

Definition at line 31 of file adi_v5_dapdirect.c.

References CMD_NAME, ERROR_OK, and LOG_DEBUG.

◆ COMMAND_HANDLER() [2/2]

COMMAND_HANDLER ( dapdirect_jtag_reset_command  )

◆ dapdirect_constructor()

static void dapdirect_constructor ( void  )
static

Definition at line 198 of file adi_v5_dapdirect.c.

◆ dapdirect_init()

◆ dapdirect_jtag_select()

static int dapdirect_jtag_select ( struct command_context ctx)
static

Definition at line 155 of file adi_v5_dapdirect.c.

References dapdirect_jtag_handlers, LOG_DEBUG, NULL, and register_commands().

◆ dapdirect_swd_select()

static int dapdirect_swd_select ( struct command_context ctx)
static

Definition at line 162 of file adi_v5_dapdirect.c.

References dapdirect_swd_handlers, LOG_DEBUG, NULL, and register_commands().

◆ transport_is_dapdirect_jtag()

bool transport_is_dapdirect_jtag ( void  )

Returns true if the current debug session is using JTAG as its transport.

Definition at line 209 of file adi_v5_dapdirect.c.

References dapdirect_jtag_transport, and get_current_transport().

Referenced by adapter_assert_reset(), adapter_deassert_reset(), adapter_resets(), dap_check_config(), dap_init_all(), and stlink_dap_init().

◆ transport_is_dapdirect_swd()

bool transport_is_dapdirect_swd ( void  )

Returns true if the current debug session is using SWD as its transport.

Definition at line 218 of file adi_v5_dapdirect.c.

References dapdirect_swd_transport, and get_current_transport().

Referenced by adapter_assert_reset(), adapter_deassert_reset(), adapter_resets(), COMMAND_HANDLER(), dap_check_config(), dap_init_all(), and stlink_dap_init().

Variable Documentation

◆ dapdirect_jtag_handlers

const struct command_registration dapdirect_jtag_handlers[]
static
Initial value:
= {
{
.name = "jtag",
.mode = COMMAND_ANY,
.usage = "",
},
{
.name = "jtag_ntrst_delay",
.mode = COMMAND_ANY,
.handler = dapdirect_jtag_empty_command,
.usage = "",
},
}
static const struct command_registration dapdirect_jtag_subcommand_handlers[]
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:235

Definition at line 38 of file adi_v5_dapdirect.c.

Referenced by dapdirect_jtag_select().

◆ dapdirect_jtag_subcommand_handlers

const struct command_registration dapdirect_jtag_subcommand_handlers[]
static

Definition at line 38 of file adi_v5_dapdirect.c.

◆ dapdirect_jtag_transport

struct transport dapdirect_jtag_transport
static
Initial value:
= {
.name = "dapdirect_jtag",
.init = dapdirect_init,
}
static int dapdirect_init(struct command_context *ctx)
static int dapdirect_jtag_select(struct command_context *ctx)

Definition at line 169 of file adi_v5_dapdirect.c.

Referenced by transport_is_dapdirect_jtag().

◆ dapdirect_swd_handlers

const struct command_registration dapdirect_swd_handlers[]
static
Initial value:
= {
{
.name = "swd",
.mode = COMMAND_ANY,
.help = "SWD command group",
.usage = "",
},
}
static const struct command_registration dapdirect_swd_subcommand_handlers[]

Definition at line 38 of file adi_v5_dapdirect.c.

Referenced by dapdirect_swd_select().

◆ dapdirect_swd_subcommand_handlers

const struct command_registration dapdirect_swd_subcommand_handlers[]
static
Initial value:
= {
{
.name = "newdap",
.mode = COMMAND_CONFIG,
.jim_handler = jim_jtag_newtap,
.help = "declare a new SWD DAP",
},
}
@ COMMAND_CONFIG
Definition: command.h:41
int jim_jtag_newtap(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
Definition: jtag/tcl.c:715

Definition at line 38 of file adi_v5_dapdirect.c.

◆ dapdirect_swd_transport

struct transport dapdirect_swd_transport
static
Initial value:
= {
.name = "dapdirect_swd",
.init = dapdirect_init,
}
static int dapdirect_swd_select(struct command_context *ctx)

Definition at line 169 of file adi_v5_dapdirect.c.

Referenced by transport_is_dapdirect_swd().